-
Is there any solutions to map LogAttributes to SeverityText? my otel-col's config
my slog's handler
|
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
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,
slog
has 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