Every time the data is scrapped Prometheus does that calculation and record the custom metric. 5min here is a sliding window with latest metric's time stamp as the curren time and the previous one (if it exists within last 5min) as the previous metric. If there is no metric in last 5 min you'll not see any result.
On Tue, Apr 7, 2020, 1:23 PM Brian Candler <[email protected]> wrote: > > What happens when I do rate(metricsX[5m]) but only 1 min of data is > present? > > rate() takes the first and last point within the given time window, and > calculates the rate between them. So: as long as there are at least two > data points in the window(*), you'll get a result. If not, you'll get no > result. > > (*) And the second is higher than the first, since rate works with > counters. > > -- > 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 on the web visit > https://groups.google.com/d/msgid/prometheus-users/686f17dc-988c-4c14-a6bd-a648a9f80a56%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/686f17dc-988c-4c14-a6bd-a648a9f80a56%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 on the web visit https://groups.google.com/d/msgid/prometheus-users/CAKimyZsFsAC8PqQ1_eGJnRYyyyxx_EaW24fm0rJa4ib65Oz%3DfA%40mail.gmail.com.

