Re: [prometheus-users] delta/increase on a counter return wrong value

2024-01-21 Thread Jérôme Loyet
Thank you chris for the explanation, this is cristal clear to me now :) but I feel like there's something missing there. I totally understand why the delta/increase/rate functions needs extrapolation at boundaries but I feel like some use cases would need a version of those functions without

Re: [prometheus-users] delta/increase on a counter return wrong value

2024-01-19 Thread Chris Siebenmann
> I understand that there can be some interpolation at the boundaries, but > the value is not changing around the boundaries, it only changes in the > middle of the time range. Scrap is done every 15s and the value of the > metric is constant more than 1 minute before and after the boundaries.

Re: [prometheus-users] delta/increase on a counter return wrong value

2024-01-19 Thread Jérôme Loyet
Le jeudi 18 janvier 2024 à 22:26:42 UTC+1, Chris Siebenmann a écrit : > I have a counter and I want to counter the number of occurences on a > duration (let's say 15m). I'm using delta() or increase but I'm not getting > the result I'm expecting. > > value @t0: 30242494 > value @t0+15m:

Re: [prometheus-users] delta/increase on a counter return wrong value

2024-01-18 Thread 'Brian Candler' via Prometheus Users
If you are not worried too much about what happens if the counter resets during that period, then you can use: (metric - metric offset 15m) >= 0 On Friday 19 January 2024 at 05:26:42 UTC+8 Chris Siebenmann wrote: > > I have a counter and I want to counter the number of occurences on a > >

Re: [prometheus-users] delta/increase on a counter return wrong value

2024-01-18 Thread Chris Siebenmann
> I have a counter and I want to counter the number of occurences on a > duration (let's say 15m). I'm using delta() or increase but I'm not getting > the result I'm expecting. > > value @t0: 30242494 > value @t0+15m: 30609457 > calculated diff: 366963 > round(max_over_time(metric[15m])) -

Re: [prometheus-users] delta/increase on a counter return wrong value

2024-01-18 Thread Alexander Wilke
You May use rate(metric{}[15m]) Jérôme Loyet schrieb am Do., 18. Jan. 2024, 19:27: > Hello, > > my previous was not clear, sorry for that. I don't want count the number > of sample (count_over_time) but I want to calculate the difference (delta) > or the increase (increase) of the metric

Re: [prometheus-users] delta/increase on a counter return wrong value

2024-01-18 Thread Jérôme Loyet
Hello, my previous was not clear, sorry for that. I don't want count the number of sample (count_over_time) but I want to calculate the difference (delta) or the increase (increase) of the metric value during the range (15 minutes). As the metric is a counter that only grows (it counts the

Re: [prometheus-users] delta/increase on a counter return wrong value

2024-01-18 Thread Alexander Wilke
Maybe you are looking for count_over_time https://promlabs.com/promql-cheat-sheet/ Jérôme Loyet schrieb am Do., 18. Jan. 2024, 18:56: > Hello, > > I have a counter and I want to counter the number of occurences on a > duration (let's say 15m). I'm using delta() or increase but I'm not getting

[prometheus-users] delta/increase on a counter return wrong value

2024-01-18 Thread Jérôme Loyet
Hello, I have a counter and I want to counter the number of occurences on a duration (let's say 15m). I'm using delta() or increase but I'm not getting the result I'm expecting. value @t0: 30242494 value @t0+15m: 30609457 calculated diff: 366963 round(max_over_time(metric[15m])) -