Interview Prep/Monitoring & Observability/Prometheus storage, memory and cardinality

Recording rule results disappear for 5 minutes after each Prometheus restart

IntermediateTroubleshootingPrometheus storage, memory and cardinality
Answer

Likely causes → Normal behaviour: rule evaluation needs enough raw data in the range (rate(x[5m]) needs 2 samples inside 5m), and gaps appear while Prometheus is down.

Diagnose → Compare the gap with the pod restart time.

Fix → Run Prometheus as an HA pair and query through Thanos/Mimir with dedup so one replica covers the other's gap.

Prevent → Use for: on alerts so a short gap does not resolve and re-fire alerts.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus storage, memory and cardinality