From f8d1eb11a9db7244fb87dd31fa61eb44569523bd Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Mon, 7 Nov 2016 07:12:43 -0800 Subject: [PATCH] Removed ExecError state --- pkg/services/alerting/notifiers/pagerduty.go | 5 +---- pkg/services/alerting/notifiers/pagerduty_test.go | 6 ++---- .../features/alerting/partials/notification_edit.html | 9 --------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/pkg/services/alerting/notifiers/pagerduty.go b/pkg/services/alerting/notifiers/pagerduty.go index f9b0af39602..198fe744018 100644 --- a/pkg/services/alerting/notifiers/pagerduty.go +++ b/pkg/services/alerting/notifiers/pagerduty.go @@ -22,7 +22,6 @@ func NewPagerdutyNotifier(model *m.AlertNotification) (alerting.Notifier, error) return &PagerdutyNotifier{ NotifierBase: NewNotifierBase(model.Id, model.IsDefault, model.Name, model.Type, model.Settings), Key: key, - AlertOnExecError: model.Settings.Get("alertOnExecError").MustBool(), log: log.New("alerting.notifier.pagerduty"), }, nil } @@ -30,7 +29,6 @@ func NewPagerdutyNotifier(model *m.AlertNotification) (alerting.Notifier, error) type PagerdutyNotifier struct { NotifierBase Key string - AlertOnExecError bool log log.Logger } @@ -38,8 +36,7 @@ func (this *PagerdutyNotifier) Notify(evalContext *alerting.EvalContext) error { this.log.Info("Notifying Pagerduty") metrics.M_Alerting_Notification_Sent_PagerDuty.Inc(1) - if (evalContext.Rule.State == m.AlertStateAlerting) || - ((this.AlertOnExecError) && (evalContext.Rule.State == m.AlertStateExecError)) { + if evalContext.Rule.State == m.AlertStateAlerting { // Pagerduty Events API URL pgEventsUrl := "https://events.pagerduty.com/generic/2010-04-15/create_event.json" diff --git a/pkg/services/alerting/notifiers/pagerduty_test.go b/pkg/services/alerting/notifiers/pagerduty_test.go index 76ae3ef963f..522bb133d77 100644 --- a/pkg/services/alerting/notifiers/pagerduty_test.go +++ b/pkg/services/alerting/notifiers/pagerduty_test.go @@ -26,11 +26,10 @@ func TestPagerdutyNotifier(t *testing.T) { So(err, ShouldNotBeNil) }) - Convey("settings with alertOnExecError should trigger incident", func() { + Convey("settings should trigger incident", func() { json := ` { - "integrationKey": "abcdefgh0123456789", - "alertOnExecError": true + "integrationKey": "abcdefgh0123456789" }` settingsJSON, _ := simplejson.NewJson([]byte(json)) @@ -47,7 +46,6 @@ func TestPagerdutyNotifier(t *testing.T) { So(pagerdutyNotifier.Name, ShouldEqual, "pagerduty_testing") So(pagerdutyNotifier.Type, ShouldEqual, "pagerduty") So(pagerdutyNotifier.Key, ShouldEqual, "abcdefgh0123456789") - So(pagerdutyNotifier.AlertOnExecError, ShouldEqual, true) }) }) diff --git a/public/app/features/alerting/partials/notification_edit.html b/public/app/features/alerting/partials/notification_edit.html index 904fd9df0e5..7ee96e60c8a 100644 --- a/public/app/features/alerting/partials/notification_edit.html +++ b/public/app/features/alerting/partials/notification_edit.html @@ -103,15 +103,6 @@ Integration Key -
- - -