From 56daa1f28ac66dcdc7a2d001d303c1e4df059a86 Mon Sep 17 00:00:00 2001 From: Thomas Jackson Date: Wed, 18 Jul 2018 22:16:05 -0700 Subject: [PATCH] Only add LookbackDelta to vector selectors (#4399) Signed-off-by: Thomas Jackson Related to #4226 --- promql/engine.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/promql/engine.go b/promql/engine.go index d9b9b5ce3..4d5239636 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -482,13 +482,14 @@ func (ng *Engine) populateSeries(ctx context.Context, q storage.Queryable, s *Ev Inspect(s.Expr, func(node Node, path []Node) error { var set storage.SeriesSet params := &storage.SelectParams{ - Start: timestamp.FromTime(s.Start.Add(-LookbackDelta)), + Start: timestamp.FromTime(s.Start), End: timestamp.FromTime(s.End), Step: int64(s.Interval / time.Millisecond), } switch n := node.(type) { case *VectorSelector: + params.Start = params.Start - durationMilliseconds(LookbackDelta) params.Func = extractFuncFromPath(path) if n.Offset > 0 { offsetMilliseconds := durationMilliseconds(n.Offset)