Adapt name of field put into MDC for trace_id #8402
-
Hi, We are now using the javaagent and I can see that the trace-id is put into MDC under the label Unfortunately we still have an old trace-id, which also runs under that same label. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Currently there is no way to customize the MDC keys for |
Beta Was this translation helpful? Give feedback.
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