On Tuesday, 1 September 2020 14:55:25 UTC+1, Manish G wrote: > > Going by (m1.2-m1.0)/(t2-t0) * 1h, even though m1 played out only for > period t2-t0, we still multiply by 1h, and same for m3. > So while increase() is expected to give absolute delta(m1.2-m1.0), it > seems that's not the case. >
It's not expected to give the absolute delta. See: https://prometheus.io/docs/prometheus/latest/querying/functions/#increase If you want the absolute delta, then you can say mymetric - mymetric offset 1h Note that this will not do anything special for counter resets, and may give you a meaningless or negative value if the counter has reset. There is also a delta() function, but that also extrapolates the value to cover the full range, and is also not intended to be used for counters. > Another concern: when we apply increase function, does the system divide > whole of time line into that many time slots(total time/time window) and > then we get one data point per slot? I am asking this because I observe > that even for huge time slots like 3hours, I see continuou curve, something > which is not possible if we get one data point per time slot. > Unless you are using a subquery, the values used are the actual values in the database, with their actual timestamps when they were scraped. They are not resampled. Your "continuous curve" is probably because you are displaying this query as a graph. Graphing *does* repeat the query over a range in steps, so that it calculates the answer at t(0), t(1), t(2), t(3) ... t(N) which become the points of the graph. At each instant the same query is run. So if your query includes mymetrics[1h], then to generate the graph point at t(0) it will use mymetrics(-3600,0]. At the graph point t(1) it will use mymetrics(-3599,1]. And so on. -- 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/c6036595-14ad-4b6e-bdad-d0794487d4f5o%40googlegroups.com.