Workers tracing bills per span: measure spans per trace before choosing a sampling rate
Omid Saffari explains that a single traced request across RPC calls can produce many billable spans, and suggests measuring span density on one path before setting production sampling.
- Products
- WorkersDurable ObjectsWorkers Logs
- Source
- Author experience𝕏
- Author
- Omid Saffari (@omidsaffari)
Key points
- The author writes that from October 1, every root, RPC session, method-call, callee and nested binding span shares the Workers Logs quota, and that the default head_sampling_rate of 1 traces 100% of requests.
- His method: reproduce one customer path at 100%, count its spans, then estimate sampled requests × average spans per trace plus existing log events. A rate such as 0.05 cuts volume but may miss rare slow requests.
- Current docs (rechecked 2026-10-14): from December 1, 2026, logs and traces move to per-GB Observability pricing. Before that, Workers Logs is Free 200,000 events a day and Paid 20 million a month plus $0.60 per million.
Original sources
Published
Original post
Read on 𝕏Omid Saffari explains that a single traced request across RPC calls can produce many billable spans, and suggests measuring span density on one path before setting production sampling.
Omid Saffari
@omidsaffari · Original 𝕏 post
From October 1, one traced customer request can count as several observability events. @Cloudflare bills Workers tracing by span, and the default setting samples 100% of incoming requests. That matters because the new trace is much more useful than the old one. A JavaScript RPC call is one Worker calling a public method on another Worker or Durable Object. Until this release, the trace could stop at that boundary. You saw the caller make the request, then had to match logs or add custom spans to reconstruct what happened downstream. Now the same timeline can contain the caller-side RPC session, each method call, the callee invocation and nested calls or callbacks. For a checkout path, that means you can follow the first Worker into inventory.reserve(), then into order.commit() on a Durable Object. If the inventory invocation holds most of the wall time, start with its storage or upstream dependency. If the Durable Object call is wide, start with that handler. If the caller is slow before either RPC starts, stop blaming the downstream services. The trace finds the owner of the wait. It does not diagnose the slow method for you. These platform spans appear automatically after tracing is enabled, without adding an observability SDK or changing application code. But automatic tracing stops when the request leaves the platform, and some non-I/O work can show 0 ms because runtime time updates at an I/O event. The cost needs the same care as the diagnosis. Tracing is free during the initial beta. After October 1, every root, RPC session, method-call, callee and nested binding span shares the Workers Logs quota. Free includes 200,000 observability events per day and keeps them for 3 days. Paid includes 20 million per month, keeps them for 7 days and charges $0.60 per additional million. A sampling rate of 0.05 traces 5 of every 100 incoming requests. That cuts volume, but the decision happens before the request runs, so the rare slow one may never be selected. Start with one repeatable customer path at 100%. Count the spans it creates, then estimate sampled requests multiplied by average spans per trace and add the log events already using the quota. Set production sampling from measured spans per trace, not from request count. https://t.co/kS52KWk85N
The author’s blog version walks through enabling tracing, reading RPC spans and estimating monthly trace events before rollout.
Open original sourceRead originalArchived
This archive does not contain the complete text.
Cloudflare Shows Which Worker Slowed a Customer Request
You can see which service and method held up the request
More to read
风易: Do not call the upstream response live every time; use the Cache API for edge caching
On 2026-11-18, X user @Michael_liyang (风易) wrote: do not call the upstream response live every time; use the Cache API for edge caching. The approach is: the request checks the Cache API first and returns directly on a hit; on a miss, call upstream, write the successful response into the cache with a TTL; write operations do not enter the cache, and the hit rate is recorded in the D1 daily report. The chain is request → check cache → return on hit → call upstream on miss → write back → return. The author's judgment: what is cached is the upstream result, not your business state.
itsabhisheksood: a Cloudflare 3D Secure prompt asked to confirm a $275.68 monthly payment.
X user @itsabhisheksood (Abhishek Sood) posted a screenshot of a Cloudflare 3D Secure prompt asking to confirm a $275.68 payment, with the caption “A vibe coding mishap or something big in the making?” The prompt describes a monthly payment. X user @thisnaeem replied calling it a $275.68 monthly Cloudflare bill and asking whether an agent provisioned something or usage compounded. The product and cause are not stated. The public outcome is unknown.
Cloudflare Containers pricing: vCPU, memory, disk, and egress
Official Containers pricing (dateModified 2026-11-13): billed every 10ms while actively running. Memory and disk are billed on the provisioned instance size for the time the instance is up; CPU is billed on active usage only. Workers Paid includes 25 GiB-hours of memory, 375 vCPU-minutes, and 200 GB-hours of disk per month, then per-second overage rates. Charges start when a request is sent to the container or it is started, and stop after the instance goes to sleep. Snapshots are free during the public beta; GA pricing has not been published. This official page was not yet in the catalog; it did not change in the 2026-11-22 to 2026-11-25 window.