Skip to content

Why my logs werent sent to otel-collector but trace were? #5895

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

You must be logged in to vote

You need to use https://pkg.go.dev/go.opentelemetry.io/contrib/bridges/otelslog if you want slog.Logger to send logs to OpenTelemetry Logger. Currently you are using slog.NewTextHandler to send them to standard output.

You can also look at https://opentelemetry.io/docs/languages/go/getting-started/#add-custom-instrumentation

PS. Share text instead of printscreens.

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