Menu
InfoQ Architecture·August 15, 2026

Cloudflare's Agent Tracing for AI/ML Workflows and Observability

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 Architecture

Cloudflare 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.

The Observability Gap in AI Agents

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-Level Spans and Workflow Visibility

Agent tracing extends the existing Workers tracing by introducing spans for critical AI agent activities, including:

  • Agent invocations
  • Model calls (with model and token usage metadata)
  • Tool execution
  • Tool approvals
ℹ️

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.

Data Privacy, Truncation, and Pricing Considerations

Key design considerations and trade-offs emerge around data handling and pricing:

  • Payload Recording Defaults: Cloudflare notes an inconsistency in default payload storage based on the agent harness used (Think, Flue). Some store messages and tool payloads by default, while others require explicit configuration. This impacts privacy and compliance, especially for PII or secrets.
  • Truncation Limits: Traces are not lossless. Long messages, reasoning, tool arguments, and results may be truncated due to span size limits. This means session replay, while useful for debugging, cannot reliably serve as a complete audit trail.
  • Pricing Model: Each span counts as one observability event, including internal SDK spans not visible in the dashboard. This can lead to higher costs than initially perceived, as a verbose harness generates more events. Retention periods (3-7 days) are also relatively short, better suited for incident response than long-term pattern analysis.

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.

Cloudflare WorkersAgent TracingObservabilityAI AgentsGenerative AIOpenTelemetryDistributed TracingDebugging

Comments

Loading comments...