mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
alertmanager: if there are no alerts to send, do nothing
This commit is contained in:
parent
eef01e3703
commit
777c1024c9
@ -78,6 +78,10 @@ func (this *AlertmanagerNotifier) Notify(evalContext *alerting.EvalContext) erro
|
|||||||
alerts = append(alerts, alertJSON)
|
alerts = append(alerts, alertJSON)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(alerts) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
bodyJSON := simplejson.NewFromAny(alerts)
|
bodyJSON := simplejson.NewFromAny(alerts)
|
||||||
body, _ := bodyJSON.MarshalJSON()
|
body, _ := bodyJSON.MarshalJSON()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user