Merge pull request #342 from prometheus/optional-alertmanager

Drop notifications when no alert manager URL is configured.
This commit is contained in:
juliusv 2013-07-30 15:49:11 -07:00
commit 89797e08eb

View file

@ -98,6 +98,9 @@ func (n *NotificationHandler) sendNotifications(reqs rules.NotificationReqs) err
// Continusouly dispatch notifications.
func (n *NotificationHandler) Run() {
for reqs := range n.pendingNotifications {
if n.alertmanagerUrl == "" {
log.Println("No alert manager configured, not dispatching notification")
}
if err := n.sendNotifications(reqs); err != nil {
log.Println("Error sending notification:", err)
}