Interview Prep/Monitoring & Observability/PromQL and recording rules

`predict_linear` disk-full alert fires constantly on log volumes

IntermediateTroubleshootingPromQL and recording rules
Answer

Likely causes → Logrotate makes usage sawtooth; a short window extrapolates each growth spike as if it continues.

Diagnose → Plot node_filesystem_avail_bytes for the mount over 24h.

Fix → Use a longer window and a minimum free threshold together:

predict_linear(node_filesystem_avail_bytes{mountpoint="/var/log"}[6h], 4*3600) < 0
and node_filesystem_avail_bytes{mountpoint="/var/log"} / node_filesystem_size_bytes < 0.2

Prevent → Add for: 30m.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL and recording rules