Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @opentelemetry/api

Index

Type Aliases

AttributeValue: string | number | boolean | (null | undefined | string)[] | (null | undefined | number)[] | (null | undefined | boolean)[]

Attribute values may be any non-nullish primitive value except an object.

null or undefined attribute values are invalid and will result in undefined behavior.

since

1.3.0

BaggageEntryMetadata: { toString: any } & { __TYPE__: typeof baggageEntryMetadataSymbol }

Serializable Metadata defined by the W3C baggage specification. It currently has no special meaning defined by the OpenTelemetry or W3C.

since

1.0.0

BatchObservableCallback<AttributesTypes>: ((observableResult: BatchObservableResult<AttributesTypes>) => void | Promise<void>)

Type Parameters

Type declaration

    • The observable callback for a batch of Observable instruments.

      since

      1.3.0

      Parameters

      Returns void | Promise<void>

DiagLogFunction: ((message: string, ...args: unknown[]) => void)

Type declaration

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

      1.0.0

      Parameters

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

      Returns void

Defines Exception.

string or an object with one of (message or name or code) and optional stack

since

1.0.0

HrTime: [number, number]

Defines High-Resolution Time.

The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970. The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds. For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150. The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds: HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210. The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds: HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000. This is represented in HrTime format as [1609504210, 150000000].

since

1.0.0

MetricAttributeValue: AttributeValue
deprecated

please use AttributeValue

since

1.3.0

MetricAttributes: Attributes
deprecated

please use Attributes

since

1.3.0

ObservableCallback<AttributesTypes>: ((observableResult: ObservableResult<AttributesTypes>) => void | Promise<void>)

Type Parameters

Type declaration

    • The observable callback for Observable instruments.

      since

      1.3.0

      Parameters

      Returns void | Promise<void>

ObservableCounter<AttributesTypes>: Observable<AttributesTypes>
since

1.3.0

Type Parameters

ObservableGauge<AttributesTypes>: Observable<AttributesTypes>
since

1.3.0

Type Parameters

ObservableUpDownCounter<AttributesTypes>: Observable<AttributesTypes>
since

1.3.0

Type Parameters

SpanAttributeValue: AttributeValue
deprecated

please use AttributeValue

since

1.0.0

SpanAttributes: Attributes
deprecated

please use Attributes

since

1.0.0

TimeInput: HrTime | number | Date

Defines TimeInput.

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

since

1.0.0

Variables

INVALID_SPANID: "0000000000000000" = '0000000000000000'
since

1.0.0

INVALID_SPAN_CONTEXT: SpanContext = ...
since

1.0.0

INVALID_TRACEID: "00000000000000000000000000000000" = '00000000000000000000000000000000'
since

1.0.0

ROOT_CONTEXT: Context = ...

The root context is used as the default parent context when there is no active context

since

1.0.0

context: ContextAPI = ...

Entrypoint for context API

since

1.0.0

default: { context: ContextAPI; diag: DiagAPI; metrics: MetricsAPI; propagation: PropagationAPI; trace: TraceAPI }

Type declaration

defaultTextMapGetter: TextMapGetter = ...
since

1.0.0

defaultTextMapSetter: TextMapSetter = ...
since

1.0.0

diag: DiagAPI = ...

Entrypoint for Diag API. Defines Diagnostic handler used for internal diagnostic logging operations. The default provides a Noop DiagLogger implementation which may be changed via the diag.setLogger(logger: DiagLogger) function.

since

1.0.0

metrics: MetricsAPI = ...

Entrypoint for metrics API

since

1.3.0

propagation: PropagationAPI = ...

Entrypoint for propagation API

since

1.0.0

trace: TraceAPI = ...

Entrypoint for trace API

since

1.0.0

Functions

  • Create a serializable BaggageEntryMetadata object from a string.

    since

    1.0.0

    Parameters

    • str: string

      string metadata. Format is currently not defined by the spec and has no special meaning.

    Returns BaggageEntryMetadata

  • createContextKey(description: string): symbol
  • createTraceState(rawTraceState?: string): TraceState
  • isValidSpanId(spanId: string): boolean
  • isValidTraceId(traceId: string): boolean

Generated using TypeDoc