Lesson 11 of 13 · 15m
The Telemetry Bill: Cardinality and Volume as Budgets
Vendors bill by series, GB ingested, and spans retained — enforce budgets at scrape and ingest time, not in the invoice.
The invoice arrives: the observability vendor bills by ingested GB, indexed events, and active series, and the number rivals the compute bill. That is not an anomaly. It is the default outcome of shipping telemetry nobody priced. The wrong mental model is "observability is free once the tools run." Every signal has a meter, and the dials are cardinality and volume — not the tool.
Where the bill actually comes from
Metrics: every unique labelset is a series, and SaaS pricing counts active series or data points — the user_id label that OOMs your Prometheus just becomes a line item at a vendor. Do the math before someone else does: 10k series scraped at 15s is ~57 million data points a day, per target. Logs: billed per GB ingested and per GB indexed; teams routinely discover their top ten log lines by volume are health checks and leftover debug. Traces: billed per span ingested or retained; a chatty dependency at 10k RPS is a billable forest.
The famous invoices are not secrets. Coinbase's Datadog commitment — reported at roughly $65 million a year around its direct listing — became the industry's favorite cautionary tale precisely because it was normal. Telemetry at scale is a real budget line, and "we will sort cost later" is how it gets out of hand.
Cardinality is a budget, not a suggestion
The organizational side matters as much as the config: anyone who can ship code can mint series, so the guardrail has to live where the metrics get scraped — a platform-owned scrape_configs template with limits, and a dashboard of series-per-job so the team that doubled the count sees it before the invoice does. Budgets enforced socially become an argument; budgets enforced at scrape time become a constraint people design around.
Enforce per-team series budgets in config, not in a wiki:
scrape_configs:
- job_name: api
sample_limit: 10000
label_limit: 30
metric_relabel_configs:
- source_labels: [__name__]
regex: "debug_.*"
action: dropsample_limit refuses oversized scrapes, label_limit caps labelset width, and metric_relabel_configs drops known-wasteful metrics before they reach the TSDB. Add a CI check watching scrape_samples_scraped growth per job. The failure is not moral — any developer can mint a million series with one innocent path label, and nobody finds out until the invoice or the OOM.
Logs: audit by volume, cut by rule
Sort log lines by count, never by alphabet. The top offender is always mechanical — health checks, access logs duplicated into app logs, a DEBUG flag left on a hot path. Fix in order: sample the hot path, move access logging to the load balancer layer, and drop lines at the ingest filter before they are billed — Loki pipeline stages and vendor exclusion filters do this — because after indexing is too late.
Traces: tail sampling is the price/quality dial
Keep every trace with an error, a latency outlier, or a route you just shipped; keep 1–5% of the baseline. The collector's tail_sampling processor does exactly this at the cost of buffering RAM and a decision wait. Head sampling at 1% is cheaper and drops exactly the traces you needed — the error ones. That trade is the whole lesson.
Concrete practice
- A cardinality budget per team, enforced at scrape time — not a wiki page.
- Monthly top-N audits: log volume by pattern, series by metric name, spans by service.
metric_relabel_configsdrops at the edge; vendor ingest filters drop at the door. Both are cheaper than storage.- Price telemetry per service in the same spreadsheet as compute. It is infra, not a freebie.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
Your Container Is Running SerialGC and Nobody Told You
You tuned G1 flags for a week. Your pod has one CPU, which means the JVM quietly picked a single-threaded collector at startup and ignored every flag you set. Here is the OpenJDK source that made that decision.
PostgreSQL 19 Is Out. REPACK Kept My Writes Running. The Docker Upgrade Will Stop Your App.
PostgreSQL 19 shipped on November 19 with REPACK (CONCURRENTLY), which removes table bloat without blocking writes. I measured it against VACUUM FULL, ran the upgrade from 18, and checked what breaks for self-hosters: Docker tags that refuse to start, a config setting that stops the server, and...
AWS Emulator Puts AWS on Your Laptop. Keep Your IAM Tests Off It.
AWS released AWS Emulator on November 11, a free local server that answers AWS API calls on 127.0.0.1 with per-run keys and fresh certificates.
Your npm Install Just Ran Someone Else's Code: Why Dependency Security Has to Start Before CI
A pull request checkout, a poisoned GitHub Actions cache, and an OIDC token pulled straight out of runner memory. That's how 84 malicious versions of TanStack's packages hit npm in six minutes.