-
Notifications
You must be signed in to change notification settings - Fork 46
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
Propagating values from Observation.Context to Trace's Baggage #455
Comments
The problem currently is that Observation has no notion of baggage. I'm kind of on the fence whether it should be publicly available in Micrometer Observation API. Any opinions @jonatan-ivanov @shakuzen @ttddyy ? I know that @chemicL was thinking that most likely Baggage should become the first class citizen of the Observation API, is it still correct? |
This comment was marked as outdated.
This comment was marked as outdated.
@ilya40umov did you get solution for above issue? |
This is still in progress. The feedback related labels were added by the bot that we are experimenting with |
whenever a key-value matches a preconfigured baggage config and an Observation started a scope then automatically baggages will also be started fixes gh-455
whenever a key-value matches a preconfigured baggage config and an Observation started a scope then automatically baggages will also be started fixes gh-455
When I first read about the new
Observation
API I somehow got an idea that key-value pairs that I would add to the context (e.g. viahighCardinalityKeyValues
/lowCardinalityKeyValues
) would then be automatically set on the baggage fields that I registered (e.g. viamanagement.tracing.baggage.correlation.fields
). This would basically ensure that if I were to register a custom baggage field such asuserId
and report a value for this key in, say, the implementation ofObservationConvention
in use, I would then be able to get this field easily in the MDC context and thus have it attached to all log records printed from within the observation.After multiple attempts to make this work, I've checked the implementation of TracingObservationHandler.java and the only thing that is happening with the context key-value pairs is that they are used to tag the span.
Looking at the old Spring Sleuth docs, I see that there used to be
spring.sleuth.baggage.tag-fields
property that would allow to specify which tag fields should be added to baggage, but this is not available in Micrometer Tracing / current Spring Boot as far as I can tell.Is this something that will be implement by Micrometer / Spring at some point or we should work on some work-arounds on our end?
P.S. Right now we kinda have to work with both Observation API (e.g. to avoid working with Trace/Span directly), and at the same time call
tracer.createBaggageInScope
to make sure custom attributes end up in the logs (via baggage to MDC propagation).The text was updated successfully, but these errors were encountered: