2022-05-26 23:06:25 +08:00
---
aliases:
2024-03-14 23:58:18 +08:00
- ../../fundamentals/state-and-health/ # /docs/grafana/< GRAFANA_VERSION > /alerting/fundamentals/state-and-health/
- ../../unified-alerting/alerting-rules/state-and-health/ # /docs/grafana/< GRAFANA_VERSION > /alerting/unified-alerting/alerting-rules/state-and-health
2023-07-18 18:29:00 +08:00
canonical: https://grafana.com/docs/grafana/latest/alerting/fundamentals/alert-rules/state-and-health/
2023-12-12 18:26:36 +08:00
description: Learn about the state and health of alert rules to understand several key status indicators about your alerts
2022-05-26 23:06:25 +08:00
keywords:
- grafana
- alerting
2024-03-21 01:11:16 +08:00
- keep last state
2022-05-26 23:06:25 +08:00
- guide
- state
Explicitly set all front matter labels in the source files (#71548)
* Set every page to have defaults of 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration pages to have of 'Cloud', 'Enterprise', and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/enterprise-licensing pages to have 'Enterprise' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/organization-management pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/provisioning pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/recorded-queries pages to have labels cloud,enterprise
* Set administration/roles-and-permissions/access-control pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/stats-and-license pages to have labels cloud,enterprise
* Set alerting pages to have labels cloud,enterprise,oss
* Set breaking-changes pages to have labels cloud,enterprise,oss
* Set dashboards pages to have labels cloud,enterprise,oss
* Set datasources pages to have labels cloud,enterprise,oss
* Set explore pages to have labels cloud,enterprise,oss
* Set fundamentals pages to have labels cloud,enterprise,oss
* Set introduction/grafana-cloud pages to have labels cloud
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix introduction pages products
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set panels-visualizations pages to have labels cloud,enterprise,oss
* Set release-notes pages to have labels cloud,enterprise,oss
* Set search pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/audit-grafana pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-authentication pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/configure-authentication/enhanced-ldap pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-authentication/saml pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-request-security pages to have labels cloud,enterprise,oss
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-team-sync pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/export-logs pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set troubleshooting pages to have labels cloud,enterprise,oss
* Set whatsnew pages to have labels cloud,enterprise,oss
* Apply updated labels from review
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-07-18 16:10:12 +08:00
labels:
products:
- cloud
- enterprise
- oss
2024-02-07 18:04:13 +08:00
title: State and health of alert rules
2024-03-14 23:58:18 +08:00
weight: 109
2022-05-26 23:06:25 +08:00
---
2021-10-28 04:57:54 +08:00
2024-02-07 18:04:13 +08:00
# State and health of alert rules
2021-10-28 04:57:54 +08:00
2024-02-07 18:04:13 +08:00
The state and health of alert rules help you understand several key status indicators about your alerts.
2021-10-28 04:57:54 +08:00
2022-05-24 23:31:57 +08:00
There are three key components: [alert rule state ](#alert-rule-state ), [alert instance state ](#alert-instance-state ), and [alert rule health ](#alert-rule-health ). Although related, each component conveys subtly different information.
2021-10-28 04:57:54 +08:00
2022-05-24 23:31:57 +08:00
## Alert rule state
2021-10-28 04:57:54 +08:00
2022-05-24 23:31:57 +08:00
An alert rule can be in either of the following states:
2021-10-28 04:57:54 +08:00
2024-03-21 18:06:49 +08:00
| State | Description |
| ----------- | -------------------------------------------------------------------------------------------------- |
| **Normal** | None of the alert instances returned by the evaluation engine is in a `Pending` or `Firing` state. |
| **Pending** | At least one alert instances returned by the evaluation engine is `Pending` . |
| **Firing** | At least one alert instances returned by the evaluation engine is `Firing` . |
The alert rule state is determined by the “worst case” state of the alert instances produced. For example, if one alert instance is firing, the alert rule state will also be firing.
2021-10-28 04:57:54 +08:00
2023-05-23 04:45:28 +08:00
{{% admonition type="note" %}}
Alerts will transition first to `pending` and then `firing` , thus it will take at least two evaluation cycles before an alert is fired.
{{% /admonition %}}
2021-10-28 04:57:54 +08:00
2022-05-24 23:31:57 +08:00
## Alert instance state
An alert instance can be in either of the following states:
| State | Description |
| ------------ | --------------------------------------------------------------------------------------------- |
| **Normal** | The state of an alert that is neither firing nor pending, everything is working correctly. |
| **Pending** | The state of an alert that has been active for less than the configured threshold duration. |
| **Alerting** | The state of an alert that has been active for longer than the configured threshold duration. |
| **NoData** | No data has been received for the configured time window. |
2024-02-07 18:04:13 +08:00
| **Error** | The error that occurred when attempting to evaluate an alert rule. |
2022-05-24 23:31:57 +08:00
2024-03-21 01:11:16 +08:00
## Keep last state
An alert rule can be configured to keep the last state when a `NoData` and/or `Error` state is encountered. This will both prevent alerts from firing, and from resolving and re-firing. Just like normal evaluation, the alert rule will transition from `Pending` to `Firing` after the pending period has elapsed.
2022-05-24 23:31:57 +08:00
## Alert rule health
An alert rule can have one the following health statuses:
2024-03-21 01:11:16 +08:00
| State | Description |
| ---------------------- | -------------------------------------------------------------------------------------------------------- |
| **Ok** | No error when evaluating an alerting rule. |
| **Error** | An error occurred when evaluating an alerting rule. |
| **NoData** | The absence of data in at least one time series returned during a rule evaluation. |
| ** {status}, KeepLast** | The rule would have received another status but was configured to keep the last state of the alert rule. |
2022-05-24 23:31:57 +08:00
## Special alerts for `NoData` and `Error`
2024-02-07 18:04:13 +08:00
When evaluation of an alert rule produces state `NoData` or `Error` , Grafana Alerting will generate alert instances that have the following additional labels:
2022-05-24 23:31:57 +08:00
| Label | Description |
| ------------------ | ---------------------------------------------------------------------- |
| **alertname** | Either `DatasourceNoData` or `DatasourceError` depending on the state. |
| **datasource_uid** | The UID of the data source that caused the state. |
You can handle these alerts the same way as regular alerts by adding a silence, route to a contact point, and so on.