Skip to content

Commit

Permalink
Ensure series in matrix values returned for instant queries are alway…
Browse files Browse the repository at this point in the history
…s sorted

Signed-off-by: Charles Korn <charles.korn@grafana.com>
  • Loading branch information
charleskorn committed May 13, 2024
1 parent a438160 commit 036c872
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions promql/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ func (ng *Engine) execEvalStmt(ctx context.Context, query *query, s *parser.Eval
case parser.ValueTypeScalar:
return Scalar{V: mat[0].Floats[0].F, T: start}, warnings, nil
case parser.ValueTypeMatrix:
sort.Sort(mat)
return mat, warnings, nil
default:
panic(fmt.Errorf("promql.Engine.exec: unexpected expression type %q", s.Expr.Type()))
Expand Down

0 comments on commit 036c872

Please sign in to comment.