What does an alerting rule look like?
BeginnerConceptPromQL & Recording Rules
Answer
groups:
- name: api.alerts
rules:
- alert: APIHighErrorRate
expr: job:http_errors:ratio_rate5m{job="api"} > 0.05
for: 10m
keep_firing_for: 5m
labels:
severity: page
team: payments
annotations:
summary: "API error rate {{ $value | humanizePercentage }}"
runbook_url: "https://runbooks.example.com/api-errors"
labels drive routing in Alertmanager; annotations carry human text and links.
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