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
2d3a5754
Commit
2d3a5754
authored
Nov 02, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds db migration for debounce_duration
parent
ccfd9c89
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
pkg/models/alert.go
+3
-2
pkg/services/alerting/rule.go
+1
-1
pkg/services/sqlstore/migrations/alert_mig.go
+4
-0
No files found.
pkg/models/alert.go
View file @
2d3a5754
...
...
@@ -66,12 +66,13 @@ type Alert struct {
PanelId
int64
Name
string
Message
string
Severity
string
Severity
string
//Unused
State
AlertStateType
Handler
int64
Handler
int64
//Unused
Silenced
bool
ExecutionError
string
Frequency
int64
DebounceDuration
time
.
Duration
EvalData
*
simplejson
.
Json
NewStateDate
time
.
Time
...
...
pkg/services/alerting/rule.go
View file @
2d3a5754
...
...
@@ -104,7 +104,7 @@ func NewRuleFromDBAlert(ruleDef *m.Alert) (*Rule, error) {
model
.
Frequency
=
ruleDef
.
Frequency
model
.
State
=
ruleDef
.
State
model
.
LastStateChange
=
ruleDef
.
NewStateDate
model
.
DebounceDuration
=
time
.
Minute
*
2
// hard coded for now
model
.
DebounceDuration
=
time
.
Duration
(
ruleDef
.
DebounceDuration
)
model
.
NoDataState
=
m
.
NoDataOption
(
ruleDef
.
Settings
.
Get
(
"noDataState"
)
.
MustString
(
"no_data"
))
model
.
ExecutionErrorState
=
m
.
ExecutionErrorOption
(
ruleDef
.
Settings
.
Get
(
"executionErrorState"
)
.
MustString
(
"alerting"
))
model
.
StateChanges
=
ruleDef
.
StateChanges
...
...
pkg/services/sqlstore/migrations/alert_mig.go
View file @
2d3a5754
...
...
@@ -133,4 +133,8 @@ func addAlertMigrations(mg *Migrator) {
mg
.
AddMigration
(
"create alert_notification_state table v1"
,
NewAddTableMigration
(
alert_notification_state
))
mg
.
AddMigration
(
"add index alert_notification_state org_id & alert_id & notifier_id"
,
NewAddIndexMigration
(
alert_notification_state
,
alert_notification_state
.
Indices
[
0
]))
mg
.
AddMigration
(
"Add decounce_duration to alert table"
,
NewAddColumnMigration
(
alertV1
,
&
Column
{
Name
:
"debounce_duration"
,
Type
:
DB_BigInt
,
Nullable
:
true
,
}))
}
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