diff --git a/promql/engine.go b/promql/engine.go index 68b87a5de..41f9238a1 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -779,20 +779,6 @@ func (ev *evaluator) vectorSelector(node *VectorSelector) Vector { if value.IsStaleNaN(v) { continue } - // Find timestamp before this point, within the staleness delta. - prevT, _, ok := it.PeekBack(peek) - if ok && prevT >= refTime-durationMilliseconds(LookbackDelta) { - interval := t - prevT - if interval*4+interval/10 < refTime-t { - // It is more than 4 (+10% for safety) intervals - // since the last data point, skip as stale. - // - // We need 4 to allow for federation, as with a 10s einterval an eval - // started at t=10 could be ingested at t=20, scraped for federation at - // t=30 and only ingested by federation at t=40. - continue - } - } vec = append(vec, Sample{ Metric: node.series[i].Labels(), diff --git a/promql/testdata/staleness.test b/promql/testdata/staleness.test index 9c24fe31c..76ee2f287 100644 --- a/promql/testdata/staleness.test +++ b/promql/testdata/staleness.test @@ -13,11 +13,11 @@ eval instant at 30s metric eval instant at 40s metric {__name__="metric"} 2 -# It goes stale 4 intervals + 10% after the last sample. -eval instant at 71s metric +# It goes stale 5 minutes after the last sample. +eval instant at 330s metric {__name__="metric"} 2 -eval instant at 72s metric +eval instant at 331s metric # Range vector ignores stale sample.