Configure Cloudflare Traces separately for each domain. Choose how many requests to trace, where to save or send traces, and whether to connect them to traces from other systems.
Default sample rate (%) sets how many requests Cloudflare traces. For example, a rate of 10% traces about 10 out of every 100 requests. Trace rules can use a different rate for requests that match a rule.
Trace rules override the default sample rate for matching requests. Cloudflare uses the first matching rule, so rule order matters.
Choose Custom filter expression to match selected requests, or choose All incoming requests to apply the rule to every request. Build a custom filter from fields, operators, and values, or select Edit expression to write it with the Cloudflare Rules language.
Set Sample rate (%) to the percentage of matching requests you want to trace. Select Save as Draft to keep the rule inactive, or select Deploy to start using it.
Turn on Persist to Cloudflare to save traces in Cloudflare and view them in the dashboard.
Use Export destinations to send traces to configured account-level OpenTelemetry destinations. To create a destination or configure a provider, refer to OpenTelemetry export.
You can save and export the same traces. If you only want traces in an external tool, turn off Persist to Cloudflare.
Trace context carries identifiers that connect spans from different systems into one trace. Cloudflare uses W3C Trace Context ↗︎ to connect its spans to services before or after Cloudflare in the request path. You can configure incoming and outgoing propagation separately.
Use Incoming trace context to choose whether Cloudflare accepts trace context included with an incoming request. The default setting is Reject, which ignores the incoming context so Cloudflare does not join the caller's trace.
Turn on Forward to origin to include trace context in requests that Cloudflare sends to your origin. An instrumented origin can use this context to add its spans to the same trace. Forwarding context does not instrument the origin or create origin spans by itself.
To view Cloudflare and origin spans in one trace in a third-party observability tool, send both sets of spans to the same OpenTelemetry destination.