Alerting: Add tags to alert rules (#10989)

Ref #6552
This commit is contained in:
Thibault Chataigner
2019-06-06 13:29:30 +02:00
committed by Carl Bergquist
parent 34f314552d
commit e06abb30aa
13 changed files with 201 additions and 70 deletions

View File

@@ -35,6 +35,7 @@ type Rule struct {
State models.AlertStateType
Conditions []Condition
Notifications []string
AlertRuleTags []*models.Tag
StateChanges int64
}
@@ -145,6 +146,7 @@ func NewRuleFromDBAlert(ruleDef *models.Alert) (*Rule, error) {
model.Notifications = append(model.Notifications, uid)
}
}
model.AlertRuleTags = ruleDef.GetTagsFromSettings()
for index, condition := range ruleDef.Settings.Get("conditions").MustArray() {
conditionModel := simplejson.NewFromAny(condition)