Commit 777c1024 by Corentin Chary

alertmanager: if there are no alerts to send, do nothing

parent eef01e37
......@@ -78,6 +78,10 @@ func (this *AlertmanagerNotifier) Notify(evalContext *alerting.EvalContext) erro
alerts = append(alerts, alertJSON)
}
if len(alerts) == 0 {
return nil
}
bodyJSON := simplejson.NewFromAny(alerts)
body, _ := bodyJSON.MarshalJSON()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment