Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PropagationAPI

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

Hierarchy

  • PropagationAPI

Index

Constructors

Private constructor

Properties

Private _propagator

_propagator: HttpTextPropagator = NOOP_HTTP_TEXT_PROPAGATOR

Static Private Optional _instance

_instance: PropagationAPI

Methods

extract

  • extract<Carrier>(carrier: Carrier, getter?: GetterFunction<Carrier>, context?: Context): Context
  • Extract context from a carrier

    Type parameters

    • Carrier

    Parameters

    • carrier: Carrier

      Carrier to extract context from

    • Default value getter: GetterFunction<Carrier> = defaultGetter

      Function used to extract keys from a carrier

    • Default value context: Context = contextApi.active()

      Context which the newly created context will inherit from. Defaults to the currently active context.

    Returns Context

inject

  • inject<Carrier>(carrier: Carrier, setter?: SetterFunction<Carrier>, context?: Context): void
  • Inject context into a carrier to be propagated inter-process

    Type parameters

    • Carrier

    Parameters

    • carrier: Carrier

      carrier to inject context into

    • Default value setter: SetterFunction<Carrier> = defaultSetter

      Function used to set values on the carrier

    • Default value context: Context = contextApi.active()

      Context carrying tracing data to inject. Defaults to the currently active context.

    Returns void

setGlobalPropagator

Static getInstance