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
a23b7f13
Commit
a23b7f13
authored
Sep 14, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(alerting): add missing evaldata field to set state command
parent
31892ed7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
pkg/models/alert.go
+6
-4
pkg/services/alerting/result_handler.go
+5
-4
pkg/services/sqlstore/alert.go
+2
-0
No files found.
pkg/models/alert.go
View file @
a23b7f13
...
...
@@ -102,10 +102,12 @@ type SaveAlertsCommand struct {
}
type
SetAlertStateCommand
struct
{
AlertId
int64
OrgId
int64
State
AlertStateType
Error
string
AlertId
int64
OrgId
int64
State
AlertStateType
Error
string
EvalData
*
simplejson
.
Json
Timestamp
time
.
Time
}
...
...
pkg/services/alerting/result_handler.go
View file @
a23b7f13
...
...
@@ -54,10 +54,11 @@ func (handler *DefaultResultHandler) Handle(ctx *EvalContext) {
handler
.
log
.
Info
(
"New state change"
,
"alertId"
,
ctx
.
Rule
.
Id
,
"newState"
,
ctx
.
Rule
.
State
,
"oldState"
,
oldState
)
cmd
:=
&
m
.
SetAlertStateCommand
{
AlertId
:
ctx
.
Rule
.
Id
,
OrgId
:
ctx
.
Rule
.
OrgId
,
State
:
ctx
.
Rule
.
State
,
Error
:
exeuctionError
,
AlertId
:
ctx
.
Rule
.
Id
,
OrgId
:
ctx
.
Rule
.
OrgId
,
State
:
ctx
.
Rule
.
State
,
Error
:
exeuctionError
,
EvalData
:
annotationData
,
}
if
err
:=
bus
.
Dispatch
(
cmd
);
err
!=
nil
{
...
...
pkg/services/sqlstore/alert.go
View file @
a23b7f13
...
...
@@ -227,6 +227,8 @@ func SetAlertState(cmd *m.SetAlertStateCommand) error {
alert
.
State
=
cmd
.
State
alert
.
StateChanges
+=
1
alert
.
NewStateDate
=
time
.
Now
()
alert
.
EvalData
=
cmd
.
EvalData
if
cmd
.
Error
==
""
{
alert
.
ExecutionError
=
" "
//without this space, xorm skips updating this field
}
else
{
...
...
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