Skip to content
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:

  1. Span hierarchy — agent run = root span; each LLM call + tool call = child span
  2. Per-span data — input, output, model, tokens, latency, cost, error
  3. OpenTelemetry standard — vendor-agnostic
  4. 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.

Resources(3)

Trace Logging & Debugging · AI Agent Engineer Roadmap | SYK