[v10.2.x] Alerting: Fix NoData & Error alerts not resolving when rule is reset (#80241)
Alerting: Fix NoData & Error alerts not resolving when rule is reset (#80184)
* Alerting: Fix NoData & Error alerts not resolving when rule is reset
On rule reset, when creating the PostableAlerts StateToPostableAlert did not
attach the correct NoData/Error alertname and rulename labels to expire/resolve
the active alerts when the previous cached state was NoData/Error.
(cherry picked from commit 1d4419fbe4)
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
This commit is contained in:
co-authored by
Matthew Jacobson
parent
715aaed12c
commit
e6a70ccf9a
@@ -105,7 +105,7 @@ func (srv TestingApiSrv) RouteTestGrafanaRuleConfig(c *contextmodel.ReqContext,
|
||||
|
||||
alerts := make([]*amv2.PostableAlert, 0, len(transitions))
|
||||
for _, alertState := range transitions {
|
||||
alerts = append(alerts, state.StateToPostableAlert(alertState.State, srv.appUrl))
|
||||
alerts = append(alerts, state.StateToPostableAlert(alertState, srv.appUrl))
|
||||
}
|
||||
|
||||
return response.JSON(http.StatusOK, alerts)
|
||||
|
||||
Reference in New Issue
Block a user