tracing icon indicating copy to clipboard operation
tracing copied to clipboard

Baggage support in Observation

Open ttddyy opened this issue 1 year ago • 1 comments

Currently, there is no direct association between Observation and Baggage. If I want to use baggage, I need to interact with Tracer API. Then, the code needs to mix observation and tracing, which I feel reduces the value of the observation abstraction.

How about tracing-observation-handler to have a list of observation tags that will be converted to baggage?

For example,

Set<String> baggageTags = Set.of("foo.id");
DefaultTracingObservationHandler handler = new DefaultTracingObservationHandler(tracer, baggageTags);
...

When Observation has foo.id tag, it will be treated as baggage.

It would be nice to integrate Observation and Baggage to eliminate the Tracer API usage in user code for baggage.

ttddyy avatar Jan 30 '24 20:01 ttddyy

I've asked about this topic (Observation's support for Baggage) in https://github.com/micrometer-metrics/tracing/issues/455, so I wonder I this new issue would render my question answered. Wdyt?

ilya40umov avatar Feb 15 '24 17:02 ilya40umov

duplicate of https://github.com/micrometer-metrics/tracing/issues/455

BTW I really like what @ttddyy suggested. That the fact that a key-value is baggage would become an implementation detail of tracing.

marcingrzejszczak avatar May 06 '24 09:05 marcingrzejszczak