billflare.

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

  1. 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
  2. The author’s blog version walks through enabling tracing, reading RPC spans and estimating monthly trace events before rollout.

    Open original source
Author experienceDurable Objects +3

Designing a poker game on Durable Objects so idle time costs nothing

Philip Atkinson describes the architecture of his multiplayer poker game on the Cloudflare Developer Platform and the cost rules he follows: archive finished games out of Durable Object storage, hibernate WebSockets, wake with alarms and treat logging as a cost decision.

Other

sylwair: nearly $900 of usage in under two days after a project mistake.

@sylwair says a recent project mistake ran up nearly $900 in less than two days. He says he spotted it in Cloudflare's billable-usage view and stopped the abnormal service, and in a reply adds that the daily billing figures appeared with a delay, so the amount did not visibly drop after he stopped it.

Official docsAccount-wide usage-based products

Budget alerts

Cloudflare documents account-wide spend alerts and their notification limits.