What is Distributed Tracing?
Distributed tracing lets you track complex LLM workflows where one request triggers multiple child requests. Visualize the entire execution tree, understand dependencies, and debug multi-step AI operations.When to Use Traces
Agent Workflows
Track agents that make multiple LLM calls to plan, execute, and reflect
RAG Pipelines
Trace embedding generation, retrieval, and final generation steps
Parallel Processing
Monitor concurrent LLM calls and their relationships
Complex Chains
Debug LangChain, LlamaIndex, or custom chains
Traces vs Sessions
How Tracing Works
Helicone supports OpenTelemetry-style tracing with parent-child relationships:Using Node IDs
Create traces by setting parent-child relationships with theHelicone-Node-Id header:
string
Unique identifier for this request node. Format:
parent_id:child_id- For root requests:
{unique-id} - For child requests:
{parent-id}:{child-id}
Basic Trace Example
Agent Trace Example
Track a ReAct-style agent:RAG Pipeline Trace
Trace retrieval-augmented generation:Parallel Request Tracing
Trace concurrent requests:Custom Trace Logging
For non-OpenAI requests or custom tracing:Viewing Traces
Visualize traces in the Helicone dashboard:1
Navigate to Requests
Go to the Requests page and find a traced request
2
View Trace Tree
Click the trace icon to see the full parent-child hierarchy
3
Analyze Each Node
Click any node to see its request details, cost, and latency
4
Identify Bottlenecks
Find slow or expensive operations in the trace tree
Trace Metrics
Helicone calculates metrics across traces:- Total Cost: Sum of all nodes in the trace
- Total Duration: Time from root start to last leaf completion
- Node Count: Number of requests in the trace
- Max Depth: Deepest level in the trace tree
- Success Rate: Percentage of successful nodes
Best Practices
Use Meaningful Node IDs
Use Meaningful Node IDs
Generate unique IDs but keep them traceable:
Add Context with Properties
Add Context with Properties
Use custom properties to annotate trace nodes:
Limit Trace Depth
Limit Trace Depth
Keep traces manageable. Very deep traces (>10 levels) can be hard to visualize and debug.
Combine with Sessions
Combine with Sessions
Use both tracing (for workflow structure) and sessions (for conversation context):
Handle Errors Gracefully
Handle Errors Gracefully
Continue tracing even if some nodes fail. This helps debug failures:
Tracing Integrations
OpenTelemetry
Helicone supports OTEL trace format for compatibility with existing instrumentation
LangChain
Automatic tracing for LangChain chains and agents
LlamaIndex
Trace RAG pipelines and query engines
Custom Frameworks
Use custom trace logging API for any framework
Next Steps
Session Tracking
Learn about grouping related requests
Custom Properties
Add metadata to trace nodes
Request Logging
Understand individual request tracking
User Metrics
Track traces per user