Cloudflare's new agent tracing feature for Workers provides crucial visibility into AI/ML agent behavior, addressing the limitations of traditional infrastructure-level observability. It introduces dedicated spans for agent invocations, model calls, and tool execution, allowing developers to debug complex AI workflows more effectively. The system highlights trade-offs in data storage defaults, truncation limits, and pricing models, emphasizing the evolving needs for telemetry in generative AI architectures.
Read original on InfoQ ArchitectureCloudflare has introduced "agent tracing" as the first component of Cloudflare Agents, a new observability surface for AI agents running on Workers. This feature is designed to bridge the gap in telemetry for complex AI workflows, where standard infrastructure-level tracing (e.g., fetch calls, KV reads, D1 queries) often fails to capture the nuanced behavior of the agents themselves.
A key problem statement addressed by agent tracing is that an AI agent might return an HTTP 200 success code while still exhibiting internal failures, such as picking the wrong tool, passing stale context, or getting stuck in retry loops. Traditional application telemetry provides visibility into API requests or database queries but lacks insight into the agent's decision-making process that led to these actions. Agent tracing solves this by adding specific spans for agent-level operations.
Agent tracing extends the existing Workers tracing by introducing spans for critical AI agent activities, including:
Waterfall Tracing
The system visualizes these operations as a waterfall, allowing developers to see a parent agent delegating to a subagent, which then calls a model, runs a tool, and interacts with backend services like D1 or KV. This unified view across different layers is crucial for debugging complex, multi-step AI workflows.
Key design considerations and trade-offs emerge around data handling and pricing:
The integration with OpenTelemetry Generative AI semantic conventions and OTLP endpoints positions this feature within a broader industry trend of enhancing telemetry for AI agent runtimes, recognizing that infrastructure spans alone are insufficient to understand agent behavior.