You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See especially prometheus/prometheus#2564, where it was unclear what the resolution step parameter meant, and that/why queries have an evaluation step that's independent of underlying data.
mfrister, AlekSi, shinhwagk, alitoufighi, asafm and 1 more
Instant queries do not have a step, as they are evaluated at a single point in time (the current time, or a custom time, if it is supplied via the API).
@chanjarster At every evaluation step, PromQL selects the value of the sample that is the most recent before (or exactly at) the evaluation step timestamp, so I think the result would be:
ts=0,v=1; ts=5,v=4, ts=10,v=7, ts=15,v=15
Note that there will be always one returned sample for every increment of the interval (5), even if it would be the same repeated value from the same sample (if "real" samples are less frequent than the eval step). The exception is when there is an explicit staleness marker or the last sample for a given series is >5min before the evaluation timestamp (promql.LookbackDelta = 5 * time.Minute).
@chanjarster At every evaluation step, PromQL selects the value of the sample that is the most recent before (or exactly at) the evaluation step timestamp, so I think the result would be:
ts=0,v=1; ts=5,v=4, ts=10,v=7, ts=15,v=15
Note that there will be always one returned sample for every increment of the interval (5), even if it would be the same repeated value from the same sample (if "real" samples are less frequent than the eval step). The exception is when there is an explicit staleness marker or the last sample for a given series is >5min before the evaluation timestamp (promql.LookbackDelta = 5 * time.Minute).
I can understand ts=5,v=4, ts=10,v=7, ts=15,v=15 , but I don't know why value=1 when ts=0 ,can you help me?
@princeliang Oh thanks for catching that, that was indeed just a mistake. An evaluation step never looks at "future" data, so for ts=0, the result would simply be empty instead of 1.
Just a quick ping, since querying is how people interact with Prometheus. @brian-brazil can you help with this?
I came here from the mentioned issue (prometheus/prometheus#2564), and I still have no idea why Prometheus returned an empty list before I had changed the resolution field. Either I have no idea why it returned data after I changed that field.
Activity
chanjarster commentedon Dec 24, 2018
Hi, @juliusv . Any progress on this issue?
In case of
step
is independent of underlying data, i wanna know:step
step
juliusv commentedon Dec 24, 2018
@chanjarster
interval
represents the step in that evaluation loop. We start at the range's start timestamp, then increase the timestamp byinterval
on every iteration, and abort the loop when the timestamp becomes larger than the range's end timestamp.chanjarster commentedon Dec 26, 2018
@juliusv Thanks for quick reply. I still have something to confirm on range query, please tell me if I'm wrong:
For example, there is a range query
startTs=0, endTs=16, interval=5
And there are data points:
ts=1,v=1; ts=4,v=4; ts=7,v=7; ts=11,v=11; ts=15,v=15
Result will be:
ts=0,v=1; ts=5,v=7; ts=15,v=15
Am I right?
juliusv commentedon Dec 26, 2018
@chanjarster At every evaluation step, PromQL selects the value of the sample that is the most recent before (or exactly at) the evaluation step timestamp, so I think the result would be:
ts=0,v=1; ts=5,v=4, ts=10,v=7, ts=15,v=15
Note that there will be always one returned sample for every increment of the interval (
5
), even if it would be the same repeated value from the same sample (if "real" samples are less frequent than the eval step). The exception is when there is an explicit staleness marker or the last sample for a given series is >5min before the evaluation timestamp (promql.LookbackDelta = 5 * time.Minute
).chanjarster commentedon Dec 27, 2018
@juliusv Thanks a lot, that's crystal clear.
ghost commentedon Oct 22, 2019
why not is
I can understand ts=5,v=4, ts=10,v=7, ts=15,v=15 , but I don't know why value=1 when ts=0 ,can you help me?
juliusv commentedon Oct 22, 2019
@princeliang Oh thanks for catching that, that was indeed just a mistake. An evaluation step never looks at "future" data, so for
ts=0
, the result would simply be empty instead of1
.alitoufighi commentedon Feb 23, 2021
Just a quick ping, since querying is how people interact with Prometheus. @brian-brazil can you help with this?
I came here from the mentioned issue (prometheus/prometheus#2564), and I still have no idea why Prometheus returned an empty list before I had changed the resolution field. Either I have no idea why it returned data after I changed that field.