Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
f8d1eb11
Commit
f8d1eb11
authored
Nov 07, 2016
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed ExecError state
parent
4b53ea0a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
17 deletions
+3
-17
pkg/services/alerting/notifiers/pagerduty.go
+1
-4
pkg/services/alerting/notifiers/pagerduty_test.go
+2
-4
public/app/features/alerting/partials/notification_edit.html
+0
-9
No files found.
pkg/services/alerting/notifiers/pagerduty.go
View file @
f8d1eb11
...
@@ -22,7 +22,6 @@ func NewPagerdutyNotifier(model *m.AlertNotification) (alerting.Notifier, error)
...
@@ -22,7 +22,6 @@ func NewPagerdutyNotifier(model *m.AlertNotification) (alerting.Notifier, error)
return
&
PagerdutyNotifier
{
return
&
PagerdutyNotifier
{
NotifierBase
:
NewNotifierBase
(
model
.
Id
,
model
.
IsDefault
,
model
.
Name
,
model
.
Type
,
model
.
Settings
),
NotifierBase
:
NewNotifierBase
(
model
.
Id
,
model
.
IsDefault
,
model
.
Name
,
model
.
Type
,
model
.
Settings
),
Key
:
key
,
Key
:
key
,
AlertOnExecError
:
model
.
Settings
.
Get
(
"alertOnExecError"
)
.
MustBool
(),
log
:
log
.
New
(
"alerting.notifier.pagerduty"
),
log
:
log
.
New
(
"alerting.notifier.pagerduty"
),
},
nil
},
nil
}
}
...
@@ -30,7 +29,6 @@ func NewPagerdutyNotifier(model *m.AlertNotification) (alerting.Notifier, error)
...
@@ -30,7 +29,6 @@ func NewPagerdutyNotifier(model *m.AlertNotification) (alerting.Notifier, error)
type
PagerdutyNotifier
struct
{
type
PagerdutyNotifier
struct
{
NotifierBase
NotifierBase
Key
string
Key
string
AlertOnExecError
bool
log
log
.
Logger
log
log
.
Logger
}
}
...
@@ -38,8 +36,7 @@ func (this *PagerdutyNotifier) Notify(evalContext *alerting.EvalContext) error {
...
@@ -38,8 +36,7 @@ func (this *PagerdutyNotifier) Notify(evalContext *alerting.EvalContext) error {
this
.
log
.
Info
(
"Notifying Pagerduty"
)
this
.
log
.
Info
(
"Notifying Pagerduty"
)
metrics
.
M_Alerting_Notification_Sent_PagerDuty
.
Inc
(
1
)
metrics
.
M_Alerting_Notification_Sent_PagerDuty
.
Inc
(
1
)
if
(
evalContext
.
Rule
.
State
==
m
.
AlertStateAlerting
)
||
if
evalContext
.
Rule
.
State
==
m
.
AlertStateAlerting
{
((
this
.
AlertOnExecError
)
&&
(
evalContext
.
Rule
.
State
==
m
.
AlertStateExecError
))
{
// Pagerduty Events API URL
// Pagerduty Events API URL
pgEventsUrl
:=
"https://events.pagerduty.com/generic/2010-04-15/create_event.json"
pgEventsUrl
:=
"https://events.pagerduty.com/generic/2010-04-15/create_event.json"
...
...
pkg/services/alerting/notifiers/pagerduty_test.go
View file @
f8d1eb11
...
@@ -26,11 +26,10 @@ func TestPagerdutyNotifier(t *testing.T) {
...
@@ -26,11 +26,10 @@ func TestPagerdutyNotifier(t *testing.T) {
So
(
err
,
ShouldNotBeNil
)
So
(
err
,
ShouldNotBeNil
)
})
})
Convey
(
"settings
with alertOnExecError
should trigger incident"
,
func
()
{
Convey
(
"settings should trigger incident"
,
func
()
{
json
:=
`
json
:=
`
{
{
"integrationKey": "abcdefgh0123456789",
"integrationKey": "abcdefgh0123456789"
"alertOnExecError": true
}`
}`
settingsJSON
,
_
:=
simplejson
.
NewJson
([]
byte
(
json
))
settingsJSON
,
_
:=
simplejson
.
NewJson
([]
byte
(
json
))
...
@@ -47,7 +46,6 @@ func TestPagerdutyNotifier(t *testing.T) {
...
@@ -47,7 +46,6 @@ func TestPagerdutyNotifier(t *testing.T) {
So
(
pagerdutyNotifier
.
Name
,
ShouldEqual
,
"pagerduty_testing"
)
So
(
pagerdutyNotifier
.
Name
,
ShouldEqual
,
"pagerduty_testing"
)
So
(
pagerdutyNotifier
.
Type
,
ShouldEqual
,
"pagerduty"
)
So
(
pagerdutyNotifier
.
Type
,
ShouldEqual
,
"pagerduty"
)
So
(
pagerdutyNotifier
.
Key
,
ShouldEqual
,
"abcdefgh0123456789"
)
So
(
pagerdutyNotifier
.
Key
,
ShouldEqual
,
"abcdefgh0123456789"
)
So
(
pagerdutyNotifier
.
AlertOnExecError
,
ShouldEqual
,
true
)
})
})
})
})
...
...
public/app/features/alerting/partials/notification_edit.html
View file @
f8d1eb11
...
@@ -103,15 +103,6 @@
...
@@ -103,15 +103,6 @@
<span
class=
"gf-form-label width-12"
>
Integration Key
</span>
<span
class=
"gf-form-label width-12"
>
Integration Key
</span>
<input
type=
"text"
required
class=
"gf-form-input max-width-30"
ng-model=
"ctrl.model.settings.integrationKey"
placeholder=
"Pagerduty integeration Key"
></input>
<input
type=
"text"
required
class=
"gf-form-input max-width-30"
ng-model=
"ctrl.model.settings.integrationKey"
placeholder=
"Pagerduty integeration Key"
></input>
</div>
</div>
<div
class=
"gf-form"
>
<gf-form-switch
class=
"gf-form"
label=
"Alert on Exec Error"
label-class=
"width-12"
checked=
"ctrl.model.settings.alertOnExecError"
tooltip=
"Trigger incident on Exec Error"
>
</gf-form-switch>
</div>
</div>
</div>
<div
class=
"gf-form-group"
>
<div
class=
"gf-form-group"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment