Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Scope

The Datadog Scope Manager. This is used for context propagation.

Hierarchy

  • Scope

Index

Methods

Methods

activate

  • activate<T>(span: Span, fn: function): T
  • Activate a span in the scope of a function.

    Type parameters

    • T

    Parameters

    • span: Span

      The span to activate.

    • fn: function

      Function that will have the span activated on its scope.

        • (...args: any[]): T
        • Parameters

          • Rest ...args: any[]

          Returns T

    Returns T

    The return value of the provided function.

active

  • active(): Span | null
  • Get the current active span or null if there is none.

    Returns Span | null

    The active span.

bind

  • bind<T>(fn: T, span?: Span | null): T
  • bind<V, T>(fn: T, span?: Span | null): T
  • bind<T>(fn: Promise<T>, span?: Span | null): Promise<T>
  • bind(emitter: EventEmitter, span?: Span | null): EventEmitter
  • Binds a target to the provided span, or the active span if omitted.

    Type parameters

    • T: function

    Parameters

    • fn: T
    • Optional span: Span | null

    Returns T

    The bound target.

  • Type parameters

    • V

    • T: function

    Parameters

    • fn: T
    • Optional span: Span | null

    Returns T

  • Type parameters

    • T

    Parameters

    • fn: Promise<T>
    • Optional span: Span | null

    Returns Promise<T>

  • Parameters

    • emitter: EventEmitter
    • Optional span: Span | null

    Returns EventEmitter

Generated using TypeDoc