Prevent a disk-full outage on a log server before it happens.
IntermediateScenarioAlerting and On-Call Design
Answer
Situation read → A static "disk above 90%" alert gives too little time on fast-growing disks and too much noise on slow ones. Use rate-of-change.
What I'd do →
- Use
predict_linearto ask "will this fill within 4 hours?".
- alert: DiskWillFillIn4h
expr: |
predict_linear(node_filesystem_avail_bytes{fstype!~"tmpfs|overlay"}[1h], 4*3600) < 0
and node_filesystem_avail_bytes / node_filesystem_size_bytes < 0.4
for: 15m
labels: {severity: page}
- Add a 24-hour prediction at warning severity (ticket).
- Add a static 85% warning as a backstop.
Why → Time-to-full is what matters operationally. The second condition avoids paging on large, mostly-empty disks.
Interview tip → Mention inodes (node_filesystem_files_free) as the other way disks "fill".
More on Alerting and On-Call Design
Your on-call engineers receive 300 alerts a night and have started ignoring the pager. How do you fix it?IntermediateYou are asked to design alerting for a brand-new HTTP service from scratch. What do you alert on?BeginnerA "CPU above 90%" alert wakes someone at 3 a.m., but users saw no impact. What do you change?BeginnerA new hire asks: "Should we page on symptoms or causes?" How do you answer with an example?BeginnerDesign burn-rate alerts for a 99.9% availability SLO over 30 days.AdvancedPayments and platform teams share one Prometheus and one Alertmanager. How do you route alerts to the right team and severity?Intermediate