feat(alerting): progress on handling no data in alert query, #5860

This commit is contained in:
Torkel Ödegaard
2016-09-06 20:40:12 +02:00
parent b1ed641d73
commit fbae6abb3c
18 changed files with 93 additions and 59 deletions
+2
View File
@@ -18,6 +18,7 @@ type Rule struct {
Frequency int64
Name string
Message string
NoDataState m.AlertStateType
State m.AlertStateType
Severity m.AlertSeverityType
Conditions []Condition
@@ -67,6 +68,7 @@ func NewRuleFromDBAlert(ruleDef *m.Alert) (*Rule, error) {
model.Frequency = ruleDef.Frequency
model.Severity = ruleDef.Severity
model.State = ruleDef.State
model.NoDataState = m.AlertStateType(ruleDef.Settings.Get("noDataState").MustString("unknown"))
for _, v := range ruleDef.Settings.Get("notifications").MustArray() {
jsonModel := simplejson.NewFromAny(v)