Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TextMapPropagator<Carrier>

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.

since

1.0.0

Type Parameters

  • Carrier = any

Hierarchy

  • TextMapPropagator

Index

Methods

  • Given a Context and a carrier, extract context values from a carrier and return a new context, created from the old context, with the extracted values.

    Parameters

    • context: Context

      the Context from which to extract values to transmit over the wire.

    • carrier: Carrier

      the carrier of propagation fields, such as http request headers.

    • getter: TextMapGetter<Carrier>

      an optional TextMapGetter. If undefined, keys will be all own properties, and keys will be accessed by direct object access.

    Returns Context

  • fields(): string[]
  • Injects values from a given Context into a carrier.

    OpenTelemetry defines a common set of format values (TextMapPropagator), and each has an expected carrier type.

    Parameters

    • context: Context

      the Context from which to extract values to transmit over the wire.

    • carrier: Carrier

      the carrier of propagation fields, such as http request headers.

    • setter: TextMapSetter<Carrier>

      an optional TextMapSetter. If undefined, values will be set by direct object assignment.

    Returns void

Generated using TypeDoc