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 { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-node';

createCloudSpanProcessor: ({ url, headers }) =>
new BatchSpanProcessor(new OTLPTraceExporter({ url, headers }))

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.