Reputation: 7380
When I was querying a Prometheus server with quite high scrape intervals, I stumbled across a behaviour I wasn't expecting: If I was omitting a time range, metrics weren't continuous, which could best be seen from the Graph window:
My assumption was, that if I queried for up{job="prometheus"}
, it would simply return the latest metric scraped, independent of when this has been. But this just doesn't seem to be the case - especially as all scrapes have been successful to this target.
As I haven't found a good explanation, can you please tell me what the actual outcome is, if I just queried for a metric without a time range like the one in the example above?
[Edit]
Even places like the Promlabs Cheat Sheet say
Upvotes: 2
Views: 887
Reputation: 846
See valyala's answer to "Why is the moving average higher than the actual series in prometheus".
The query from Grafana to Prometheus includes some step parameter, so in fact you'll always get discrete points. Prometheus then delivers the latest value at each of these step points with a maximum look-behind of 5 minutes.
Upvotes: 1