Merge pull request #326 from teemow/master
Add resolved alerts to pushover template
This commit is contained in:
commit
4ed3b79640
|
@ -759,6 +759,7 @@ func (n *Pushover) Notify(ctx context.Context, as ...*types.Alert) error {
|
|||
message = message[:512-len(title)]
|
||||
log.With("incident", key).Debugf("Truncated message to %q due to Pushover message limit", message)
|
||||
}
|
||||
message = strings.TrimSpace(message)
|
||||
if message == "" {
|
||||
// Pushover rejects empty messages.
|
||||
message = "(no details)"
|
||||
|
|
|
@ -165,5 +165,13 @@ SOFTWARE.
|
|||
|
||||
{{ define "pushover.default.title" }}{{ template "__subject" . }}{{ end }}
|
||||
{{ define "pushover.default.message" }}{{ .CommonAnnotations.SortedPairs.Values | join " " }}
|
||||
{{ template "__text_alert_list" .Alerts.Firing }}{{ end }}
|
||||
{{ if gt (len .Alerts.Firing) 0 }}
|
||||
Alerts Firing:
|
||||
{{ template "__text_alert_list" .Alerts.Firing }}
|
||||
{{ end }}
|
||||
{{ if gt (len .Alerts.Resolved) 0 }}
|
||||
Alerts Resolved:
|
||||
{{ template "__text_alert_list" .Alerts.Resolved }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ define "pushover.default.url" }}{{ template "__alertmanagerURL" . }}{{ end }}
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue