What does `for` protect against and what does `keep_firing_for` add?
IntermediateConceptPromQL & Recording Rules
Answer
for: 10m requires the condition to hold continuously for 10 minutes, filtering out brief spikes. If the condition flips false even once, the pending timer resets.
keep_firing_for: 5m keeps an alert firing for 5 minutes after the condition clears, preventing flapping resolve/fire notifications when a metric hovers around the threshold or a scrape is missed. Too long a for delays real pages, so it is a trade-off against detection time.
More on PromQL & Recording Rules
What are the PromQL data types?BeginnerWhat label matchers does PromQL support?BeginnerExplain `rate()`.Beginner`rate()` vs `irate()`: what is the difference?IntermediateWhat does `increase()` return and why is it sometimes a non-integer?IntermediateWhy must you `rate()` before `sum()`, never the reverse?Intermediate