Skip to content

Adapt name of field put into MDC for trace_id #8402

Answered by laurit
huehnerlady asked this question in Q&A
Discussion options

You must be logged in to vote

Currently there is no way to customize the MDC keys for trace_id etc. There is #7985 but it is unknown when or whether this will be accepted. I think that this really isn't a big issue. For modern versions of both log4j and logback adding stuff to MDC is not hard, you can easily copy paste our instrumentations and modify them as you see fit and disable what the agent provides. See https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/library-autoconfigure and https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/logback/logback-mdc-1.0/library

Replies: 1 comment 1 reply

Comment options

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

Answer selected by huehnerlady
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