cf-usage-guard
An open-source library that reads account usage from the Cloudflare GraphQL API and circuit-breaks individual Worker bindings before overages.
- Products
- WorkersKVD1R2Queues
- Source
- Community resourceGitHub repository
- Author
- tristanwagner
Key points
- The README requires the Workers Paid plan, an API token with Account Analytics: Read, a KV namespace for state, and a cron trigger that calls guard.evaluate(), for example every five minutes.
- It trips per resource with throw, skip, or custom behavior; wraps KV, D1, R2, Queues, AI, and Vectorize bindings; and offers dry-run mode, recovery 5% below the threshold, alert deduplication, and an optional global overage budget. If KV is unavailable, it defaults to not tripped.
- The README says the library is not affiliated with Cloudflare. Analytics can lag by several minutes, so it cannot stop overages that happen faster than the cron interval plus that delay, and it does not guarantee no overage charges.
Original sources
Undated
cf-usage-guard
Open original sourceAn open-source library that reads account usage from the Cloudflare GraphQL API and circuit-breaks individual Worker bindings before overages.
More to read
Workers Free: SQLite Durable Object row-write quota can still block after the 00:00 UTC reset
Two Workers Free users with SQLite-backed Durable Objects report that after exceeding the 100,000 daily row-write allowance, storage still threw “Exceeded allowed rows written in Durable Objects free tier” after the documented 00:00 UTC reset, even though GraphQL analytics already showed 0 rows written for the new UTC day. @vendasecoplast1 saw 114,211 rows written and 399,088 rows read on 2026-11-16 UTC, then a failure at 2026-11-17 00:17:32 UTC during CREATE TABLE IF NOT EXISTS in the constructor. @dimoncheck2020 saw 103,558 rows written on 2026-11-18 UTC and 24 failed Durable Object invocations with 0 rows written between 00:00:00 and 00:35:27 UTC on 2026-11-19, with the same constructor exception at 00:35:21 UTC. No Cloudflare staff reply as of 2026-11-19.
v.kleinhenz: Argo costs jumped from $400 to $5,000 a month.
Community user v.kleinhenz says Argo costs for eurekamag.com rose from $400 a month to $5,000 a month, that he turned Argo off, and that Cloudflare does not protect against such a shock charge; in a follow-up he attributes it to bot traffic.
Four months of CI on Cloudflare Containers: per-use vCPU billing and a hard cap that stopped CI
@kelvin_des describes moving all CI from GitHub Actions to one Cloudflare Container per job and puts the list-price bill for the same 90 days at about $1,608 versus $3,288–$6,502 for GitHub-hosted runners, because Containers bill vCPU on use and his boxes were about 41% busy. He also reports a ledger bug that made his own hard daily minute cap refuse every container, after which he bounds spend by max containers × per-job deadline.