TextMapPropagator[Ctx] handles the process of propagating data across process boundaries by injecting and extracting values in text form into carriers that travel in-band.
Overview
The encoding used for propagation conforms to HTTP Header Field semantics, and values are commonly encoded as request headers for RPC/HTTP requests. Carriers used for propagating data are typically HTTP requests, and the process is often implemented using library-specific request interceptors:- Client side: Values are injected into carriers
- Server side: Values are extracted from carriers
Type Parameters
Ctx- The context type used to extract or inject data
Methods
fields
"traceparent", "tracestate", or "baggage".
extract
inject
Factory Methods
of
TextMapPropagator which delegates injection and extraction to the provided propagators. When multiple propagators are provided, they are combined into a composite propagator that applies all of them in sequence.
Example:
noop
TextMapPropagator. All propagation operations are no-op:
fieldsreturns an empty collectionextractreturns the context unchangedinjectreturns the carrier unchanged
Monoid Instance
TextMapPropagator has a Monoid instance that allows combining multiple propagators using Cats operations:
- Empty element is
noop - Combining with
noopreturns the other propagator unchanged - Multiple propagators are combined into a composite that applies all of them