Skip to content

Commit

Permalink
always sort getOutputSeries labels for aggregate expr
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 committed Dec 30, 2023
1 parent b717f2a commit d74f18f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,9 @@ func getOutputSeries(expr parser.Expr) ([]labels.Labels, bool) {
for _, v := range m {
output = append(output, v)
}
sort.Slice(output, func(i, j int) bool {
return labels.Compare(output[i], output[j]) < 0
})
return output, false
case *parser.SubqueryExpr:
return getOutputSeries(node.Expr)
Expand Down

0 comments on commit d74f18f

Please sign in to comment.