Skip to content

Filed 'SeverityText' is not mapped from field 'LogAttributes' #5902

Answered by dmathieu
Wudadada asked this question in Q&A
Discussion options

You must be logged in to vote

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

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Wudadada
Comment options

Answer selected by Wudadada
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants