phoenix.otel is a lightweight wrapper around OpenTelemetry primitives with Phoenix-aware defaults.
-
PHOENIX_COLLECTOR_ENDPOINT -
PHOENIX_PROJECT_NAME -
PHOENIX_CLIENT_HEADERS -
PHOENIX_API_KEY -
PHOENIX_GRPC_PORT
Quickstart: phoenix.otel.register
The phoenix.otel module provides a high-level register function to configure OpenTelemetry tracing by setting a global TracerProvider. The register function can also configure headers and whether or not to process spans one by one or by batch.
Phoenix Authentication
If thePHOENIX_API_KEY environment variable is set, register will automatically add an authorization header to each span payload.
Configuring the collector endpoint
There are two ways to configure the collector endpoint:- Using environment variables
-
Using the
endpointkeyword argument
Using environment variables
If you’re setting thePHOENIX_COLLECTOR_ENDPOINT environment variable, register will automatically try to send spans to your Phoenix server using gRPC.
- GRPC
- HTTP
Specifying the endpoint directly
When passing in the endpoint argument, you must specify the fully qualified endpoint. If the PHOENIX_GRPC_PORT environment variable is set, it will override the default gRPC port.
- HTTP
- GRPC
- Custom GRPC Port
The HTTP transport protocol is inferred from the endpoint
Additional configuration
register can be configured with different keyword arguments:
-
project_name: The Phoenix project name- or use
PHOENIX_PROJECT_NAMEenv. var
- or use
-
headers: Headers to send along with each span payload- or use
PHOENIX_CLIENT_HEADERSenv. var
- or use
-
batch: Whether or not to process spans in batch
Instrumentation
Once you’ve connected your application to your Phoenix instance usingphoenix.otel.register, you need to instrument your application. You have a few options to do this:
-
Using OpenInference auto-instrumentors. If you’ve used the
auto_instrumentflag above, then any instrumentor packages in your environment will be called automatically. For a full list of OpenInference packages, see /phoenix/integrations - Using Phoenix Decorators.
- Using Base OTEL.

