Troubleshooting

A /var filesystem fills slowly but steadily. The team wants a Prometheus alerting rule that fires when, based on the trend over the last 6 hours, /var is predicted to run out of space within 4 hours. Which expression does this?

Show the answer

Correct answerA. predict_linear(node_filesystem_avail_bytes{mountpoint="/var"}[6h], 4*3600) < 0

predict_linear extrapolates the 6-hour trend 4 hours ahead and fires if the projected free space drops below zero. increase(...) < 0 is tempting but is true for any decline in free space, regardless of whether the filesystem will fill.