How can I automatically add attributes to logs such as tracing::info!()? #1497
-
I would like to give an attribute of trace_id to the log to tie the log to the trace in New Relic.
However, this method is very cumbersome. |
Beta Was this translation helpful? Give feedback.
Answered by
cijothomas
Jan 29, 2024
Replies: 1 comment 3 replies
-
Logs to Trace correlation should be automatically done, if you are using the opentelemetry-tracing-appender. There is no need of explicitly pass the traceid, instead it'll be automatically correlated, as long as you have instrumented using OTel Tracing API for your traces. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
cijothomas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Logs to Trace correlation should be automatically done, if you are using the opentelemetry-tracing-appender. There is no need of explicitly pass the traceid, instead it'll be automatically correlated, as long as you have instrumented using OTel Tracing API for your traces.