|
Is there any solutions to map LogAttributes to SeverityText? my otel-col's config my slog's handler |
Answered by
dmathieu
Oct 22, 2024
Replies: 1 comment 1 reply
|
As documented in the log bridge, the severity text is not set. Setting severity text through an attribute would be a hack and not a good solution. |
1 reply
Answer selected by
Wudadada
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


As documented in the log bridge, the severity text is not set.
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/bridges/otelslog/handler.go#L14-L15
Setting severity text through an attribute would be a hack and not a good solution.
However,
sloghas a String representation of its level. So we could set the severity text based on that.This is what zap bridge does too: https://github.com/open-telemetry/opentelemetry-go-contrib/blob/91fbe993c54e5ab115cc89ac6a5249fd1f31ea32/bridges/otelzap/core.go#L200