Back to full roadmap
topiccore
Trace Logging & Debugging
Log every agent step — model in/out, tool calls, latency, cost. Otherwise debugging is impossible.
2 hours3 resources
Agent debugging is harder than one-shot LLM: 10 steps, 20 tool calls, 5 LLM calls. Trace logging:
- Span hierarchy — agent run = root span; each LLM call + tool call = child span
- Per-span data — input, output, model, tokens, latency, cost, error
- OpenTelemetry standard — vendor-agnostic
- Visualization tools: Langfuse, LangSmith, Helicone, Phoenix (Arize) — interactive trace tree view
Pro tip: save the rationale of each tool call — why did the model pick this tool? Usually emerges from the thinking block.