File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -539,18 +539,15 @@ func (q *compatibilityQuery) Exec(ctx context.Context) (ret *promql.Result) {
539539 defer q .engine .activeQueryTracker .Delete (idx )
540540
541541 ctx = warnings .NewContext (ctx )
542- defer func () {
543- ret .Warnings = ret .Warnings .Merge (warnings .FromContext (ctx ))
544- }()
542+ warnings .MergeToContext (q .warns , ctx )
545543
546544 // Handle case with strings early on as this does not need us to process samples.
547545 switch e := q .plan .Root ().(type ) {
548546 case * logicalplan.StringLiteral :
549547 return & promql.Result {Value : promql.String {V : e .Val , T : q .ts .UnixMilli ()}}
550548 }
551549 ret = & promql.Result {
552- Value : promql.Vector {},
553- Warnings : q .warns ,
550+ Value : promql.Vector {},
554551 }
555552 defer recoverEngine (q .engine .logger , q .plan , & ret .Err )
556553
@@ -626,6 +623,7 @@ loop:
626623 }
627624 sort .Sort (matrix )
628625 ret .Value = matrix
626+ ret .Warnings = warnings .FromContext (ctx )
629627 if matrix .ContainsSameLabelset () {
630628 return newErrResult (ret , extlabels .ErrDuplicateLabelSet )
631629 }
@@ -679,6 +677,7 @@ loop:
679677 }
680678
681679 ret .Value = result
680+ ret .Warnings = warnings .FromContext (ctx )
682681 return ret
683682}
684683
You can’t perform that action at this time.
0 commit comments