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.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL & Recording Rules