Options for configuring a custom tracer provider.

interface SetTracerProviderOptions {
    createCloudSpanProcessor?: ((options) => SpanProcessor);
    metadata?: Attributes;
    registerSpanProcessor?: SpanProcessorRegistrar;
}

Properties

createCloudSpanProcessor?: ((options) => SpanProcessor)

Builds the span processor that exports to LiveKit Cloud, called when cloud tracing starts.

The built-in OpenTelemetry SDK 2.x cloud processor is used by default. Supply this callback only to override how that processor is constructed:

import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-node';

createCloudSpanProcessor: ({ exporter }) => new BatchSpanProcessor(exporter)

Build the processor around the supplied exporter so the recording-disabled upload gate remains active. The returned processor must use OpenTelemetry SDK 2.x.

Type declaration

metadata?: Attributes

Attributes to add to every span created by the provider.

registerSpanProcessor?: SpanProcessorRegistrar

Adds a span processor to the provider.

OpenTelemetry 2.x providers no longer expose addSpanProcessor. Supply this callback when using a provider backed by a mutable or delegating span processor so LiveKit Cloud tracing can share the same provider as another observability backend.