What is Tracing?
Tracing captures the execution path of your application by recording spans - individual units of work that represent operations like LLM calls, retrieval steps, or tool executions. These spans are organized into traces that show the complete request flow.OpenTelemetry and OpenInference
Phoenix builds on two key standards:- OpenTelemetry: Industry-standard observability framework for traces, metrics, and logs
- OpenInference: Semantic conventions specifically designed for LLM applications, defining standard attributes for prompts, completions, embeddings, and retrieval
Trace Hierarchy
Traces in Phoenix follow a hierarchical structure:- Trace ID: Unique identifier for the entire request
- Span ID: Unique identifier for each operation
- Parent Span ID: Links spans in a hierarchy
- Timestamps: Start and end times for duration tracking
Span Structure
Every span captures:Basic Information
- Name (e.g., “ChatCompletion”, “Retrieval”)
- Start and end timestamps
- Status (OK, ERROR, UNSET)
Span Kinds
OpenInference defines semantic span kinds for LLM operations:| Span Kind | Description | Example |
|---|---|---|
CHAIN | Orchestration logic | LangChain chains, agent workflows |
LLM | Language model calls | OpenAI, Anthropic completions |
RETRIEVER | Vector/document retrieval | Vector database queries |
EMBEDDING | Text embedding generation | Embedding API calls |
RERANKER | Document reranking | Cohere rerank |
TOOL | External tool execution | Function calls, API requests |
AGENT | Autonomous agent operations | ReAct, AutoGPT agents |
Key Span Attributes
Common attributes captured in spans:The Phoenix UI
The Phoenix UI provides powerful trace visualization:Trace Timeline
View the complete execution timeline with:- Span hierarchy and nesting
- Duration waterfall chart
- Token usage per span
- Error highlighting
Span Details
Inspect individual spans:- Full input/output values
- Model parameters and metadata
- Token counts and costs
- Exception stack traces
Trace Search and Filtering
Find specific traces using:- Full-text search on inputs/outputs
- Attribute-based filtering
- Time range selection
- Status code filtering (errors only)
OTLP Protocol
Phoenix receives traces using the OTLP (OpenTelemetry Protocol) over HTTP or gRPC:- HTTP
- gRPC
Trace Data Model
Phoenix internally represents traces using the following structure:Next Steps
Instrumentation
Learn how to instrument your LLM applications
Projects
Organize traces with projects
Sessions
Group related traces into sessions
Annotations
Add feedback and evaluations to traces