Increase/delta calculation with missing datapoint at range beginning

47 views
Skip to first unread message

Vincehood

unread,
Aug 20, 2020, 8:57:03 AM8/20/20
to Prometheus Users

Hello,

My question is the following:

I have a metric with type ‘counter’.

I am interested to calculate how much it increases during a 10 min range but datapoints are missing at the beginning of  the range. For example, the counter metric was initialized later or Prometheus was down for some reason.

Is there a way I can use PromQL to ignore the missing data point and calculate instead the increase based on the present data in the 10 min range?

increase() is not doing such extrapolation and returns an empty array.

Thanks

Brian Candler

unread,
Aug 20, 2020, 9:54:10 AM8/20/20
to Prometheus Users
That's exactly what increase() does.  It calculates the rate, based on the first and last data points in the time window and the time difference between them; and then multiplies this up to cover the whole range of the time window.



On Thursday, 20 August 2020 13:57:03 UTC+1, Vincehood wrote:

increase() is not doing such extrapolation and returns an empty array.


Show the actual query you are doing, and the actual data points in the time period. You need at least two data points of course, with the second higher than the first.

Reply all
Reply to author
Forward
0 new messages