diff --git a/docs/sources/alerting/fundamentals/alert-rules/state-and-health.md b/docs/sources/alerting/fundamentals/alert-rules/state-and-health.md index 3e067eadf0f..b47bf5ff18d 100644 --- a/docs/sources/alerting/fundamentals/alert-rules/state-and-health.md +++ b/docs/sources/alerting/fundamentals/alert-rules/state-and-health.md @@ -7,6 +7,7 @@ description: Learn about the state and health of alert rules to understand sever keywords: - grafana - alerting + - keep last state - guide - state labels: @@ -50,15 +51,20 @@ An alert instance can be in either of the following states: | **NoData** | No data has been received for the configured time window. | | **Error** | The error that occurred when attempting to evaluate an alert rule. | +## 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. + ## Alert rule health An alert rule can have one the following health statuses: -| State | Description | -| ---------- | ---------------------------------------------------------------------------------- | -| **Ok** | No error when evaluating an alert rule. | -| **Error** | An error occurred when evaluating an alert rule. | -| **NoData** | The absence of data in at least one time series returned during a rule evaluation. | +| 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. | ## Special alerts for `NoData` and `Error` diff --git a/docs/sources/alerting/manage-notifications/view-state-health.md b/docs/sources/alerting/manage-notifications/view-state-health.md index 96f4b327569..0a376099295 100644 --- a/docs/sources/alerting/manage-notifications/view-state-health.md +++ b/docs/sources/alerting/manage-notifications/view-state-health.md @@ -6,6 +6,7 @@ description: View the state and health of alert rules keywords: - grafana - alert rules + - keep last state - guide - state - health @@ -56,15 +57,20 @@ An alert instance can be in either of the following states: | **NoData** | No data has been received for the configured time window. | | **Error** | The error that occurred when attempting to evaluate an alerting rule. | +## 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. + ## Alert rule health An alert rule can have one the following health statuses: -| 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. | +| 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. | ## Special alerts for `NoData` and `Error` @@ -76,7 +82,7 @@ When evaluation of an alerting rule produces state `NoData` or `Error`, Grafana | **datasource_uid** | The UID of the data source that caused the state. | {{% admonition type="note" %}} -You will need to set the No Data and Error Handling to `No Data` or `Error` in the alert rule as per this doc: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-grafana-managed-rule/#configure-no-data-and-error-handling in order to generate the additional labels. +You will need to set the No Data and Error Handling to `No Data` or `Error` in the alert rule as per this doc: in order to generate the additional labels. {{% /admonition %}} You can handle these alerts the same way as regular alerts by adding a silence, route to a contact point, and so on.