Traces
End-to-end visibility into agent execution.
A trace represents a complete execution from request to response.
Trace Structure
Trace (trace_id: abc123)
├── Root Span (agent: orchestrator)
│ ├── LLM Span (model: gpt-4o, 234ms)
│ ├── Tool Span (tool: search, 1200ms)
│ └── Agent Span (agent: researcher)
│ ├── LLM Span (model: gpt-4o-mini, 156ms)
│ └── Tool Span (tool: fetch, 89ms)
└── Metadata
├── session_id
├── user_id
├── environment
└── tags
Trace Attributes
| Attribute | Type | Description |
|---|---|---|
trace_id | string | Unique 32-char hex identifier |
start_time | timestamp | Trace start time |
end_time | timestamp | Trace end time |
duration_ms | number | Total duration in milliseconds |
status | string | ok or error |
span_count | number | Total spans in trace |
total_tokens | number | Sum of all LLM tokens |
total_cost_usd | number | Sum of all LLM costs |
root_agent | string | Top-level agent name |
error_code | string | Error taxonomy code (if error) |
Viewing Traces
Trace List
The trace list shows all traces with key metrics:
| Column | Description |
|---|---|
| Time | When the trace occurred |
| Trace ID | Click to view details |
| Agent | Root agent name |
| Duration | Total latency |
| Tokens | Total token usage |
| Cost | Total USD cost |
| Status | Success or error badge |
Filtering
Filter traces by:
# Time range
last 1 hour
last 24 hours
custom range
# Status
status:ok
status:error
# Agent
agent:planner
agent:researcher
# Performance
latency:>5000
cost:>0.10
# Content
contains:"specific text"
Trace Detail View
Waterfall
Visual timeline showing:
- Span hierarchy
- Parallel execution
- Timing relationships
- Critical path highlighting
Span List
Table view with:
- Span name and type
- Duration
- Tokens (for LLM spans)
- Status
- Expandable details
Content View
For each LLM span:
- System prompt
- User messages
- Assistant response
- Tool calls and results
Content Privacy
Content capture can be disabled with trace_content=False for sensitive applications.
Trace Comparison
Compare two traces side-by-side:
- Select traces from the list
- Click "Compare"
- View diff of:
- Span structure
- Timing differences
- Content changes
- Cost comparison
Exporting Traces
JSON Export
# Via API
curl -X GET "https://app.risicare.ai/v1/traces/{trace_id}" \
-H "Authorization: Bearer rsk-..."Dashboard Export
- Select traces
- Click "Export"
- Choose format (JSON, CSV)
Trace Sampling
For high-volume applications:
risicare.init(
sample_rate=0.1 # Capture 10% of traces
)Sampling is deterministic by trace_id for consistency.