Something that's not clear from the documentation of subquery <https://prometheus.io/docs/prometheus/latest/querying/basics/#subquery> is how the time is handled.
For example, take foo[5d:1d]. Are the queries done at - now - now - 1 day - now - 2 day ... etc Or are the query times quantized to utime 1d multiples, e.g. - midnight just gone - midnight yesterday - midnight the day before ... etc I've been doing some testing with prometheus-2.53.5. Today is 2nd November. max_over_time(vector(time())[5d:1d]) # 1762041600 = 2025-11-02 00:00:00 +0000 min_over_time(vector(time())[5d:1d]) # 1761696000 = 2025-10-29 00:00:00 +0000 max_over_time(vector(time())[1d:1d]) # 1762041600 min_over_time(vector(time())[1d:1d]) # 1762041600 The latter seems particularly useful, as it gives a way to say "give me the value of this metric as it was midnight (UTC) just gone", which is something I've been trying to do. My question: is this behaviour intentional, and can be depended on going forward? (e.g. are their unit tests which guarantee it?) Alternatively, is there a better way to get the value of a metric at the start of a particular time interval? The above approach works OK for me in the UK, where UTC 00:00 is either midnight or one hour later. But it won't work for "start of the month", and for "start of the week" it gives you a Thursday. min_over_time(vector(time())[1w:1w]) # 2025-10-30 00:00:00 +0000 Cheers, Brian. -- 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 [email protected]. To view this discussion visit https://groups.google.com/d/msgid/prometheus-users/11c5f284-6148-496a-b09e-6c882d34e8c9n%40googlegroups.com.

