fix: label assignment issue in promql rules (#5920)

This commit is contained in:
Srikanth Chekuri 2024-09-11 11:49:25 +05:30 committed by GitHub
parent b60b26189f
commit 4799d3147b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -306,7 +306,11 @@ func (r *PromRule) String() string {
} }
func toCommonSeries(series promql.Series) v3.Series { func toCommonSeries(series promql.Series) v3.Series {
commonSeries := v3.Series{} commonSeries := v3.Series{
Labels: make(map[string]string),
LabelsArray: make([]map[string]string, 0),
Points: make([]v3.Point, 0),
}
for _, lbl := range series.Metric { for _, lbl := range series.Metric {
commonSeries.Labels[lbl.Name] = lbl.Value commonSeries.Labels[lbl.Name] = lbl.Value