TR

Tracer

Observability OpenAI SDK-inspired

Full observability system that captures execution traces with spans for LLM calls, tool invocations, handoffs, and guardrail checks for debugging and analysis.

Overview

The Tracer Agent implements comprehensive observability inspired by OpenAI's Agents SDK tracing. It captures structured trace data throughout agent execution:

Span Types

Span TypeCapturesKey Attributes
agentAgent lifecycleagent_name, task, duration
llmLLM API callsmodel, tokens_in, tokens_out, latency
toolTool invocationstool_name, arguments, result
handoffAgent transitionssource, target, context_size
guardrailValidation checksguardrail_name, result, violations

Trace Visualization

Trace: tr_abc123 | Duration: 45.2s | Status: Success

├─ [agent] conductor (45.2s)
│  ├─ [llm] claude-sonnet (2.1s) tokens: 1,200/800
│  ├─ [handoff] → architect (0.1s)
│  │
│  ├─ [agent] architect (12.4s)
│  │  ├─ [llm] claude-sonnet (3.2s) tokens: 2,100/1,500
│  │  ├─ [tool] Read (/src/auth.ts) (0.05s)
│  │  ├─ [tool] Write (/TODO/spec.md) (0.08s)
│  │  └─ [guardrail] output_validation ✓
│  │
│  ├─ [handoff] architect → auto-code (0.1s)
│  │
│  └─ [agent] auto-code (30.5s)
│     ├─ [llm] claude-sonnet (8.5s) tokens: 4,200/3,800
│     ├─ [tool] Write (/src/auth/jwt.ts) (0.12s)
│     ├─ [tool] Bash (npm test) (5.2s)
│     ├─ [guardrail] code_safety ✓
│     └─ [guardrail] pii_detection ✓

Commands

/trace list

/trace list

Recent Traces:
ID          | Task                    | Duration | Status  | Spans
------------|-------------------------|----------|---------|------
tr_abc123   | Add authentication      | 45.2s    | Success | 24
tr_def456   | Fix login bug          | 12.8s    | Success | 11
tr_ghi789   | Refactor database      | 128.4s   | Failed  | 47

/trace show

/trace show tr_abc123

[Full trace visualization as shown above]

Summary:
- Total LLM calls: 3
- Total tokens: 7,500 in / 6,100 out
- Tools invoked: 4
- Guardrails passed: 3/3
- Handoffs: 2

/trace export

/trace export tr_abc123 --format opentelemetry

Exported to: ./traces/tr_abc123.otlp.json
Compatible with: Jaeger, Zipkin, Honeycomb

Integration Points

SystemIntegration
All AgentsAutomatic span creation for agent lifecycle
GuardrailsGuardrail check spans with results
HandoffHandoff spans linking agent transitions
Time-TravelTraces provide replay source data
MemoryStores trace summaries for analysis

Use Cases