Rename logging properties to include -key suffix#18765
Open
adithyag17 wants to merge 4 commits into
Open
Conversation
Renamed otel.instrumentation.common.logging.{trace-id,span-id,trace-flags}
to {trace-id-key,span-id-key,trace-flags-key} to clarify these properties
configure key names, not values.
Fixes open-telemetry#18470
|
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR renames the “common logging” configuration properties to include a -key suffix, clarifying that they configure the key names used for trace/span correlation fields in logging contexts (MDC / ThreadContext / context data) across multiple instrumentation modules.
Changes:
- Renamed the system properties
otel.instrumentation.common.logging.trace-id|span-id|trace-flagsto...trace-id-key|span-id-key|trace-flags-keyacross Spring Boot autoconfigure and logging instrumentations. - Updated module metadata/docs (YAML, Spring configuration metadata, READMEs) and test JVM args to use the renamed properties.
- Updated Log4j2 (2.17+) autoconfigure logic to read the renamed properties when resolving logging context key names.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| instrumentation/spring/spring-boot-autoconfigure/src/testLogbackAppender/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/instrumentation/logging/LogbackAppenderTest.java | Updates Spring Boot test properties to the new *-key names. |
| instrumentation/spring/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json | Updates Spring configuration metadata entries to the renamed property names. |
| instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/instrumentation/logging/LogbackAppenderInstaller.java | Reads the renamed properties to configure Logback appender MDC key names. |
| instrumentation/logback/logback-mdc-1.0/metadata.yaml | Updates Logback MDC instrumentation metadata to the renamed properties. |
| instrumentation/logback/logback-mdc-1.0/library/build.gradle.kts | Updates test JVM args to set renamed properties. |
| instrumentation/logback/logback-mdc-1.0/javaagent/README.md | Updates documented property names to *-key. |
| instrumentation/logback/logback-mdc-1.0/javaagent/build.gradle.kts | Updates test JVM args to set renamed properties. |
| instrumentation/log4j/log4j-mdc-1.2/metadata.yaml | Updates Log4j 1.2 MDC instrumentation metadata to the renamed properties. |
| instrumentation/log4j/log4j-mdc-1.2/javaagent/README.md | Updates documented property names to *-key. |
| instrumentation/log4j/log4j-context-data/log4j-context-data-2.7/metadata.yaml | Updates Log4j2 2.7 context-data instrumentation metadata to the renamed properties. |
| instrumentation/log4j/log4j-context-data/log4j-context-data-2.7/javaagent/build.gradle.kts | Updates test JVM args to set renamed properties. |
| instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/metadata.yaml | Updates Log4j2 2.17 context-data instrumentation metadata to the renamed properties. |
| instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/log4j/contextdata/v2_17/internal/ContextDataKeys.java | Updates property lookups to the renamed *-key names. |
| instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/library-autoconfigure/README.md | Updates documentation table to show renamed system property names. |
| instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/library-autoconfigure/build.gradle.kts | Updates test JVM args to set renamed properties. |
| instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/javaagent/README.md | Updates documented property names to *-key. |
| instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/javaagent/build.gradle.kts | Updates test JVM args to set renamed properties. |
| docs/instrumentation-list.yaml | Updates the generated instrumentation list docs to the renamed properties. |
- OTEL_INSTRUMENTATION_COMMON_LOGGING_TRACE_ID_KEY - OTEL_INSTRUMENTATION_COMMON_LOGGING_SPAN_ID_KEY - OTEL_INSTRUMENTATION_COMMON_LOGGING_TRACE_FLAGS_KEY This change affects Log4j context-data (2.7, 2.17), Log4j MDC 1.2, Logback MDC 1.0, and Spring Boot autoconfigure modules. Fixes open-telemetry#18470
Contributor
|
Usually we deprecate the old property and emit a warning when it is used, like you yourself described in #18470 (comment) I believe you should also modify |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rename common logging properties to include -key suffix
Renamed the following properties to clarify they configure key names:
This change affects Log4j context-data (2.7, 2.17), Log4j MDC 1.2,
Logback MDC 1.0, and Spring Boot autoconfigure modules.
Fixes #18470
/breaking-change