Revert changes post code review and move them to notification page

This commit is contained in:
John Baublitz
2018-05-19 16:21:00 -04:00
committed by bergquist
parent e068be4c26
commit 3cb0e27e1c
34 changed files with 215 additions and 107 deletions

View File

@@ -66,7 +66,17 @@ func (n *notificationService) sendNotifications(context *EvalContext, notifiers
not := notifier //avoid updating scope variable in go routine
n.log.Debug("Sending notification", "type", not.GetType(), "id", not.GetNotifierId(), "isDefault", not.GetIsDefault())
metrics.M_Alerting_Notification_Sent.WithLabelValues(not.GetType()).Inc()
g.Go(func() error { return not.Notify(context) })
g.Go(func() error {
success := not.Notify(context) == nil
cmd := &m.RecordNotificationJournalCommand{
OrgId: context.Rule.OrgId,
AlertId: context.Rule.Id,
NotifierId: not.GetNotifierId(),
SentAt: time.Now(),
Success: success,
}
return bus.Dispatch(cmd)
})
}
return g.Wait()