mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Fix send resolved notifications (#54793)
This commit fixes a bug where we did not send resolved alerts to Alertmanager for resolved alert instances. This meant that resolved notifications did not have the annotations from the resolved state, and a result did not also have the resolved screenshot.
This commit is contained in:
@@ -71,25 +71,14 @@ func TestNeedsSending(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "state: normal + resolved sends after a minute",
|
||||
name: "state: normal + resolved should send without waiting",
|
||||
resendDelay: 1 * time.Minute,
|
||||
expected: true,
|
||||
testState: &State{
|
||||
State: eval.Normal,
|
||||
Resolved: true,
|
||||
LastEvaluationTime: evaluationTime,
|
||||
LastSentAt: evaluationTime.Add(-1 * time.Minute),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "state: normal + resolved does _not_ send after 30 seconds (before one minute)",
|
||||
resendDelay: 1 * time.Minute,
|
||||
expected: false,
|
||||
testState: &State{
|
||||
State: eval.Normal,
|
||||
Resolved: true,
|
||||
LastEvaluationTime: evaluationTime,
|
||||
LastSentAt: evaluationTime.Add(-30 * time.Second),
|
||||
LastSentAt: evaluationTime,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user