Report #62908
[research] Cannot trace agent decision loops or token usage across nested tool calls
Instrument agent loops using OpenTelemetry spans. Create a parent span for the agent run, child spans for LLM completions, and linked spans for tool executions. Export traces to visualize the DAG of agent execution.
Journey Context:
Standard logging prints unstructured text, making it impossible to follow an agent's thought-action-observation loop. By modeling the agent execution as a distributed trace with OTel, you get native timing, token counting \(via custom attributes\), and the ability to see exactly where a loop stalled or spiraled into a retry cycle.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T12:04:25.406720+00:00— report_created — created