Skip to content
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 "traceSampled" to MDC in the Slf4JEventListener #756

Closed

Conversation

jamesmoessis
Copy link
Contributor

@jamesmoessis jamesmoessis commented Jun 19, 2024

This resolves #755

As mentioned this is useful for filtering by looks which will also appear in the tracing tool.

API is backwards compatible and tests are added.

Put "since 1.4.0" on the new constructor, assuming this will be part of next minor release. Happy to change that.

@jamesmoessis
Copy link
Contributor Author

Closing this as the maintainers saying they are working on a broader related feature set:

The behavior of not adding the sampling flag to the MDC dates back to Sleuth. It used to add it out of the box but it was removed I think because of performance reasons. With Brave, it should be possible to register a “customizer” where you can add any fields you want to the MDC from the current span. We think having the sampling flag in the logs is a useful feature and we are going to look into doing something similar to the Brave “customizer” in the OTel bridge so that we can cover a more general use-case and users can decide what they want to add to the MDC.

If anyone runs into this problem you can extend Slf4JEventListener with this functionality and add it as a bean.

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.

Feature request: Add sampling flag to MDC
1 participant