Skip to content

Commit cdb24bd

Browse files
committed
Ensure sorting of series labels during creation
1 parent 93ee06d commit cdb24bd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/querier/series_set.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,8 @@ func metricToLabels(m model.Metric) labels.Labels {
143143
Value: string(v),
144144
})
145145
}
146+
// PromQL expects all labels to be sorted! In general, anyone constructing
147+
// a labels.Labels list is responsible for sorting it during construction time.
148+
sort.Sort(ls)
146149
return ls
147150
}

0 commit comments

Comments
 (0)