Interview Prep/Monitoring & Observability/Alerting and On-Call Design

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 →

  1. Have the job push backup_last_success_timestamp_seconds to the Pushgateway (or expose it from a CronJob exporter) on success.
  2. 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
  1. 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."

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Alerting and On-Call Design