--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/097e9b1d-8c12-49d4-8a78-66ff4c4f555fn%40googlegroups.com.
a rate series would never be exact but a rate on a counter could be exact since the counter is exact. do you agree?
I also agree to your multiple counter increases in one window size argumentation but thats not the case here. There is only one counter value increase (by one) within the window.
All values are known and in the past. Also the window with 1m is larger then the series interval so there is no extrapolation needed but i would understand interpolation / downsampling deu to the 1m. Do I miss on something here?All this does not explain why the query results behave like they do.So let me frase questions again:a) why is [1m] behaving different then [1m:]? the optional resolution should behave the same in both cases - right?
b) why is [1m:15s] and [1m:30s] also different to [1m] and [1m:]? In my understanding the result should be the same for those due to the data and series interval.
c) why is the result of [1m] (and most others) twice as high as it should be (or even other strange values not matching the functions description)?
d) why is sometimes the result even stepped in a unexpected way e.g. [5m:1m]?
--juliu...@promlabs.com schrieb am Donnerstag, 28. Januar 2021 um 15:08:34 UTC+1:Hi,Regarding "For a counter increase by 1 I expect a rate() result/value of 1/60 = 0.01666666666." - rate()'s extrapolating behavior might be the thing surprising you here, which can be extra surprising for very slow-moving counters like yours. rate() tries to calculate the best approximation of the increase of a counter *on average*, but since it has to operate on sampled values over time, it can never know the "right" value for sure. But imagine you provide a [5m] window, and the actual first+last samples under the window are only 4m apart, and thus don't 100% coincide with the beginning and end of your [5m] window. Thus the rate() (and increase()) function operate on the question: "ok but WHAT IF we had had data matching exactly the full window", and extrapolate the observed 4m-based slope to the whole 5m window. Thus even if you use increase() on a counter that only increases by an integer amount, you will typically get back a non-integer result that represents the whole window, and not just the raw increases seen between actual samples. You can find the exact details of how this works (including an exception when the first/last samples are too far away from the window boundaries) in the code here: https://github.com/prometheus/prometheus/blob/275f7e7766f80648d6e63ed968685f3963b494e9/promql/functions.go#L55-L131Short summary is: rate() / increase() will give you on-average decent approximation of the actual rate of increase by extrapolating to the window boundaries.Regards,JuliusOn Thu, Jan 28, 2021 at 12:59 PM Alex <alexander....@gmail.com> wrote:Hi,I think rate/irate/delta/increase are not working correctly for most resolutions.I however got redirected from github to here so please have a look and tell me what you think about this.Is this a bug or do I get something wrong here?Please have a look at the details in: https://github.com/prometheus/prometheus/issues/8413ThanksAlex--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/097e9b1d-8c12-49d4-8a78-66ff4c4f555fn%40googlegroups.com.
--Julius VolzPromLabs - promlabs.com
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/3cec78c4-851d-4262-8b1a-cfd7899b0da7n%40googlegroups.com.
First of all thank you very much for your detailed answer. Some things however are still not clear to me.Your drawn rate window is 75s in total (not 60s as I expect it to be) since it contains 4x 15s samples plus 2x 1/2 step to the next sample.
I would expect the window to be exactly 60s including edges and aligned with data points.
4x 15s samples in my mind sums up to a perfect 60s interval for the window. When the window is aligned with the data and matching a multiple of the interval you should get nice/perfect results - right?Can you explain where the difference comes from? What is wrong with my understanding of a 60s rate window?
Thank you a lot for explaining the semantic difference between [1m] and [1m:] that helped a lot. I however as a user would not expect this but it makes sense when it picks 1m for the subquery.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/50b8f357-5a46-497c-8ebb-7283160b2c1an%40googlegroups.com.