Skip to content

fix(observability): trim staging telemetry to ~5 GB/month - #287

Draft
alukach wants to merge 1 commit into
source-cooperative:mainfrom
alukach:worktree-trim-staging-observability
Draft

alukach wants to merge 1 commit into
source-cooperative:mainfrom
alukach:worktree-trim-staging-observability

Conversation

@alukach

@alukach alukach commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

What

Staging's observability now matches production's log setting, and its traces are sampled at 10%:

Staging setting Before After
logs.invocation_logs true false
traces.head_sampling_rate 1 0.1

Everything else is unchanged: all WARN/ERROR lines are kept, query strings are redacted, and Issues stays off (the M1 alert is account-wide, ADR-015).

Why

Staging serves about 150k requests a day, but its telemetry was about 4 GB/day (about 125 GB/month), as much as production. Measured with the Workers Observability usage API over Nov 15–19, after v2.5.2 deployed:

GB/day
Staging invocation logs 2.7
Staging traces 1.4
Production (1% traces, no invocation logs) 6.2

The comment in wrangler.toml and ADR-015 both said staging was about 5 GB/month. That was off by a factor of about 25.

From Dec 1, Workers Observability bills ingestion at $0.25/GB past 50 GB a month, shared across the account. Staging's extra volume is about $30/month.

Expected result

  • Invocation logs, about 65% of staging's volume, drop to about zero.
  • Traces fall by 90%, from about 1.4 GB/day to about 0.14 GB/day.
  • Staging comes to about 5 GB/month, about $1/month, matching what ADR-015 had projected.

This is an estimate from the figures above. I haven't measured staging after the change.

Why 10% for traces, not production's 1%

At about 150k requests a day, 1% leaves about 1.5k traces a day, too few to find a particular staging request. 10% costs about $1/month more than 1% and leaves enough to debug with.

Not changed

PR previews (wrangler.preview.toml) still use full sampling and invocation logs. They're idle today and cost almost nothing, but a busy preview (a load test, say) would add up.

Checks

  • wrangler.toml parses, and the resolved env.staging.observability values are the ones above.
  • Pre-push hook passed: cargo fmt, wasm clippy and check, and cargo test.

🤖 Generated with Claude Code

Staging kept every invocation log and traced every request. At ~150k
requests/day that was ~4 GB/day (~125 GB/month), as much as production, and
the "~5 GB/month" in wrangler.toml and ADR-015 was wrong. From Dec 1,
Workers Observability bills ingestion at $0.25/GB past 50 GB, so it is about
$30/month.

Turn invocation logs off, as in production, and sample traces at 10%.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch had an error being deployed

1 failed deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant