Your agent can now debug Workers with local tracing
- Source
- blog.cloudflare.com
- Author
- Cloudflare
- Date

Context
Cloudflare’s local tracing gives coding agents a structured account of what happened when they ran a Worker on a development machine. Updated development tools capture request, storage and handler operations, then expose traces and associated logs through a read-only observability endpoint. In the company’s example, the trace shows a successful storage read followed by a database insert failing because a local column is missing. The can inspect the schema, apply the missing local migration and repeat the request to check the result. The useful addition is evidence from the failing invocation before deployment.
- wrangler dev and vite dev now auto-capture OpenTelemetry traces for local Worker invocations, and when a coding-agent session is detected they print a hint pointing the agent at a local Explorer REST API — no SDK, config, or prompt changes needed.
- The API root serves an OpenAPI schema so agents discover endpoints at runtime; traces arrive with correlated console logs plus read access to local D1/KV/R2/Durable Object state.
- The debug loop collapses: instead of sprinkling logs and rerunning, the agent queries the trace (e.g. a D1 insert failing on a missing column), finds the unapplied migration, applies it, and verifies the fix locally before any deploy.
- Instrumentation lives in workerd itself — fetch, binding, and handler spans are captured at the runtime level — and Miniflare stores local telemetry in a SQLite-backed Durable Object.
- AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
“Starting today, wrangler dev and vite dev automatically capture OpenTelemetry traces for local Worker invocations.”
“You do not need to install an SDK, enable tracing, configure your agent, or even mention observability in the prompt.”
“In one local loop, the agent identifies the failed operation, fixes the local environment, and verifies the result without deploying or adding temporary logs.”
“Your agent can already write and run your Worker locally — now it can see what happened, fix what failed, and verify the result before you deploy.”
Checking sign-in…
Loading comments…






