Options
All
  • Public
  • Public/Protected
  • All
Menu

OpenTelemetry API for JavaScript

Index

Type aliases

GetterFunction

GetterFunction<Carrier>: function

Type parameters

  • Carrier

Type declaration

    • (carrier: Carrier, key: string): unknown
    • Parameters

      • carrier: Carrier
      • key: string

      Returns unknown

HrTime

HrTime: [number, number]

High resolution HrTime: [seconds: number, nanoseconds: number]

Labels

Labels: object

key-value pairs passed by the user.

Type declaration

  • [key: string]: string

LinkContext

LinkContext: Pick<SpanContext, "traceId" | "spanId">

A pointer to another span.

LogFunction

LogFunction: function

Type declaration

    • (message: string, ...args: unknown[]): void
    • Parameters

      • message: string
      • Rest ...args: unknown[]

      Returns void

SetterFunction

SetterFunction<Carrier>: function

Type parameters

  • Carrier

Type declaration

    • (carrier: Carrier, key: string, value: unknown): void
    • Parameters

      • carrier: Carrier
      • key: string
      • value: unknown

      Returns void

TimeInput

TimeInput: HrTime | number | Date

Defines TimeInput.

hrtime, epoch milliseconds, performance.now() or Date

Variables

Const INVALID_SPAN_ID

INVALID_SPAN_ID: "0" = "0"

Const INVALID_TRACE_ID

INVALID_TRACE_ID: "0" = "0"

Const NOOP_BOUND_COUNTER

NOOP_BOUND_COUNTER: NoopBoundCounter = new NoopBoundCounter()

Const NOOP_BOUND_MEASURE

NOOP_BOUND_MEASURE: NoopBoundMeasure = new NoopBoundMeasure()

Const NOOP_BOUND_OBSERVER

NOOP_BOUND_OBSERVER: NoopBoundObserver = new NoopBoundObserver()

Const NOOP_COUNTER_METRIC

NOOP_COUNTER_METRIC: NoopCounterMetric = new NoopCounterMetric(NOOP_BOUND_COUNTER)

Const NOOP_HTTP_TEXT_PROPAGATOR

NOOP_HTTP_TEXT_PROPAGATOR: NoopHttpTextPropagator = new NoopHttpTextPropagator()

Const NOOP_MEASURE_METRIC

NOOP_MEASURE_METRIC: NoopMeasureMetric = new NoopMeasureMetric(NOOP_BOUND_MEASURE)

Const NOOP_METER

NOOP_METER: NoopMeter = new NoopMeter()

Const NOOP_METER_PROVIDER

NOOP_METER_PROVIDER: NoopMeterProvider = new NoopMeterProvider()

Const NOOP_OBSERVER_METRIC

NOOP_OBSERVER_METRIC: NoopObserverMetric = new NoopObserverMetric(NOOP_BOUND_OBSERVER)

Const NOOP_SPAN

NOOP_SPAN: NoopSpan = new NoopSpan()

Const NOOP_TRACER

NOOP_TRACER: NoopTracer = new NoopTracer()

Const NOOP_TRACER_PROVIDER

NOOP_TRACER_PROVIDER: NoopTracerProvider = new NoopTracerProvider()

Const context

context: ContextAPI = ContextAPI.getInstance()

Entrypoint for context API

Const contextApi

contextApi: ContextAPI = ContextAPI.getInstance()

Const metrics

metrics: MetricsAPI = MetricsAPI.getInstance()

Entrypoint for metrics API

Const propagation

propagation: PropagationAPI = PropagationAPI.getInstance()

Entrypoint for propagation API

Const trace

trace: TraceAPI = TraceAPI.getInstance()

Entrypoint for trace API

Functions

defaultGetter

  • defaultGetter(carrier: any, key: string): unknown
  • Default getter which just does a simple property access. Returns undefined if the key is not set.

    Parameters

    • carrier: any
    • key: string

    Returns unknown

defaultSetter

  • defaultSetter(carrier: any, key: string, value: unknown): void

Object literals

Const INVALID_SPAN_CONTEXT

INVALID_SPAN_CONTEXT: object

spanId

spanId: string = INVALID_SPAN_ID

traceFlags

traceFlags: TraceFlags = TraceFlags.NONE

traceId

traceId: string = INVALID_TRACE_ID