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:
George Robinson
2022-09-15 17:25:05 +01:00
committed by GitHub
parent 099d3cdf72
commit 5561f935e6
2 changed files with 12 additions and 17 deletions

View File

@@ -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,
},
},
{