Yes, the rate function will take the first & last and calculate the value.
But, it will give wrong values if I do rate on a metrics let's say [1d] and only 1 min of data is present so it will first get the difference b/w first and last metrics and divide by 24 * 60 * 60(sec in 24 hours) which will be very very small nearly zero. And if I do min_over_range it will give me the wrong values. [image: screenshot.png] On Tuesday, April 7, 2020 at 11:53:44 PM UTC+5:30, Brian Candler 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/c98e8dd5-1db1-4ccc-9725-b08cd6fb8e25%40googlegroups.com.

