Use it when alerts are defined in Grafana instead of Prometheus/Alertmanager.
Grafana Alerting
Grafana Alerting evaluates alert rules over any data source and sends notifications through contact points and notification policies.
1. Rules state: Alerting → Alert rules, or curl -s http://grafana/api/prometheus/grafana/api/v1/rules.
2. No-data/error state handling.
3. Notification policy routing.
4. Contact point test.
5. Rules provisioned.
rule query → condition → state → notification policy → contact point
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 How to verify Verify boundary
Trigger a test alert and confirm it reaches the right channel. Review rules that are always firing or never fire.
Step 2 Common failures Narrow the fault
A rule with "no data" handling set wrongly fires on every data source glitch. Policies that never match labels send alerts to the default contact point. Provisioned rules edited in the UI are overwritten.
Choose one alerting system per signal to avoid duplicates. Provision rules as code. Configure no-data and error handling explicitly.
curl -s http://grafana/api/prometheus/grafana/api/v1/rules— first check for this topiccurl -s localhost:9090/-/ready— Prometheus readycurl -s 'localhost:9090/api/v1/query?query=up'— scrape targets up/downpromtool check config prometheus.yml— config valid
ReferenceWhat it is1 section · depth on demand
How it works
The alerting engine runs rules in evaluation groups. Firing alerts are sent to the built-in Alertmanager or an external one, which groups, deduplicates and routes them.
ReferenceImportant terms & boundaries3 sections · depth on demand
Alert structure
| Part | Purpose |
|---|---|
| Query + condition | What is evaluated and the threshold |
| Pending period ("for") | Ignore short spikes |
| Labels | Routing (team, severity) |
| Annotations | Summary, description, runbook URL, dashboard link |
| Contact points & notification policies | Where and how notifications go |
Test alerts with real data, and handle "No data" and "Error" states deliberately (alert, OK or keep last state).
In depth
From rule to notification
alert rule (query + expressions + condition, evaluated every interval)
→ pending for "pending period" → firing
→ labels matched by the notification policy tree
→ contact point (e-mail, Slack, PagerDuty, webhook …)
Parts of a rule
| Part | Set to |
|---|---|
| Query | The data, e.g. error ratio per service |
| Expressions | Reduce (last, mean) and threshold, or math across queries |
| Evaluation group + interval | Rules evaluated together, e.g. every 1 m |
| Pending period | How long the condition must hold (e.g. 5 m) to fire |
| Labels | severity, team, service — used by notification policies |
| Annotations | Summary, description, runbook URL, dashboard link |
| No data / error handling | What to do when the query returns nothing or fails |
No data and error states
| Setting | Effect | Use when |
|---|---|---|
NoData | Fires a separate "no data" alert | Missing data is itself a problem (heartbeat) |
Alerting | Treat as firing | Conservative for critical signals |
OK / Normal | Treat as healthy | Sparse metrics that are often absent |
KeepLast | Keep last state | Short gaps in otherwise steady data |
Getting this wrong is the main source of alerts that fire on every data source hiccup — or never fire when an exporter dies.
Notification policies
Policies form a tree matched by labels; the first matching child wins unless continue matching is enabled. Group by alertname plus the labels that identify one incident (service, cluster), and use mute timings for planned quiet periods instead of disabling rules.
Provisioning
Define rules, contact points and policies as code (file provisioning, Terraform or the alerting API) so a rule changed in the UI does not silently differ from what is in Git.
Common mistakes
- Alerts defined in several places.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.