How Phoenix Uses OpenTelemetry
Phoenix leverages OpenTelemetry in several key ways:- OTLP Protocol: Phoenix receives traces via the OpenTelemetry Protocol (OTLP)
- OpenInference Conventions: Traces follow semantic conventions optimized for LLM observability
- Auto-instrumentation: Framework integrations use OpenTelemetry instrumentors
- Custom spans: You can create custom spans using OpenTelemetry APIs
OTLP Endpoints
Phoenix exposes OTLP endpoints for receiving trace data:| Protocol | Endpoint | Default Port |
|---|---|---|
| HTTP | http://localhost:6006/v1/traces | 6006 |
| gRPC | grpc://localhost:4317 | 4317 |
Configuration
You can configure the OTLP exporter when registering Phoenix:Environment Variables
You can also configure OTLP using standard OpenTelemetry environment variables:Custom Instrumentation
While Phoenix provides auto-instrumentation for popular frameworks, you can create custom spans for any code using OpenTelemetry.Basic Custom Spans
OpenInference Span Kinds
For LLM applications, use OpenInference semantic conventions to get rich UI visualization:Available Span Kinds
| Span Kind | Description | Use Case |
|---|---|---|
LLM | Language model inference | GPT calls, Claude calls |
CHAIN | Sequence of operations | LangChain chains, pipelines |
AGENT | Autonomous reasoning | ReAct agents, function calling |
TOOL | External function call | API calls, calculations |
RETRIEVER | Document retrieval | Vector search, database query |
EMBEDDING | Embedding generation | Text embeddings |
RERANKER | Document reranking | Cross-encoder reranking |
GUARDRAIL | Safety checks | Content filtering |
EVALUATOR | Quality assessment | LLM-as-a-judge |
Using Helper Functions
Phoenix provides helper decorators and context managers:Headers and Authentication
For cloud deployments or secured Phoenix instances, add authentication headers:Batching and Performance
Phoenix uses OpenTelemetry’s batching for efficient trace export:Resources
OpenInference Spec
Semantic conventions for LLM traces
OpenTelemetry Docs
Official OpenTelemetry documentation
Manual Instrumentation Guide
Detailed instrumentation guide
Phoenix OTEL Package
Python package documentation