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
a4b0ccc1
Commit
a4b0ccc1
authored
Jul 24, 2019
by
Dima Kurguzov
Committed by
Torkel Ödegaard
Jul 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instrumentation: Add failed notifications metric (#18089)
parent
9ccf32be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletions
+12
-1
pkg/infra/metrics/metrics.go
+11
-1
pkg/services/alerting/notifier.go
+1
-0
No files found.
pkg/infra/metrics/metrics.go
View file @
a4b0ccc1
...
@@ -80,6 +80,9 @@ var (
...
@@ -80,6 +80,9 @@ var (
// MAlertingNotificationSent is a metric counter for how many alert notifications been sent
// MAlertingNotificationSent is a metric counter for how many alert notifications been sent
MAlertingNotificationSent
*
prometheus
.
CounterVec
MAlertingNotificationSent
*
prometheus
.
CounterVec
// MAlertingNotificationSent is a metric counter for how many alert notifications that failed
MAlertingNotificationFailed
*
prometheus
.
CounterVec
// MAwsCloudWatchGetMetricStatistics is a metric counter for getting metric statistics from aws
// MAwsCloudWatchGetMetricStatistics is a metric counter for getting metric statistics from aws
MAwsCloudWatchGetMetricStatistics
prometheus
.
Counter
MAwsCloudWatchGetMetricStatistics
prometheus
.
Counter
...
@@ -290,7 +293,13 @@ func init() {
...
@@ -290,7 +293,13 @@ func init() {
MAlertingNotificationSent
=
prometheus
.
NewCounterVec
(
prometheus
.
CounterOpts
{
MAlertingNotificationSent
=
prometheus
.
NewCounterVec
(
prometheus
.
CounterOpts
{
Name
:
"alerting_notification_sent_total"
,
Name
:
"alerting_notification_sent_total"
,
Help
:
"counter for how many alert notifications been sent"
,
Help
:
"counter for how many alert notifications have been sent"
,
Namespace
:
exporterName
,
},
[]
string
{
"type"
})
MAlertingNotificationFailed
=
prometheus
.
NewCounterVec
(
prometheus
.
CounterOpts
{
Name
:
"alerting_notification_failed_total"
,
Help
:
"counter for how many alert notifications have failed"
,
Namespace
:
exporterName
,
Namespace
:
exporterName
,
},
[]
string
{
"type"
})
},
[]
string
{
"type"
})
...
@@ -452,6 +461,7 @@ func initMetricVars() {
...
@@ -452,6 +461,7 @@ func initMetricVars() {
MApiDashboardInsert
,
MApiDashboardInsert
,
MAlertingResultState
,
MAlertingResultState
,
MAlertingNotificationSent
,
MAlertingNotificationSent
,
MAlertingNotificationFailed
,
MAwsCloudWatchGetMetricStatistics
,
MAwsCloudWatchGetMetricStatistics
,
MAwsCloudWatchListMetrics
,
MAwsCloudWatchListMetrics
,
MAwsCloudWatchGetMetricData
,
MAwsCloudWatchGetMetricData
,
...
...
pkg/services/alerting/notifier.go
View file @
a4b0ccc1
...
@@ -63,6 +63,7 @@ func (n *notificationService) sendAndMarkAsComplete(evalContext *EvalContext, no
...
@@ -63,6 +63,7 @@ func (n *notificationService) sendAndMarkAsComplete(evalContext *EvalContext, no
if
err
!=
nil
{
if
err
!=
nil
{
n
.
log
.
Error
(
"failed to send notification"
,
"uid"
,
notifier
.
GetNotifierUID
(),
"error"
,
err
)
n
.
log
.
Error
(
"failed to send notification"
,
"uid"
,
notifier
.
GetNotifierUID
(),
"error"
,
err
)
metrics
.
MAlertingNotificationFailed
.
WithLabelValues
(
notifier
.
GetType
())
.
Inc
()
}
}
if
evalContext
.
IsTestRun
{
if
evalContext
.
IsTestRun
{
...
...
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