VOOZH about

URL: https://developers.cloudflare.com/workers/observability/traces/

⇱ Traces · Cloudflare Workers docs


Skip to content

Traces

What is Workers tracing?

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?

Automatic instrumentation

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, refer to the spans and attributes documentation.

Custom spans

You can also create your own spans to trace application-specific logic. Custom spans nest automatically with the built-in instrumentation, giving you end-to-end visibility across both platform operations and your own code.

For more information, refer to Custom spans.

How to enable tracing

You can configure tracing by setting observability.traces.enabled = true in your Wrangler configuration file.

Exporting OpenTelemetry traces to a 3rd party destination

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

Sampling

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.

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

Limits & Pricing

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 March 1, 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 Free200,000 per day3 Days
Workers Paid10 million included per month +$0.60 per additional million events7 Days