prometheus/promql/testdata/staleness.test
Brian Brazil 67274f0794 Remove 4 interval staleness heuristic. (#3244)
This means that if there is no stale marker, only the usual staleness
delta (5m) applies.

It has occured to me that there is an oddity in the heurestic. It works
fine as long as you have 2 points within the last 5m, but breaks down
when the time window advances to the point where you have just 1 point.

Consider you had points at t=0 and t=10. With the heurestic it goes stale
at t=51, up until t=300. However from t=301 until t=310 we only
see the t=10 point and the series comes back to life. That is not
desirable.

I don't see a way to keep this form of heurestic working given this
issue, so thus I'm removing it.
2017-10-05 12:55:14 +01:00

52 lines
922 B
Plaintext

load 10s
metric 0 1 stale 2
# Instant vector doesn't return series when stale.
eval instant at 10s metric
{__name__="metric"} 1
eval instant at 20s metric
eval instant at 30s metric
{__name__="metric"} 2
eval instant at 40s metric
{__name__="metric"} 2
# It goes stale 5 minutes after the last sample.
eval instant at 330s metric
{__name__="metric"} 2
eval instant at 331s metric
# Range vector ignores stale sample.
eval instant at 30s count_over_time(metric[1m])
{} 3
eval instant at 10s count_over_time(metric[1s])
{} 1
eval instant at 20s count_over_time(metric[1s])
eval instant at 20s count_over_time(metric[10s])
{} 1
clear
load 10s
metric 0
# Series with single point goes stale after 5 minutes.
eval instant at 0s metric
{__name__="metric"} 0
eval instant at 150s metric
{__name__="metric"} 0
eval instant at 300s metric
{__name__="metric"} 0
eval instant at 301s metric