mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Only add LookbackDelta to vector selectors (#4399)
Signed-off-by: Thomas Jackson <jacksontj.89@gmail.com> Related to #4226
This commit is contained in:
parent
d8153ac5d5
commit
56daa1f28a
|
@ -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 {
|
Inspect(s.Expr, func(node Node, path []Node) error {
|
||||||
var set storage.SeriesSet
|
var set storage.SeriesSet
|
||||||
params := &storage.SelectParams{
|
params := &storage.SelectParams{
|
||||||
Start: timestamp.FromTime(s.Start.Add(-LookbackDelta)),
|
Start: timestamp.FromTime(s.Start),
|
||||||
End: timestamp.FromTime(s.End),
|
End: timestamp.FromTime(s.End),
|
||||||
Step: int64(s.Interval / time.Millisecond),
|
Step: int64(s.Interval / time.Millisecond),
|
||||||
}
|
}
|
||||||
|
|
||||||
switch n := node.(type) {
|
switch n := node.(type) {
|
||||||
case *VectorSelector:
|
case *VectorSelector:
|
||||||
|
params.Start = params.Start - durationMilliseconds(LookbackDelta)
|
||||||
params.Func = extractFuncFromPath(path)
|
params.Func = extractFuncFromPath(path)
|
||||||
if n.Offset > 0 {
|
if n.Offset > 0 {
|
||||||
offsetMilliseconds := durationMilliseconds(n.Offset)
|
offsetMilliseconds := durationMilliseconds(n.Offset)
|
||||||
|
|
Loading…
Reference in a new issue