Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • ContextAPI

Index

Methods

  • bind<T>(context: Context, target: T): T
  • Bind a context to a target function or event emitter

    Type Parameters

    • T

    Parameters

    • context: Context

      context to bind to the event emitter or function. Defaults to the currently active context

    • target: T

      function or event emitter to bind

    Returns T

  • disable(): void
  • with<A, F>(context: Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>
  • Execute a function with an active context

    Type Parameters

    • A extends unknown[]

    • F extends ((...args: A) => ReturnType<F>)

    Parameters

    • context: Context

      context to be active during function execution

    • fn: F

      function to execute in a context

    • Optional thisArg: ThisParameterType<F>

      optional receiver to be used for calling fn

    • Rest ...args: A

      optional arguments forwarded to fn

    Returns ReturnType<F>

Generated using TypeDoc