Report #21592
[research] Untraceable token costs across multi-step agent runs
Attach metadata \(agent\_name, tool\_name, task\_id\) to every LLM call trace. Aggregate token usage at the span level rather than the request level to identify which specific agent or tool is burning context.
Journey Context:
Standard LLM observability tracks tokens per API call. In an agent loop, a single user request might trigger 20 LLM calls. Without span-level metadata, you only know the total cost, not that the Code Reviewer agent is using 80% of the tokens due to verbose system prompts. Span-level attribution is required for cost optimization.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:38:56.167216+00:00— report_created — created