A nightly backup job must complete every day, but when it fails to run there is no metric at all. How do you alert?
IntermediateScenarioAlerting and On-Call Design
Answer
Situation read → Absent data. A threshold alert on a missing series never fires.
What I'd do →
- Have the job push
backup_last_success_timestamp_secondsto the Pushgateway (or expose it from a CronJob exporter) on success. - Alert on staleness, not on the value.
- alert: BackupNotRunIn26h
expr: time() - backup_last_success_timestamp_seconds > 26 * 3600
labels: {severity: page}
- alert: BackupMetricMissing
expr: absent(backup_last_success_timestamp_seconds)
for: 30m
- For Kubernetes CronJobs with kube-state-metrics:
time() - kube_cronjob_status_last_successful_time > 93600.
Why → "Last success timestamp" turns a missing event into a measurable age. absent() covers the case where the series itself disappears.
Interview tip → Say "alert on the absence of success, not the presence of failure."
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