On Monday 29 January 2024 at 15:24:26 UTC Chris Siebenmann wrote:

For instance, if you do 
delta(metric[1h] > 0), does delta() extrapolate using the timestamps of 
the first and last time series in the original range vector or the 
filtered one?


I would expect it to use the timestamps of the first and last points the 
filtered one.
 

PS: speaking of timestamps, it would be nice if timestamp() worked on a 
range vector and yielded its own range vector of the timestamps of every 
element of the range vector, basically replacing the original values in 
the range vector with the corresponding timestamps. But this is probably 
outside PromQL's processing model.


I agree with that.

I'd also like to be able to answer the question "what was the timestamp of 
the most recent successful scrape"? One option would be
timestamp(last_over_time(up[10m] == 1))
... but as far as I can see, this currently wouldn't work: 
timestamp(last_over_time(up[10m])) just shows the current eval time, unlike 
timestamp(up). Maybe last_over_time() could be changed to preserve the 
timestamp?

Another option would be
max(timestamp(up[10m]))
which requires your proposed change to allow timestamp(rangevector).

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/7846ad98-fae6-4d31-b18d-b0bc825f5a4cn%40googlegroups.com.

Reply via email to