Repository navigation
Conversation
From 2026-12-01 Cloudflare bills Workers logs and traces per GB. At the current 25% sampling prod stores ~122 GB/day (~$990/month under the new pricing), almost all of it invocation logs and automatic spans. Prod keeps every WARN/ERROR line, drops invocation logs (ANALYTICS already records every request), traces 1%, redacts query strings and enables Issues. The Axiom destinations have failed since 2026-10-05 and are removed. Staging captures everything. Closes #265 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Claude finished @alukach's task in 15s —— View job ✅ No blocking issues — safe to merge. I read the
Two non-blocking notes:
Simplify (ponytail)
💰 Estimated review cost: $0.10 · 0m14s · 5 turns |
|
🚀 Latest commit deployed to https://source-data-proxy-pr-266.source-coop.workers.dev
|
Records the decisions behind the wrangler.toml change: Analytics Engine as the per-request record, all own log lines without invocation logs, 1% traces, redacted query strings, Issues, no Axiom, Monitors as JSON applied by API. Amends ADR-008's retention and operational-logging sections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Previews capture logs and traces at 100%, so presigned signatures in the query string were stored there too. Also records in ADR-015 that log volume follows WARN lines, which refused /.sts exchanges can drive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #265. The decision is recorded in ADR-015, which amends ADR-008.
From 2026-12-01, Cloudflare bills Workers logs and traces by volume (announcement, pricing). Paid plans include 50 GB ingested and 10 GB-month stored per cycle, then charge $0.25/GB ingested and $0.10/GB-month stored. At our current sampling, that would cost about $990/month. This PR brings it to about $15/month and keeps the signals we actually debug with.
Research (prod, 2026-09-29 → 2026-10-28)
Measured from the GraphQL analytics API (
workersInvocationsAdaptive) and the observability API (/workers/observability/usagefor bytes,/telemetry/queryfor counts by log type):src/lib.rs)axiom-logs/axiom-traceshave failed since 2026-10-05: "Destination delivery failed. Check the receiver configuration and credentials."Byte sizes are only recorded from 2026-10-06, so byte figures average Oct 7–28.
Queries used
All against account
1335bb5b87a1c2e1de2ca03408c23b71, run 2026-10-29.Requests per Worker, 30 days —
POST /graphql(Cloudflare's analytics API):Telemetry events and bytes per Worker, per day —
GET /accounts/{id}/workers/observability/usage?from=<ms>&to=<ms>(breakdown[].count,breakdown[].eventSize; datasetcloudflare-workers= logs,otel= traces; sizes recorded from 2026-10-06).Log events by type and level, 1 day —
POST /accounts/{id}/workers/observability/telemetry/query:{"queryId":"adhoc-breakdown","dry":true,"view":"calculations","ignoreSeries":true, "timeframe":{"from":1761436800000,"to":1761523200000}, "parameters":{"datasets":["cloudflare-workers"], "filters":[{"key":"$metadata.service","operation":"eq","type":"string","value":"source-data-proxy"}], "calculations":[{"operator":"count"}], "groupBys":[{"type":"string","value":"$metadata.type"},{"type":"string","value":"$metadata.level"}]}}cf-worker-event= invocation logs,cf-worker= our own lines; counts are scaled up for sampling.Responses by status class, 7 days —
POST /accounts/{id}/analytics_engine/sql:Observability settings and destination status —
GET /accounts/{id}/workers/scripts/{name}/settings,GET /accounts/{id}/workers/observability/destinations.Estimated monthly cost from Dec 1
Changes
Prod
ANALYTICSdataset, which already records every request (status, duration, bytes, path, product).redact_query_string = true: traces store full URLs with query strings, and presigned requests carryX-Amz-Signaturethere. The trade-off is losinglist-type/prefixdetails in traces.PR previews (
wrangler.preview.toml): redact query strings and enable Issues; sampling stays at 100%.Staging: capture 100% of logs, invocation logs and traces (~5 GB/month). This resolves the
TODOabout separate rates for prod and staging.public-log-stream: left without observability on purpose. It isn't critical, and its free built-in metrics already show its error rate.Checked that the TOML parses, and that Wrangler 4.155.0 (what CI's
wrangler@4installs) acceptsredact_query_stringandobservability.issues, which need ≥ 4.134.Follow-ups (outside
wrangler.toml)axiom-logs/axiom-tracesdestinations in the dashboard. They are account-level objects, so this PR doesn't remove them.x-source-trace) so we can trace a single request on demand.coolnewgeo.comis on the Free plan, and I couldn't verify through the API that Trace Rules are available.source_data_proxy_production: 5xx rate and p99duration_ms.🤖 Generated with Claude Code