mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Add baggage tag fields to spans with OpenTelemetry
With OpenTelemetry, fields listed in management.tracing.baggage.tag-fields only became span tags when the application itself touched the baggage through the Tracer API. Baggage that arrived with a request was propagated correctly, but spans were not tagged with it (see micrometer-metrics/tracing#933). This commit registers Micrometer Tracing's BaggageTaggingSpanProcessor whenever baggage is enabled and at least one tag field is configured, so that spans are tagged with the baggage that is present in their parent context. A custom BaggageTaggingSpanProcessor bean backs off the auto-configured one. The tag-fields property is now also mentioned in the baggage section of the tracing documentation. See gh-51656 Signed-off-by: Oleksandr Shevchenko <oleksandr.shevchenko@datarobot.com>
This commit is contained in:
committed by
Andy Wilkinson
parent
924d10733e
commit
ce75f008b0
+3
@@ -236,6 +236,9 @@ Baggage is propagated wherever Micrometer Observation instruments the transport,
|
||||
If you want to propagate the baggage to the MDC, use the configprop:management.tracing.baggage.correlation.fields[] configuration property.
|
||||
For the example above, setting this property to `baggage1` results in an MDC entry named `baggage1`.
|
||||
|
||||
If you want baggage values to be added as tags on spans, use the configprop:management.tracing.baggage.tag-fields[] configuration property.
|
||||
For the example above, setting this property to `baggage1` results in spans that are tagged with `baggage1=value1`.
|
||||
|
||||
|
||||
|
||||
[[actuator.micrometer-tracing.tests]]
|
||||
|
||||
Reference in New Issue
Block a user