Use the context associated with the inner evaluation span (#5130)
Signed-off-by: Bryan Boreham <bryan@weave.works>
This commit is contained in:
parent
f4275d2352
commit
8841692a63
|
@ -420,7 +420,7 @@ func (ng *Engine) execEvalStmt(ctx context.Context, query *query, s *EvalStmt) (
|
||||||
return nil, warnings, err
|
return nil, warnings, err
|
||||||
}
|
}
|
||||||
|
|
||||||
evalSpanTimer, _ := query.stats.GetSpanTimer(ctx, stats.InnerEvalTime, ng.metrics.queryInnerEval)
|
evalSpanTimer, ctxInnerEval := query.stats.GetSpanTimer(ctx, stats.InnerEvalTime, ng.metrics.queryInnerEval)
|
||||||
// Instant evaluation. This is executed as a range evaluation with one step.
|
// Instant evaluation. This is executed as a range evaluation with one step.
|
||||||
if s.Start == s.End && s.Interval == 0 {
|
if s.Start == s.End && s.Interval == 0 {
|
||||||
start := timeMilliseconds(s.Start)
|
start := timeMilliseconds(s.Start)
|
||||||
|
@ -428,7 +428,7 @@ func (ng *Engine) execEvalStmt(ctx context.Context, query *query, s *EvalStmt) (
|
||||||
startTimestamp: start,
|
startTimestamp: start,
|
||||||
endTimestamp: start,
|
endTimestamp: start,
|
||||||
interval: 1,
|
interval: 1,
|
||||||
ctx: ctx,
|
ctx: ctxInnerEval,
|
||||||
maxSamples: ng.maxSamplesPerQuery,
|
maxSamples: ng.maxSamplesPerQuery,
|
||||||
defaultEvalInterval: GetDefaultEvaluationInterval(),
|
defaultEvalInterval: GetDefaultEvaluationInterval(),
|
||||||
logger: ng.logger,
|
logger: ng.logger,
|
||||||
|
@ -470,7 +470,7 @@ func (ng *Engine) execEvalStmt(ctx context.Context, query *query, s *EvalStmt) (
|
||||||
startTimestamp: timeMilliseconds(s.Start),
|
startTimestamp: timeMilliseconds(s.Start),
|
||||||
endTimestamp: timeMilliseconds(s.End),
|
endTimestamp: timeMilliseconds(s.End),
|
||||||
interval: durationMilliseconds(s.Interval),
|
interval: durationMilliseconds(s.Interval),
|
||||||
ctx: ctx,
|
ctx: ctxInnerEval,
|
||||||
maxSamples: ng.maxSamplesPerQuery,
|
maxSamples: ng.maxSamplesPerQuery,
|
||||||
defaultEvalInterval: GetDefaultEvaluationInterval(),
|
defaultEvalInterval: GetDefaultEvaluationInterval(),
|
||||||
logger: ng.logger,
|
logger: ng.logger,
|
||||||
|
|
Loading…
Reference in New Issue