-
Notifications
You must be signed in to change notification settings - Fork 859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Baggage to logback MDC controlled by flag #7892
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, this is a great addition!
...io/opentelemetry/javaagent/instrumentation/logback/mdc/v1_0/LoggingEventInstrumentation.java
Outdated
Show resolved
Hide resolved
...io/opentelemetry/javaagent/instrumentation/logback/mdc/v1_0/LoggingEventInstrumentation.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @adamleantech !
...main/java/io/opentelemetry/javaagent/instrumentation/logback/mdc/v1_0/LogbackSingletons.java
Outdated
Show resolved
Hide resolved
...y/src/main/java/io/opentelemetry/instrumentation/logback/mdc/v1_0/OpenTelemetryAppender.java
Outdated
Show resolved
Hide resolved
...y/src/main/java/io/opentelemetry/instrumentation/logback/mdc/v1_0/OpenTelemetryAppender.java
Show resolved
Hide resolved
…a/io/opentelemetry/javaagent/instrumentation/logback/mdc/v1_0/LogbackSingletons.java Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
…trumentation into main
...y/src/main/java/io/opentelemetry/instrumentation/logback/mdc/v1_0/OpenTelemetryAppender.java
Show resolved
Hide resolved
...y/src/main/java/io/opentelemetry/instrumentation/logback/mdc/v1_0/OpenTelemetryAppender.java
Outdated
Show resolved
Hide resolved
I'm not sure what is causing the build to fail here and I don't believe I have permissions to retrigger - would appreciate some help getting this clean and merged. @trask @mateuszrzeszutek @laurit |
@adamleantech lately we migrated to gradle 8. Unfortunately the Lines 52 to 56 in 583e2a7
|
(Closing and reopening to trigger checks) |
I believe the build should be clean now, not sure how to retrigger here, though @trask @laurit @mateuszrzeszutek |
closing and reopening to trigger checks |
@adamleantech to retrigger checks you can either close and reopen the pull request or push an empty commit |
@laurit you can see above the I pushed a commit and closed then opened the PR and neither of these triggered a build :-( |
thx @adamleantech! |
hooray! |
@trask @adamleantech is there something similar with the Spring Boot Starter? I need all Baggage in the MDC as with the Spring Boot Starter Edit: Aah.. I think this will solve it: #12515 |
you can use snapshot builds: https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/CONTRIBUTING.md#snapshot-builds |
The intention here is to allow users of the java agent to set a VM flag in order to be able to add values in the current Baggage context to MDC for logback. It seemed unwise to turn this on by default - if the application is configured to print all MDC contents (as it often the case with JSON output) then baggage would be logged out by default which may either bloat the logs or result in sensitive data being exposed unitentionally.
Addresses #1391 and #6708
Note that this is my first contribution to this repo, I've done my best to follow the existing approaches to things like testing but would appreciate any feedback.