Prometheus crashed because its disk filled up. How do you prevent a repeat?
BeginnerScenarioLong-Term Storage, Scale and Cost
Answer
Situation read → Time-based retention alone does not cap disk when series grow.
What I'd do →
- Add size-based retention alongside time-based:
(keep it at ~80% of the volume size to leave room for WAL and compaction).--storage.tsdb.retention.time=15d --storage.tsdb.retention.size=180GB - Alert on disk usage:
orpredict_linear(node_filesystem_avail_bytes{mountpoint="/prometheus"}[6h], 24*3600) < 0kubelet_volume_stats_available_bytesfor a PVC. - Use an expandable StorageClass (
allowVolumeExpansion: true). - Investigate why series grew (
/api/v1/status/tsdb).
Why → The oldest blocks are deleted first when the size limit is reached, which is better than a crash.
Interview tip → Size retention is a safety net, not a plan; the real fix is controlling series growth.
More on Long-Term Storage, Scale and Cost
Prometheus keeps 15 days of data, but leadership wants 13 months of metrics for capacity planning. What do you build?IntermediateThe Thanos compactor has halted and the bucket keeps growing. What do you do?AdvancedGrafana shows every series twice after you added a second Prometheus replica with Thanos. How do you fix it?IntermediateRemote write to your central store is falling further behind every hour. How do you handle it?AdvancedMimir rejects writes from a team with `err-mimir-max-series-per-user`. What do you do?IntermediateYour observability SaaS bill tripled in a quarter, driven by custom metrics. How do you bring it down?Intermediate