Lesson 9 of 9 · 28m
Operating the Metrics System Like Production Infrastructure
Capacity-plan, monitor, upgrade, and recover the observability stack itself so the system you use during outages does not become the outage.
Every experienced operator eventually learns the darkest joke in observability: the monitoring system is production infrastructure. It has capacity limits, failure modes, upgrade risk, security exposure, and its own SLO. If it falls over during a customer incident, you are blind exactly when you paid for sight.
Monitor the monitors
At minimum, graph and alert on the observability stack's own behavior:
prometheus_tsdb_head_series
rate(prometheus_tsdb_head_samples_appended_total[5m])
prometheus_tsdb_head_chunks
prometheus_remote_storage_samples_pending
rate(prometheus_remote_storage_samples_failed_total[5m])
prometheus_rule_evaluation_duration_secondsFor object-backed systems, add compactor lag, bucket sync failures, store gateway cache hit ratios, and query latency. For collectors, add queue size, refused batches, exporter failures, and memory limiter pressure.
Capacity planning starts with ingestion math
Use rough arithmetic before buying distributed complexity:
active series 1,000,000
scrape interval 15 seconds
samples per second 1,000,000 / 15 = 66,667
replication factor 2
remote copies 1
effective writes ~133,000 samples/secondNow add churn, metadata, indexes, WAL, compaction headroom, and query cache. Disk sizing based only on final compressed sample bytes misses the operational working set. Memory sizing based only on active series misses query bursts and remote-write queues.
Upgrades are schema and behavior changes
Prometheus, Thanos, Mimir, Grafana, and collectors evolve storage formats, query behavior, and default limits. Read changelogs for:
TSDB or block format changes
remote-write protocol changes
default retention or limit changes
query parser behavior changes
deprecated flags and removed APIsUpgrade one noncritical ring first. Keep a rollback path that does not require rewriting already-created blocks. In distributed systems, version skew is normal; unsupported skew is what you must eliminate deliberately.
Failure drills beat architecture diagrams
Run drills for the failures you claim to survive:
lose one Prometheus replica
partition remote-write receiver for 30 minutes
fill object-store gateway cache disk
send a tenant cardinality spike
expire remote-write credentials
corrupt or remove one compacted blockMeasure what happened to ingestion, alerting, dashboards, and recovery time. A design that silently stops alerting during backend maintenance is not highly available; it is merely quiet.
Protect the control plane and the data plane
Metrics endpoints expose topology and sometimes sensitive labels. Remote-write endpoints are data-ingestion attack surfaces. Dashboards often carry broad organizational access. Apply the same controls as other production services:
remote_write:
- url: https://mimir-gateway.internal/api/v1/push
authorization:
type: Bearer
credentials_file: /run/secrets/mimir-token
tls_config:
ca_file: /etc/ssl/internal-ca.pemRotate credentials, scope tokens per tenant or cluster, audit administrative changes, and separate read-only dashboard access from write credentials.
Define the observability SLO
A reasonable internal SLO might include ingestion success, alerting freshness, and dashboard query availability:
99.9 percent of samples accepted within 60 seconds
99.95 percent of critical alert rule evaluations on time
99.9 percent dashboard query success during business hours
recovery of cross-cluster query within 2 hours after regional lossThese are examples, not universal targets. The important move is making the monitoring system measurable. Otherwise every outage review ends with 'monitoring was degraded' and no owner.
Field notes
- Do not alert on the monitoring system only through the monitoring system. Use an independent dead man's switch or external probe.
- Keep a minimal emergency dashboard that queries the fewest possible components.
- Rule evaluation backlog can delay pages even when ingestion is healthy.
- A full TSDB disk is easier to prevent than to recover gracefully; leave headroom for compaction and WAL.
- Observability infrastructure changes belong in change management because they affect every other incident response process.
Was this lesson helpful?