Просмотр исходного кода

tech(alerting): adds tags to alerting data model

bergquist 9 лет назад
Родитель
Сommit
3827c0a69c
2 измененных файлов с 4 добавлено и 2 удалено
  1. 1 0
      pkg/services/alerting/conditions/query.go
  2. 3 2
      pkg/tsdb/models.go

+ 1 - 0
pkg/services/alerting/conditions/query.go

@@ -67,6 +67,7 @@ func (c *QueryCondition) Eval(context *alerting.EvalContext) (*alerting.Conditio
 			matches = append(matches, &alerting.EvalMatch{
 				Metric: series.Name,
 				Value:  reducedValue,
+				Tags:   series.Tags,
 			})
 		}
 	}

+ 3 - 2
pkg/tsdb/models.go

@@ -51,8 +51,9 @@ type QueryResult struct {
 }
 
 type TimeSeries struct {
-	Name   string           `json:"name"`
-	Points TimeSeriesPoints `json:"points"`
+	Name   string            `json:"name"`
+	Points TimeSeriesPoints  `json:"points"`
+	Tags   map[string]string `json:"tags"`
 }
 
 type TimePoint [2]null.Float