Skip to content

Conversation

@cfredri4
Copy link

@cfredri4 cfredri4 commented Oct 8, 2025

Closes #14925

This change adds a setting to the Logback appender to exclude MDC attributes when all attributes are being copied.
@cfredri4 cfredri4 requested a review from a team as a code owner October 8, 2025 20:13
@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

@trask
Copy link
Member

trask commented Oct 8, 2025

my initial thought is that this should be the default behavior (for both javaagent and library instrumentation), and you should have to opt in somehow if you want the duplication (e.g. #14897 / #14904)

@cfredri4
Copy link
Author

cfredri4 commented Oct 8, 2025

@trask additional context: I use Micrometer for tracing which adds the MDC values traceId, spanId (i.e. different from trace_id and span_id exported by the appender).

@laurit
Copy link
Contributor

laurit commented Oct 13, 2025

@cfredri4 if your intention is to get this merged then you firstly need to fix the compilation errors in your PR. Secondly you'll have to add tests. Ideally this functionality should be present for both the library and javaagent instrumentation in all relevant logging instrumentations.

@laurit laurit added the needs author feedback Waiting for additional feedback from the author label Oct 13, 2025
@github-actions
Copy link
Contributor

This PR has been labeled as stale due to lack of activity and needing author feedback. It will be automatically closed if there is no further activity over the next 7 days.

@github-actions github-actions bot added the stale label Oct 20, 2025
@cfredri4
Copy link
Author

@laurit I'll take a look at the other logging instrumentations, and tests.

Ideally this functionality should be present for both the library and javaagent instrumentation

Can you elaborate on what this means specifically?

@github-actions github-actions bot removed stale needs author feedback Waiting for additional feedback from the author labels Oct 26, 2025
@laurit
Copy link
Contributor

laurit commented Oct 26, 2025

Can you elaborate on what this means specifically?

Besides logback library instrumentation (by library instrumentation we mean standalone instrumetnation that can be used without the agent) capturing mdc attributes is also implemented in the logback javaagent instrumentation (uses the library instrumentation, but is configured differently), log4j 1&2 and jboss logmanager. Search for capture-mdc-attribute. Ideally there should be feature parity between these instrumentations.

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.

Allow excluding Logback MDC attributes from being copied

3 participants