Skip to main content
The Phoenix OTEL SDK provides a lightweight wrapper around OpenTelemetry with sensible defaults for Phoenix.
Go users: Phoenix does not ship a branded phoenix-otel SDK wrapper for Go. Configure the standard OpenTelemetry Go SDK directly and point an OTLP/HTTP exporter at Phoenix. End-to-end examples live in the Go integration pages — OpenAI Go SDK, Anthropic SDK Go, and Gemini Go SDK.

Install

Version 0.16.0 or later is required to import OpenInference context managers and semantic conventions directly from phoenix.otel. On earlier versions, import them from openinference.instrumentation and openinference.semconv.trace instead.
Do I need to match the SDK version to my Phoenix server version? No. arize-phoenix-otel (and @arizeai/phoenix-otel) are versioned independently of the Phoenix server. Any recent SDK version works with any Phoenix server version — you don’t need to upgrade the server when you upgrade the SDK, or vice versa. The SDK sends traces over OTLP using OpenInference semantic conventions, both of which are backward compatible, so there is no version pairing to track. See The phoenix.otel helpers for why.

Configure

Set environment variables to connect to your Phoenix instance:
You can find your collector endpoint and API key in the Settings page of your Phoenix instance.

Register

Call register() to initialize tracing. The SDK automatically reads your environment variables. For manual instrumentation, arize-phoenix-otel (>=0.16.0) and @arizeai/phoenix-otel re-export all commonly used OpenInference helpers so a single dependency is sufficient:
  • Python: context managers (using_session, using_user, using_metadata, using_tags, using_attributes, using_prompt_template, suppress_tracing) and semantic conventions (SpanAttributes, OpenInferenceSpanKindValues, OpenInferenceMimeTypeValues).
  • TypeScript: withSpan, traceChain, traceAgent, traceTool, observe, and context setters like setSession and setMetadata.

Instrument

Add instrumentation to capture traces from your LLM calls:
With auto_instrument=True, Phoenix automatically discovers and activates all OpenInference instrumentor packages installed in your Python environment—no additional code required.
Just pip install the instrumentation packages you need and set auto_instrument=True. Phoenix handles the rest.
See Integrations for all available packages, or use Tracing Helpers for manual instrumentation.

Spans may not be exported if still queued in the processor when your process exits. With batch: true, call shutdown() to explicitly flush before exit. Alternatively, use batch: false for immediate export.

Advanced Configuration

For more control over tracing behavior, see the SDK reference documentation:

Python arize-phoenix-otel

Batch processing, custom endpoints, gRPC/HTTP transport, sampling, and OTel primitives

TypeScript @arizeai/phoenix-otel

Diagnostic logging, custom headers, and full API reference

Next Steps

Integrations

Browse auto-instrumentation packages

Tracing Helpers

Manual instrumentation with decorators