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
66c25942
Commit
66c25942
authored
Jun 11, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(alerting): sql update fixes
parent
71c1c0ab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
pkg/services/alerting/commands.go
+3
-2
pkg/services/alerting/executor.go
+1
-1
pkg/services/sqlstore/alert.go
+2
-0
No files found.
pkg/services/alerting/commands.go
View file @
66c25942
...
...
@@ -19,8 +19,9 @@ func init() {
func
updateDashboardAlerts
(
cmd
*
UpdateDashboardAlertsCommand
)
error
{
saveAlerts
:=
m
.
SaveAlertsCommand
{
OrgId
:
cmd
.
OrgId
,
UserId
:
cmd
.
UserId
,
OrgId
:
cmd
.
OrgId
,
UserId
:
cmd
.
UserId
,
DashboardId
:
cmd
.
Dashboard
.
Id
,
}
extractor
:=
NewDashAlertExtractor
(
cmd
.
Dashboard
,
cmd
.
OrgId
)
...
...
pkg/services/alerting/executor.go
View file @
66c25942
...
...
@@ -69,7 +69,7 @@ func (e *ExecutorImpl) executeQuery(job *AlertJob) (tsdb.TimeSeriesSlice, error)
}
func
(
e
*
ExecutorImpl
)
GetRequestForAlertRule
(
rule
*
AlertRule
,
datasource
*
m
.
DataSource
)
*
tsdb
.
Request
{
log
.
Debug2
(
"GetRequest"
,
"query"
,
rule
.
Query
.
Query
,
"from"
,
rule
.
Query
.
From
,
"datasourceId"
,
datasource
.
Id
)
e
.
log
.
Debug
(
"GetRequest"
,
"query"
,
rule
.
Query
.
Query
,
"from"
,
rule
.
Query
.
From
,
"datasourceId"
,
datasource
.
Id
)
req
:=
&
tsdb
.
Request
{
TimeRange
:
tsdb
.
TimeRange
{
From
:
"-"
+
rule
.
Query
.
From
,
...
...
pkg/services/sqlstore/alert.go
View file @
66c25942
...
...
@@ -184,6 +184,7 @@ func upsertAlerts(alerts []*m.Alert, posted []*m.Alert, sess *xorm.Session) erro
update
=
true
alert
.
Id
=
k
.
Id
alertToUpdate
=
k
break
}
}
...
...
@@ -224,6 +225,7 @@ func deleteMissingAlerts(alerts []*m.Alert, posted []*m.Alert, sess *xorm.Sessio
for
_
,
k
:=
range
posted
{
if
missingAlert
.
PanelId
==
k
.
PanelId
{
missing
=
false
break
}
}
...
...
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