opentelemetry-java-instrumentation
opentelemetry-java-instrumentation copied to clipboard
feature: allow to customize trace id, span id and trace flag attribute name in log
this pull request allow to use a custom name for trace id related attributes
Usage exemple :
<appender name="OTEL_COLLECTOR" class="io.opentelemetry.instrumentation.logback.mdc.v1_0.OpenTelemetryAppender">
<traceFlagsAttributeName>trace.flags</traceFlagsAttributeName>
<spanIdAttributeName>span.id</spanIdAttributeName>
<traceIdAttributeName>trace.id</traceIdAttributeName>
</appender>
maybe there is some documentation to update related to this ?
hi @RouxAntoine! can you expand on the motivation, e.g. I'm curious if this is for integrating with an ECS-based system (Elastic Common Schema)?
hello @trask,
yes this is exactly the purpose, in the OpenTelemetryAppender we reference the default logback ch.qos.logback.core.ConsoleAppender which contain itself the encoder <encoder class="co.elastic.logging.logback.EcsEncoder">
This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 14 days.
closes as it is now supported
https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/logback/logback-mdc-1.0/library/src/main/java/io/opentelemetry/instrumentation/logback/mdc/v1_0/OpenTelemetryAppender.java#L59-L61