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
4e1f801f
Commit
4e1f801f
authored
May 31, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(alerting): add serie name to failed alert description
parent
76758d27
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
8 deletions
+5
-8
pkg/models/alerts.go
+1
-0
pkg/services/alerting/alerting.go
+1
-7
pkg/services/alerting/executor.go
+3
-1
No files found.
pkg/models/alerts.go
View file @
4e1f801f
...
...
@@ -122,5 +122,6 @@ type AlertResult struct {
State
string
ActualValue
float64
Duration
float64
Description
string
Rule
AlertRule
}
pkg/services/alerting/alerting.go
View file @
4e1f801f
...
...
@@ -3,7 +3,6 @@ package alerting
import
(
"time"
"fmt"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/log"
m
"github.com/grafana/grafana/pkg/models"
...
...
@@ -103,12 +102,7 @@ func (this *Scheduler) HandleResponses() {
cmd
:=
m
.
UpdateAlertStateCommand
{
AlertId
:
response
.
Id
,
NewState
:
response
.
State
,
}
if
cmd
.
NewState
!=
m
.
AlertStateOk
{
cmd
.
Info
=
fmt
.
Sprintf
(
"Actual value: %1.2f"
,
response
.
ActualValue
)
}
else
{
cmd
.
Info
=
"Alert is OK!"
Info
:
response
.
Description
,
}
if
err
:=
bus
.
Dispatch
(
&
cmd
);
err
!=
nil
{
...
...
pkg/services/alerting/executor.go
View file @
4e1f801f
...
...
@@ -102,6 +102,7 @@ func (this *ExecutorImpl) ValidateRule(rule m.AlertRule, series m.TimeSeriesSlic
State
:
m
.
AlertStateCritical
,
Id
:
rule
.
Id
,
ActualValue
:
aggValue
,
Description
:
fmt
.
Sprintf
(
"Actual value: %1.2f for %s"
,
aggValue
,
serie
.
Name
),
Rule
:
rule
,
}
}
...
...
@@ -110,11 +111,12 @@ func (this *ExecutorImpl) ValidateRule(rule m.AlertRule, series m.TimeSeriesSlic
return
&
m
.
AlertResult
{
State
:
m
.
AlertStateWarn
,
Id
:
rule
.
Id
,
Description
:
fmt
.
Sprintf
(
"Actual value: %1.2f for %s"
,
aggValue
,
serie
.
Name
),
ActualValue
:
aggValue
,
Rule
:
rule
,
}
}
}
return
&
m
.
AlertResult
{
State
:
m
.
AlertStateOk
,
Id
:
rule
.
Id
,
Rule
:
rule
}
return
&
m
.
AlertResult
{
State
:
m
.
AlertStateOk
,
Id
:
rule
.
Id
,
Rule
:
rule
,
Description
:
"Alert is OK!"
}
}
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