diff --git a/config/notifiers.go b/config/notifiers.go index d79c8b5057..698c4e3b5d 100644 --- a/config/notifiers.go +++ b/config/notifiers.go @@ -78,6 +78,7 @@ var ( Description: `{{ template "pagerduty.default.description" .}}`, Client: `{{ template "pagerduty.default.client" . }}`, ClientURL: `{{ template "pagerduty.default.clientURL" . }}`, + Severity: `{{ template "pagerduty.default.severity" . }}`, } // DefaultSlackConfig defines default values for Slack configurations. diff --git a/template/default.tmpl b/template/default.tmpl index 8b2bb7470e..497941b856 100644 --- a/template/default.tmpl +++ b/template/default.tmpl @@ -38,6 +38,7 @@ Source: {{ .GeneratorURL }} {{ define "pagerduty.default.client" }}{{ template "__alertmanager" . }}{{ end }} {{ define "pagerduty.default.clientURL" }}{{ template "__alertmanagerURL" . }}{{ end }} {{ define "pagerduty.default.instances" }}{{ template "__text_alert_list" . }}{{ end }} +{{ define "pagerduty.default.severity" }}{{ if .CommonLabels.severity }}{{ .CommonLabels.severity | toLower }}{{ else }}{{ printf "error" }}{{ end }}{{ end }} {{ define "opsgenie.default.message" }}{{ template "__subject" . }}{{ end }}