What does `absent()` do and why is it important for alerting?

IntermediateConceptPromQL & Recording Rules
Answer

absent(v) returns a single series with value 1 when the selector matches nothing, and nothing otherwise. Normal alerts cannot fire on missing data, because x > 0 on no data is simply no result.

absent(up{job="payments-api"})
absent_over_time(backup_last_success_timestamp_seconds[2h])

Use it to catch "the exporter vanished" or "the job was renamed and all alerts went silent".

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL & Recording Rules