Configuration parameters for Phoenix tracing
The configured tracer provider instance that can be used to create traces
Basic usage with minimal configuration:
import { register } from '@arizeai/phoenix-otel';
// Uses environment variables for URL and API key
const provider = register({
projectName: 'my-application'
});
Full configuration with custom settings:
import { DiagLogLevel, register } from '@arizeai/phoenix-otel';
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';
const provider = register({
projectName: 'my-web-app',
url: 'https://app.phoenix.arize.com',
apiKey: 'phx_1234567890abcdef',
batch: true,
global: true,
instrumentations: [
new HttpInstrumentation(),
new ExpressInstrumentation()
],
diagLogLevel: DiagLogLevel.INFO
});
Custom span processors:
import {
BatchSpanProcessor,
OTLPTraceExporter,
register,
} from '@arizeai/phoenix-otel';
const exporter = new OTLPTraceExporter({
url: 'https://phoenix.example.com/v1/traces',
headers: { 'Authorization': 'Bearer your-api-key' }
});
const provider = register({
projectName: 'my-app',
spanProcessors: [new BatchSpanProcessor({ exporter })],
global: false // Manual provider management
});
Registers Phoenix OpenTelemetry tracing with the specified configuration.
This function sets up a complete OpenTelemetry tracing pipeline configured to send traces to a Phoenix instance. It creates an OpenTelemetry tracer provider with appropriate span processors, resource attributes, and optional instrumentations.
The function handles: