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

Hierarchy

  • TraceAPI

Constructors

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

    Returns TraceAPI

Properties

_proxyTracerProvider: any
deleteSpan: ((context) => Context)

Type declaration

    • (context): Context
    • Remove current span stored in the context

      Parameters

      • context: Context

        context to delete span from

      Returns Context

getActiveSpan: (() => Span | undefined)

Type declaration

    • (): Span | undefined
    • Gets the span from the current context, if one exists.

      Returns Span | undefined

getSpan: ((context) => Span | undefined)

Type declaration

    • (context): Span | undefined
    • Return the span if one exists

      Parameters

      • context: Context

        context to get span from

      Returns Span | undefined

getSpanContext: ((context) => SpanContext | undefined)

Type declaration

    • (context): SpanContext | undefined
    • Get the span context of the span if it exists.

      Parameters

      • context: Context

        context to get values from

      Returns SpanContext | undefined

isSpanContextValid: ((spanContext) => boolean)

Type declaration

setSpan: ((context, span) => Context)

Type declaration

    • (context, span): Context
    • Set the span on a context

      Parameters

      • context: Context

        context to use as parent

      • span: Span

        span to set active

      Returns Context

setSpanContext: ((context, spanContext) => Context)

Type declaration

    • (context, spanContext): Context
    • Wrap span context in a NoopSpan and set as span in a new context

      Parameters

      • context: Context

        context to set active span on

      • spanContext: SpanContext

        span context to be wrapped

      Returns Context

wrapSpanContext: ((spanContext) => Span)

Type declaration

    • (spanContext): Span
    • Wrap the given SpanContext in a new non-recording Span

      Parameters

      Returns Span

      a new non-recording Span with the provided context

_instance?: any

Methods

  • Remove the global tracer provider

    Returns void

  • Returns a tracer from the global tracer provider.

    Parameters

    • name: string
    • Optional version: string
      Optional

    Returns Tracer

  • Returns the global tracer provider.

    Returns TracerProvider

  • Set the current global tracer.

    Parameters

    Returns boolean

    true if the tracer provider was successfully registered, else false

  • Get the singleton instance of the Trace API

    Returns TraceAPI

Generated using TypeDoc