Injects Context into and extracts it from 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.

The carrier of propagated data on both the client (injector) and server (extractor) side is usually an object such as http headers. Propagation is usually implemented via library-specific request interceptors, where the client-side injects values and the server-side extracts them.

1.0.0

interface TextMapPropagator<Carrier = any> {
    extract(
        context: @opentelemetry/api.Context,
        carrier: Carrier,
        getter: @opentelemetry/api.TextMapGetter<Carrier>,
    ): @opentelemetry/api.Context;
    fields(): string[];
    inject(
        context: @opentelemetry/api.Context,
        carrier: Carrier,
        setter: @opentelemetry/api.TextMapSetter<Carrier>,
    ): void;
}

Type Parameters

  • Carrier = any

Implemented by

Methods

  • Return a list of all fields which may be used by the propagator.

    Returns string[]