Alerting: Fix stale values associated with states that have gone to NoData, unify values calculation (#89807)

* Unify values

* Fix with latest changes on main

* Fix up NaN test

* Keep refIDs with -1 as value

* Test that refIDs are preserved on Normal to Error transition

* Alerting to err test too

* Add a blurb to docs about this behavior
This commit is contained in:
Alexander Weaver
2024-07-08 12:30:23 -05:00
committed by GitHub
parent f763f2085b
commit 3b6a8775bb
11 changed files with 209 additions and 82 deletions
@@ -269,6 +269,8 @@ You can also configure the alert instance state when its evaluation returns an e
| Normal | Sets alert instance state to `Normal`. |
| Keep Last State | Maintains the alert instance in its last state. Useful for mitigating temporary issues, refer to [Keep last state](ref:keep-last-state). |
When you configure the No data or Error behavior to `Alerting` or `Normal`, Grafana will attempt to keep a stable set of fields under notification `Values`. If your query returns no data or an error, Grafana re-uses the latest known set of fields in `Values`, but will use `-1` in place of the measured value.
## Create alerts from panels
Create alerts from any panel type. This means you can reuse the queries in the panel and create alerts based on them.