Skip to content

TraceProvider

new TraceProvider(): TraceProvider

TraceProvider

createSpan<TSpanData>(spanOptions, parent?): Span<TSpanData>
Type Parameter

TSpanData extends SpanData

Parameter Type

spanOptions

CreateSpanOptions<TSpanData>

parent?

| Trace | Span<any>

Span<TSpanData>


createTrace(traceOptions): Trace
Parameter Type

traceOptions

TraceOptions

Trace


getCurrentSpan():
| null
| Span<any>

| null | Span<any>


getCurrentTrace(): null | Trace

Get the current trace.

null | Trace

The current trace.


registerProcessor(processor): void

Add a processor to the list of processors. Each processor will receive all traces/spans.

Parameter Type Description

processor

TracingProcessor

The processor to add.

void


setDisabled(disabled): void
Parameter Type

disabled

boolean

void


setProcessors(processors): void

Set the list of processors. This will replace any existing processors.

Parameter Type Description

processors

TracingProcessor[]

The list of processors to set.

void


shutdown(timeout?): void
Parameter Type

timeout?

number

void