Skip to content

Rename logging properties to include -key suffix#18765

Closed
adithyag17 wants to merge 4 commits into
open-telemetry:mainfrom
adithyag17:main
Closed

Rename logging properties to include -key suffix#18765
adithyag17 wants to merge 4 commits into
open-telemetry:mainfrom
adithyag17:main

Conversation

@adithyag17

Copy link
Copy Markdown

Rename common logging properties to include -key suffix

Renamed the following properties to clarify they configure key names:

  • otel.instrumentation.common.logging.trace-id → trace-id-key
  • otel.instrumentation.common.logging.span-id → span-id-key
  • otel.instrumentation.common.logging.trace-flags → 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 #18470
/breaking-change

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
Copilot AI review requested due to automatic review settings May 15, 2026 17:01
@adithyag17 adithyag17 requested a review from a team as a code owner May 15, 2026 17:01
@linux-foundation-easycla

linux-foundation-easycla Bot commented May 15, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: adithyag17 / name: Adithya Ganesh (3ed8ade)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-flags to ...trace-id-key|span-id-key|trace-flags-key across 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.

adithyag17 and others added 2 commits May 15, 2026 22:37
- 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
@laurit

laurit commented May 20, 2026

Copy link
Copy Markdown
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

@trask

trask commented Jun 6, 2026

Copy link
Copy Markdown
Member

Closing in favor of #18851

@trask trask closed this Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename common logging properties to make it clear they configure key names

4 participants