What is an alerting rule, and how does it differ from a recording rule? [Basic]
Answer
An alerting rule evaluates a condition and creates an alert when the condition is true for the configured duration. A recording rule stores a query result for reuse; an alerting rule produces notifications through Alertmanager.
Technical explanation
Recording rules are about performance, standardization, and reusable derived metrics.
Alerting rules are about detecting actionable conditions and attaching labels and annotations.
A good pattern is to use recording rules for SLO math, then alerting rules for burn-rate thresholds.
Hands-on example
Example: record service:http_error_ratio:rate5m. Then alert: if service:http_error_ratio:rate5m > 0.02 for 10m, fire HighErrorRate with labels severity='page' and annotations pointing to the runbook and dashboard.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Observability interview questions
- What is a recording rule, and when would you use one? [Basic]
- How do you compute a 95th percentile latency from a histogram in PromQL (histogram_quantile)? [Basic]
- What is the difference between rate() and irate()? [Basic]
- How does Prometheus handle high cardinality, and why is it a problem? [Intermediate]
- What is PromQL, and what is an instant vector versus a range vector? [Basic]
- How does Prometheus storage (TSDB) work, and what is the retention model? [Intermediate]
- What is the Pushgateway, and why is it discouraged for most cases? [Basic]
- What is the difference between an exporter and instrumenting your app directly? [Basic]