Interface Propagator
-
public interface PropagatorInspired by OpenZipkin Brave and OpenTelemetry. Most of the documentation is taken directly from OpenTelemetry. Injects and extracts a value as text into carriers that travel in-band across process boundaries. Encoding is expected to conform to the HTTP Header Field semantics. Values are often encoded as RPC/HTTP request headers.- Since:
- 3.0.0
- Author:
- OpenZipkin Brave Authors, OpenTelemetry Authors, Marcin Grzejszczak
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePropagator.Getter<C>Interface that allows aTextMapPropagatorto read propagated fields from a carrier.static interfacePropagator.Setter<C>Class that allows aTextMapPropagatorto set propagated fields into a carrier.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <C> Span.Builderextract(C carrier, Propagator.Getter<C> getter)Extracts the value from upstream.List<String>fields()<C> voidinject(TraceContext context, C carrier, Propagator.Setter<C> setter)Injects the value downstream, for example as HTTP headers.
-
-
-
Method Detail
-
inject
<C> void inject(TraceContext context, @Nullable C carrier, Propagator.Setter<C> setter)
Injects the value downstream, for example as HTTP headers. The carrier may be null to facilitate calling this method with a lambda for thePropagator.Setter, in which case that null will be passed to thePropagator.Setterimplementation.- Type Parameters:
C- carrier of propagation fields, such as an http request- Parameters:
context- theContextcontaining the value to be injected.carrier- holds propagation fields. For example, an outgoing message or http request.setter- invoked for each propagation key to add or remove.
-
extract
<C> Span.Builder extract(C carrier, Propagator.Getter<C> getter)
Extracts the value from upstream. For example, as http headers.If the value could not be parsed, the underlying implementation will decide to set an object representing either an empty value, an invalid value, or a valid value. Implementation must not set
null.- Type Parameters:
C- carrier of propagation fields, such as an http request.- Parameters:
carrier- holds propagation fields. For example, an outgoing message or http request.getter- invoked for each propagation key to get.- Returns:
- the
Contextcontaining the extracted value.
-
-