RegisterParams: {
    apiKey?: string;
    batch?: boolean;
    diagLogLevel?: DiagLogLevel;
    global?: boolean;
    headers?: Headers;
    instrumentations?: Instrumentation[];
    projectName?: string;
    spanProcessors?: SpanProcessor[];
    url?: string;
}

Configuration parameters for registering Phoenix OpenTelemetry tracing.

This interface defines all the available options for configuring the Phoenix OpenTelemetry integration, including connection details, processing options, and instrumentation settings.

Type declaration

  • OptionalapiKey?: string

    The API key for authenticating with the Phoenix instance. If not provided, the system will check the PHOENIX_API_KEY environment variable.

    The API key will be automatically added to the Authorization header as a Bearer token.

    "phx_1234567890abcdef"
    
  • Optionalbatch?: boolean

    Whether to use batching for span processing.

    • true (default): Uses OpenInferenceBatchSpanProcessor for better performance in production
    • false: Uses OpenInferenceSimpleSpanProcessor for immediate span export (useful for debugging)

    Batching is recommended for production environments as it reduces network overhead and improves performance by sending multiple spans in a single request.

    true
    
  • OptionaldiagLogLevel?: DiagLogLevel

    The diagnostic log level for the built-in DiagConsoleLogger.

    This controls the verbosity of OpenTelemetry's internal logging. Omit this parameter to disable built-in logging entirely.

    DiagLogLevel.INFO
    
    DiagLogLevel.DEBUG
    
    DiagLogLevel.ERROR
    
  • Optionalglobal?: boolean

    Whether to register the tracer provider as the global provider.

    When true (default), the provider will be registered globally and can be accessed throughout the application. Set to false if you want to manage the provider lifecycle manually or use multiple providers.

    true
    
  • Optionalheaders?: Headers

    Additional headers to be included when communicating with the OTLP collector. These headers will be merged with any automatically generated headers (like Authorization).

    { "x-custom-header": "value", "x-api-version": "1.0" }
    
  • Optionalinstrumentations?: Instrumentation[]

    A list of OpenTelemetry instrumentations to automatically register.

    Note: This feature may only work with CommonJS projects. ESM projects may require manual instrumentation registration.

    import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
    import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';

    const instrumentations = [
    new HttpInstrumentation(),
    new ExpressInstrumentation()
    ];
  • OptionalprojectName?: string

    The project name that spans will be associated with in Phoenix. This helps organize and filter traces in the Phoenix UI.

    "default"
    
    "my-web-app"
    
    "api-service"
    
  • OptionalspanProcessors?: SpanProcessor[]

    Custom span processors to add to the tracer provider.

    Important: When provided, this will override the default span processor created from the url, apiKey, headers, and batch parameters.

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

    const customProcessors = [
    new BatchSpanProcessor(exporter),
    new MyCustomSpanProcessor()
    ];
  • Optionalurl?: string

    The URL to the Phoenix server. Can be postfixed with the tracing path. If not provided, the system will check the PHOENIX_COLLECTOR_URL environment variable.

    The URL will be automatically normalized to include the /v1/traces endpoint if not present.

    "https://app.phoenix.arize.com"
    
    "https://app.phoenix.arize.com/v1/traces"
    
    "http://localhost:6006"
    
const config: RegisterParams = {
projectName: "my-application",
url: "https://app.phoenix.arize.com",
apiKey: "your-api-key",
batch: true,
global: true
};