Setup Tracing: Python
How to configure OpenTelemetry and connect to the Phoenix server
Phoenix uses OTLP (OpenTelemetry Language Protocol) to receive traces from your phoenix instance. To make this process as simple as possible, we've created a python package called arize-phoenix-otel
for python.
Note that you do not need to use arize-phoenix-otel to setup OpenTelemetry. If you wold like to use pure OpenTelemetry, see Using OTEL Python Directly
Install the arize-phoenix-otel python package. This may be already installed.
If you have specified endpoints, headers, and project names as environment variables, setting up OTEL can be as simple as:
And setup is done! You are ready to setup integrations and instrumentation. Read further for more advanced configuration options.
Setup Endpoints, Projects, etc.
Register by default picks up your configuration from environment variables but you can configure it using arguments as well:
When using the endpoint
argument, we must pass in the fully qualified OTel endpoint. Phoenix provides two endpoits:
gRPC: more performant
by default exposed on port 4317:
<PHOENIX_HOST>:4317
HTTP: simpler
by default exposed on port 6006 and /v1/traces:
<PHOENIX_HOST>:6006/v1/traces
phoenix.otel can be further configured for things like batch span processing and specifying resources. For the full details of how to configure phoenix.otel, please consult the package repository (https://github.com/Arize-ai/phoenix/tree/main/packages/phoenix-otel)
Last updated