From 72e23bca5f23c3616ca709fecefd0b498bc94131 Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 16 Jun 2016 08:56:19 +0200 Subject: [PATCH] tech(alerting): improve/cleanup logging --- pkg/services/alerting/notifier.go | 4 ---- pkg/services/notifications/webhook.go | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/pkg/services/alerting/notifier.go b/pkg/services/alerting/notifier.go index b2374b2c125..6e31fed7db3 100644 --- a/pkg/services/alerting/notifier.go +++ b/pkg/services/alerting/notifier.go @@ -19,14 +19,11 @@ func NewNotifier() *NotifierImpl { } func (n *NotifierImpl) Notify(alertResult *AlertResult) { - n.log.Warn("LETS NOTIFY!!!!A") notifiers := n.getNotifiers(alertResult.AlertJob.Rule.OrgId, []int64{1, 2}) for _, notifier := range notifiers { - warn := alertResult.State == alertstates.Warn && notifier.SendWarning crit := alertResult.State == alertstates.Critical && notifier.SendCritical - n.log.Warn("looopie", "warn", warn, "crit", crit) if warn || crit { n.log.Info("Sending notification", "state", alertResult.State, "type", notifier.Type) go notifier.Notifierr.Dispatch(alertResult) @@ -100,7 +97,6 @@ func (n *NotifierImpl) getNotifiers(orgId int64, notificationGroups []int64) []* var result []*Notification - n.log.Warn("query result", "length", len(query.Result)) for _, notification := range query.Result { not, err := NewNotificationFromDBModel(notification) if err == nil { diff --git a/pkg/services/notifications/webhook.go b/pkg/services/notifications/webhook.go index 11a8839fbc8..1696d771387 100644 --- a/pkg/services/notifications/webhook.go +++ b/pkg/services/notifications/webhook.go @@ -32,15 +32,13 @@ func processWebhookQueue() { err := sendWebRequest(webhook) if err != nil { - webhookLog.Error("Failed to send webrequest ") + webhookLog.Error("Failed to send webrequest ", "error", err) } } } } func sendWebRequest(webhook *Webhook) error { - webhookLog.Error("Sending stuff! ", "url", webhook.Url) - client := http.Client{ Timeout: time.Duration(3 * time.Second), }