|
|
|
@ -75,23 +75,18 @@ func TestAlertingRule(t *testing.T) {
|
|
|
|
|
}, { |
|
|
|
|
time: 5 * time.Minute, |
|
|
|
|
result: []string{ |
|
|
|
|
`{__name__="ALERTS", alertname="HTTPRequestRateLow", alertstate="pending", group="canary", instance="0", job="app-server", severity="critical"} => 0 @[%v]`, |
|
|
|
|
`{__name__="ALERTS", alertname="HTTPRequestRateLow", alertstate="firing", group="canary", instance="0", job="app-server", severity="critical"} => 1 @[%v]`, |
|
|
|
|
`{__name__="ALERTS", alertname="HTTPRequestRateLow", alertstate="pending", group="canary", instance="1", job="app-server", severity="critical"} => 0 @[%v]`, |
|
|
|
|
`{__name__="ALERTS", alertname="HTTPRequestRateLow", alertstate="firing", group="canary", instance="1", job="app-server", severity="critical"} => 1 @[%v]`, |
|
|
|
|
}, |
|
|
|
|
}, { |
|
|
|
|
time: 10 * time.Minute, |
|
|
|
|
result: []string{ |
|
|
|
|
`{__name__="ALERTS", alertname="HTTPRequestRateLow", alertstate="firing", group="canary", instance="0", job="app-server", severity="critical"} => 1 @[%v]`, |
|
|
|
|
`{__name__="ALERTS", alertname="HTTPRequestRateLow", alertstate="firing", group="canary", instance="1", job="app-server", severity="critical"} => 0 @[%v]`, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
time: 15 * time.Minute, |
|
|
|
|
result: []string{ |
|
|
|
|
`{__name__="ALERTS", alertname="HTTPRequestRateLow", alertstate="firing", group="canary", instance="0", job="app-server", severity="critical"} => 0 @[%v]`, |
|
|
|
|
}, |
|
|
|
|
time: 15 * time.Minute, |
|
|
|
|
result: []string{}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
time: 20 * time.Minute, |
|
|
|
@ -106,7 +101,6 @@ func TestAlertingRule(t *testing.T) {
|
|
|
|
|
{ |
|
|
|
|
time: 30 * time.Minute, |
|
|
|
|
result: []string{ |
|
|
|
|
`{__name__="ALERTS", alertname="HTTPRequestRateLow", alertstate="pending", group="canary", instance="0", job="app-server", severity="critical"} => 0 @[%v]`, |
|
|
|
|
`{__name__="ALERTS", alertname="HTTPRequestRateLow", alertstate="firing", group="canary", instance="0", job="app-server", severity="critical"} => 1 @[%v]`, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|