On 23/03/2021 14:10, John Dexter wrote:
> Thanks,
>
> I don't think we want to change provider and we can live with it, but
> it is a shame we don't have both options - extrapolation being a
> feature many don't want.
> I didn't read all that link but I am going to assume there is a
> technical reason PromQL doesn't just provide both?
I think the main problem with not using extrapolation is that the answer
is often misleading. Samples will basically never correspond to the
times a query is requesting (e.g. you are querying at 11:34:07 but the
last sample was at 11:34:02) so you are then in a position to make a
good estimate of what the value should be. If you just took the last
sample without extrapolation it could be very old (for example 2 minutes
for a slowly scraped endpoint). For the majority of cases looking at how
things have been changing and extrapolating the forwards/backwards to
when you need values is often sensible and gives you a better idea of
what is going on.
Prometheus itself doesn't know what values are valid for a particular
metrics - all values are actually floats, so could have fractional
parts. If wanted you could use one of the rounding functions to force
the returned value to be an integer.
--
Stuart Clark