Class PropagationAPI

Singleton object which represents the entry point to the OpenTelemetry Propagation API

Hierarchy

  • PropagationAPI

Constructors

  • Empty private constructor prevents end users from constructing a new instance of the API

    Returns PropagationAPI

Properties

_getGlobalPropagator: any
createBaggage: ((entries?) => Baggage)

Type declaration

    • (entries?): Baggage
    • Create a new Baggage with optional entries

      Parameters

      • Optional entries: Record<string, BaggageEntry>

        An array of baggage entries the new baggage should contain

        Optional

      Returns Baggage

deleteBaggage: ((context) => Context)

Type declaration

    • (context): Context
    • Delete the baggage stored in the given context

      Parameters

      Returns Context

getActiveBaggage: (() => Baggage | undefined)

Type declaration

    • (): Baggage | undefined
    • Retrieve the current baggage from the active/current context

      Returns Baggage | undefined

      Extracted baggage from the context

getBaggage: ((context) => Baggage | undefined)

Type declaration

    • (context): Baggage | undefined
    • Retrieve the current baggage from the given context

      Parameters

      Returns Baggage | undefined

      Extracted baggage from the context

setBaggage: ((context, baggage) => Context)

Type declaration

    • (context, baggage): Context
    • Store a baggage in the given context

      Parameters

      • context: Context
      • baggage: Baggage

        that will be set in the actual context

      Returns Context

_instance?: any

Methods

  • Remove the global propagator

    Returns void

  • Extract context from a carrier

    Type Parameters

    • Carrier

    Parameters

    • context: Context

      Context which the newly created context will inherit from

    • carrier: Carrier

      Carrier to extract context from

    • Optional getter: TextMapGetter<Carrier>

      Function used to extract keys from a carrier

      Optional

    Returns Context

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

    Returns string[]

  • Inject context into a carrier to be propagated inter-process

    Type Parameters

    • Carrier

    Parameters

    • context: Context

      Context carrying tracing data to inject

    • carrier: Carrier

      carrier to inject context into

    • Optional setter: TextMapSetter<Carrier>

      Function used to set values on the carrier

      Optional

    Returns void

  • Set the current propagator.

    Parameters

    Returns boolean

    true if the propagator was successfully registered, else false

  • Get the singleton instance of the Propagator API

    Returns PropagationAPI

Generated using TypeDoc