Traces
Tracing gives you end-to-end visibility into the life of a request as it travels through your Workers application and connected services. This helps you identify performance bottlenecks, debug issues, and understand complex request flows. With tracing you can answer questions such as:
- What is the cause of a long-running request?
- How long do subrequests from my Worker take?
- How long are my calls to my KV Namespace or R2 bucket taking?

Cloudflare Workers provides tracing instrumentation out of the box - no code changes or SDK are required. Simply enable tracing on your Worker and Cloudflare automatically captures telemetry data for:
- Fetch calls - All outbound HTTP requests, capturing timing, status codes, and request metadata. This enables you to quickly identify how external dependencies affect your application's performance.
- Binding calls - Interactions with various Worker bindings such as KV reads and writes, R2 object storage operations and Durable Object invocations.
- Handler calls - The complete lifecycle of each Worker invocation, including triggers such as fetch handlers, scheduled handlers, and queue handlers.
For a full list of instrumented operations , see the spans and attributes documentation.
If you have already set observability.enabled = true in your wrangler configuration file, tracing and logs will be automatically enabled.
{ "observability": { "enabled": true }}[observability]enabled = trueYou can also configure tracing independently by setting observability.traces.enabled = true in your wrangler configuration file.
{ "observability": { "traces": { "enabled": true, // optional sampling rate (recommended for high-traffic workloads) "head_sampling_rate": 0.05 } }}[observability.traces]enabled = truehead_sampling_rate = 0.05Workers tracing follows OpenTelemetry (OTel) standards ↗. This makes it compatible with popular observability platforms, such as Honeycomb, Grafana Cloud, and Axiom, while requiring zero development effort from you. If your observability provider has an available OpenTelemetry endpoint, you can export traces (and logs)!
Learn more about exporting OpenTelemetry data from Workers here.
With sampling, you can trace a percentage of incoming requests in your Cloudflare Worker. This allows you to manage volume and costs, while still providing meaningful insights into your application.
The valid sampling range is from 0 to 1, where 0 indicates zero out of one hundred invocations will be traced, and 1 indicates every requests will be traced,
and a number such a 0.05 indicates five out of one hundred requests will be traced.
If you have not specified a sampling rate, it defaults to 1, meaning 100% of requests will be traced.
{ "observability": { "traces": { "enabled": true, // set tracing sampling rate to 5% "head_sampling_rate": 0.05 }, "logs": { "enabled": true, // set logging sampling rate to 60% "head_sampling_rate": 0.6 } }}[observability.traces]enabled = truehead_sampling_rate = 0.05
[observability.logs]enabled = truehead_sampling_rate = 0.6If you have head_sampling_rate configured for logs, you can also create a separate rate for traces.
Sampling is head-based ↗, meaning that non-traced requests do not incur any tracing overhead.
Workers tracing is currently free during the initial beta period. This includes all tracing functionality such as collecting traces, storing them, and viewing them in the Cloudflare dashboard.
Starting on January 15, 2026, tracing will be billed as part of your usage on the Workers Free Paid and Enterprise plans. Each span in a trace represents one observability event, sharing the same monthly quota and pricing as Workers logs:
| Events (trace spans or log events) | Retention | |
|---|---|---|
| Workers Free | 200,000 per day | 3 Days |
| Workers Paid | 10 million included per month +$0.60 per additional million events | 7 Days |
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-