Class CompositeTextMapPropagator
- Namespace
- OpenTelemetry.Context.Propagation
- Assembly
- OpenTelemetry.Api.dll
CompositeTextMapPropagator provides a mechanism for combining multiple textmap propagators into a single one.
public class CompositeTextMapPropagator : TextMapPropagator
- Inheritance
-
CompositeTextMapPropagator
- Inherited Members
Constructors
CompositeTextMapPropagator(IEnumerable<TextMapPropagator>)
Initializes a new instance of the CompositeTextMapPropagator class.
public CompositeTextMapPropagator(IEnumerable<TextMapPropagator> propagators)
Parameters
propagators
IEnumerable<TextMapPropagator>List of TextMapPropagator wire context propagator.
Properties
Fields
Gets the list of headers used by propagator. The use cases of this are:
- allow pre-allocation of fields, especially in systems like gRPC Metadata
- allow a single-pass over an iterator (ex OpenTracing has no getter in TextMap).
public override ISet<string> Fields { get; }
Property Value
Methods
Extract<T>(PropagationContext, T, Func<T, string, IEnumerable<string>>)
Extracts the context from a carrier.
public override PropagationContext Extract<T>(PropagationContext context, T carrier, Func<T, string, IEnumerable<string>> getter)
Parameters
context
PropagationContextThe default context to be used if Extract fails.
carrier
TObject to extract context from. Instance of this object will be passed to the getter.
getter
Func<T, string, IEnumerable<string>>Function that will return string value of a key with the specified name.
Returns
- PropagationContext
Context from it's text representation.
Type Parameters
T
Type of object to extract context from. Typically HttpRequest or similar.
Inject<T>(PropagationContext, T, Action<T, string, string>)
Injects the context into a carrier.
public override void Inject<T>(PropagationContext context, T carrier, Action<T, string, string> setter)
Parameters
context
PropagationContextThe default context to transmit over the wire.
carrier
TObject to set context on. Instance of this object will be passed to setter.
setter
Action<T, string, string>Action that will set name and value pair on the object.
Type Parameters
T
Type of an object to set context on. Typically HttpRequest or similar.