Class TraceContextCarrierTextMapSetter
java.lang.Object
org.apache.juneau.rest.server.tracing.otel.TraceContextCarrierTextMapSetter
- All Implemented Interfaces:
io.opentelemetry.context.propagation.TextMapSetter<TraceContextCarrier>
public final class TraceContextCarrierTextMapSetter
extends Object
implements io.opentelemetry.context.propagation.TextMapSetter<TraceContextCarrier>
TextMapSetter implementation that writes W3C trace-context fields into a neutral
TraceContextCarrier instead of an HTTP response.
The adapter substrate for OtelTracerHook.inject(TraceContextCarrier): the configured
TextMapPropagator renders the caller's currently-active trace context (and baggage, when a
baggage propagator is configured) by calling set(TraceContextCarrier, String, String) once
per key, which this class forwards to TraceContextCarrier.set(String, String). A propagator
with nothing valid to render (no active span context, empty baggage, etc.) simply never calls
set(TraceContextCarrier, String, String), so the carrier is left untouched — the
substrate for TracerHook's documented default no-op inject(...) contract.
- Since:
- 10.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TraceContextCarrierTextMapSetterProcess-wide singleton instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidset(TraceContextCarrier carrier, String key, String value)
-
Field Details
-
INSTANCE
Process-wide singleton instance.
-
-
Method Details
-
set
- Specified by:
setin interfaceio.opentelemetry.context.propagation.TextMapSetter<TraceContextCarrier>
-