Now you can debug Workers with local tracing
Key point
Cloudflare automatically collects OpenTelemetry traces from local Worker invocations to support AI agent debugging.
Details
Cloudflare's wrangler dev and vite dev now automatically collect OpenTelemetry traces for local Worker invocations. When the dev server detects an AI coding agent session, it guides the agent to query traces and logs through the Local Explorer API.
No SDK installation, tracing activation, or agent configuration is required. Agents can reproduce errors, find the cause, fix them, and verify the results locally with a simple request like the following.
POST /api/orders is returning 500. Find the cause, fix it, and verify the fix locally.
The Local Explorer API provides both a browser interface and a REST API, and the OpenAPI schema is available at the API root so agents can automatically discover the endpoints they need at runtime. The observability endpoints allow you to query the following data.
- Local traces and logs queried via SQL
- Console logs linked to traces
- Local Workers and binding information
- Status of D1, KV, R2, Durable Objects, and Workflows
For example, if /api/orders returns a 500 error, the trace can reveal that the KV lookup succeeded but the D1 insert failed with a no such column: delivery_window error, and that the Queue call never executed. Instead of repeatedly adding logs, the agent identifies the cause and verifies the fix based on structured execution data.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.