Interview Prep/Monitoring & Observability/Long-Term Storage, Scale and Cost

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 →

  1. Add size-based retention alongside time-based:
    --storage.tsdb.retention.time=15d --storage.tsdb.retention.size=180GB
    
    (keep it at ~80% of the volume size to leave room for WAL and compaction).
  2. Alert on disk usage:
    predict_linear(node_filesystem_avail_bytes{mountpoint="/prometheus"}[6h], 24*3600) < 0
    
    or kubelet_volume_stats_available_bytes for a PVC.
  3. Use an expandable StorageClass (allowVolumeExpansion: true).
  4. 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.

All Monitoring & Observability questions

More on Long-Term Storage, Scale and Cost