Feature for repeated alerting in grafana

This commit is contained in:
John Baublitz
2018-06-04 13:19:13 +02:00
committed by bergquist
parent f5cf926364
commit e068be4c26
10 changed files with 55 additions and 2 deletions
+4 -1
View File
@@ -32,7 +32,10 @@ func NewNotifierBase(id int64, isDefault bool, name, notifierType string, model
func defaultShouldNotify(context *alerting.EvalContext) bool {
// Only notify on state change.
if context.PrevAlertState == context.Rule.State {
if context.PrevAlertState == context.Rule.State && context.Rule.NotifyOnce {
return false
}
if !context.Rule.NotifyOnce && context.Rule.NotifyEval != 0 {
return false
}
// Do not notify when we become OK for the first time.