feat(alerting): working on alert notification and image rendering

This commit is contained in:
Torkel Ödegaard
2016-07-30 13:36:21 +02:00
parent f9ddfb4337
commit 2b276d5cd1
9 changed files with 128 additions and 50 deletions

View File

@@ -39,7 +39,7 @@ func NewEmailNotifier(model *m.AlertNotification) (alerting.Notifier, error) {
func (this *EmailNotifier) Notify(context *alerting.EvalContext) {
this.log.Info("Sending alert notification to", "addresses", this.Addresses)
ruleLink, err := getRuleLink(context.Rule)
ruleUrl, err := context.GetRuleUrl()
if err != nil {
this.log.Error("Failed get rule link", "error", err)
return
@@ -50,7 +50,7 @@ func (this *EmailNotifier) Notify(context *alerting.EvalContext) {
"RuleState": context.Rule.State,
"RuleName": context.Rule.Name,
"Severity": context.Rule.Severity,
"RuleLink": ruleLink,
"RuleUrl": ruleUrl,
},
To: this.Addresses,
Template: "alert_notification.html",