From d0360de8f1d039576687eb9b6abe2addd58fcad8 Mon Sep 17 00:00:00 2001 From: Zach Bagnall Date: Tue, 24 Dec 2019 00:32:05 -0700 Subject: [PATCH] Alerting: Add configurable severity support for PagerDuty notifier (#19425) * Pagerduty notifier: configurable severity Instead of hardcoding `critical` make it configurable per notification channel instance. * fix html * Add a test to ensure default severity is correct * Notifications doc * Add a non-default test * Add err check on NewJson (all tests) * Add default severity (critical) to AlertNotificationEditCtrl class --- docs/sources/alerting/notifications.md | 1 + pkg/services/alerting/notifiers/pagerduty.go | 15 ++++++- .../alerting/notifiers/pagerduty_test.go | 40 ++++++++++++++++--- .../alerting/NotificationsEditCtrl.ts | 1 + 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/docs/sources/alerting/notifications.md b/docs/sources/alerting/notifications.md index fe7dba957d4..7493ffccbae 100644 --- a/docs/sources/alerting/notifications.md +++ b/docs/sources/alerting/notifications.md @@ -100,6 +100,7 @@ To set up PagerDuty, all you have to do is to provide an API key. Setting | Description ---------- | ----------- Integration Key | Integration key for PagerDuty. +Severity | Level for dynamic notifications, default is `critical` Auto resolve incidents | Resolve incidents in PagerDuty once the alert goes back to ok ### Webhook diff --git a/pkg/services/alerting/notifiers/pagerduty.go b/pkg/services/alerting/notifiers/pagerduty.go index 9fe27f67b4c..14548de9c98 100644 --- a/pkg/services/alerting/notifiers/pagerduty.go +++ b/pkg/services/alerting/notifiers/pagerduty.go @@ -24,6 +24,16 @@ func init() { Integration Key +
+ Severity +
+ +
+