Configuration parameters for the span processor
The URL to the Phoenix server (will be normalized to include /v1/traces)
The API key for authenticating with the Phoenix instance
Additional headers to include in OTLP requests
Whether to use batching for span processing (recommended for production)
A configured SpanProcessor instance ready for use with a NodeTracerProvider
Basic usage with environment variables:
const processor = getDefaultSpanProcessor({
batch: true
});
Full configuration with custom settings:
const processor = getDefaultSpanProcessor({
url: 'https://app.phoenix.arize.com',
apiKey: 'phx_1234567890abcdef',
headers: { 'x-custom-header': 'value' },
batch: true
});
Creates a default span processor configured for Phoenix OpenTelemetry tracing.
This function creates an appropriate span processor (batch or simple) based on the provided configuration parameters. It handles URL normalization, header configuration, and API key authentication automatically.
The function will:
/v1/tracesendpoint if neededbatchparameter