Implements

  • Tracer

Constructors

Properties

active: boolean = false

Get the active status from tracer instance

activeTraceParams: TraceParams = {}

A configuration object for trace parameters

eventListeners: SpanEventListener[] = []

Get the eventListeners from tracer instance

logger: Logger = diag

A configuration for starting the tracer

propagation: Propagation = shimPropagation

A propagation instance

sampler: Sampler = ...

Noop implementations

Accessors

  • get currentRootSpan(): Span

    Gets the current root span.

    Returns Span

Methods

  • Clear the currentRootSpan from tracer instance

    Returns void

  • Happens when a span is ended

    Returns void

  • Happens when a span is started

    Returns void

  • Register a OnEndSpanEventListener on the tracer instance

    Returns void

  • Sets the current root span.

    Returns void

  • Start a tracer instance

    Parameters

    • config: TracerConfig

      Configuration for tracer instace

    Returns this

    A tracer instance started

  • Start a new Span instance to the currentRootSpan

    Parameters

    • Optionaloptions: SpanOptions

      A TraceOptions object to start a root span.

    Returns Span

    The new Span instance started

  • Starts a root span.

    Type Parameters

    • T

    Parameters

    • options: TraceOptions

      A TraceOptions object to start a root span.

    • fn: (root: Span) => T

      A callback function to run after starting a root span.

    Returns T

  • Noop implementations

    Returns this

  • Unregisters an end span event listener.

    Returns void

  • Binds the trace context to the given function. This is necessary in order to create child spans correctly in functions that are called asynchronously (for example, in a network response handler).

    Type Parameters

    • T

    Parameters

    • fn: Func<T>

      A function to which to bind the trace context.

    Returns Func<T>

  • Binds the trace context to the given event emitter. This is necessary in order to create child spans correctly in event handlers.

    Parameters

    • emitter: EventEmitter

      An event emitter whose handlers should have the trace context binded to them.

    Returns void