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

An alert flaps between firing and resolved every few minutes. What do you do?

IntermediateScenarioAlerting and On-Call Design
Answer

Situation read → The expression hovers around the threshold, or the metric is noisy.

What I'd do →

  1. Check the expression in the Prometheus graph view with a 6h range to see the oscillation.
  2. Increase for: so a short blip does not fire (e.g. for: 10m).
  3. Smooth the input: use avg_over_time(x[10m]) or a longer rate() window.
  4. Use keep_firing_for: 15m (Prometheus 2.42+) so a firing alert stays active briefly after the condition clears.
  5. Consider hysteresis: different thresholds to fire and clear using two rules.

Why → for: filters short spikes, keep_firing_for prevents resolve/fire churn that spams receivers.

Interview tip → Distinguish for (delay before firing) from keep_firing_for (delay before resolving).

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Alerting and On-Call Design