Free ops runbook · observability

Log pipeline cost: sample what you query, keep what you need

The bill grows faster than traffic. Usually it is one debug logger left on, a label with a user ID, or a thirty-day retention nobody queries. The fix is per-stream, not a single global sampling rate.

Volume vs cardinality

A million unique label values cost more than a million lines with ten labels.

Sample debug, keep errors

Sample info/debug at the source; keep errors and audit events at 100%.

Retention per stream

Access logs 7 days, audit 1 year, debug 1 day. One global retention is either too short or too expensive.

Query cost

Wide queries over long ranges cost more than the storage; design dashboards around indexed fields.

Detect

Find the producer

SignalWhat it tells you
Volume by service / loggerWhich producer is responsible, before sampling globally.
Unique label valuesHigh-cardinality fields (user id, request id) that should not be labels.
Lines per requestA middleware logging three lines per request is a 3x multiplier.
Retention vs queriesStreams nobody queried in 30 days.
Cut

Order of changes

1. Turn off debug in production

The cheapest win; no query depends on it.

2. Drop high-cardinality labels

Keep the value in the message body, not as an index key.

3. Sample at the source

Head sampling for debug, tail sampling for traces with errors.

4. Set retention

Per stream, with an owner; review quarterly.

Keep going

This page is free. The paid runbooks cover the operational failures around it, with detection commands, five failure modes and a migration checklist.