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?

| Span<any> | Trace

Span<TSpanData>


createTrace(traceOptions): Trace;
Parameter Type

traceOptions

TraceOptions

Trace


forceFlush(): Promise<void>;

Promise<void>


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?): Promise<void>;
Parameter Type

timeout?

number

Promise<void>


startExportLoop(): void;

void