# Function rate\_counter not working properly when multiple dimensions

**URL:** <https://discuss.elastic.co/t/function-rate-counter-not-working-properly-when-multiple-dimensions/298062>\
**Category:** Kibana\
**Tags:** kibana-plugin-development\
**Created:** [February 23, 2022, 4:19pm UTC](https://discuss.elastic.co/t/function-rate-counter-not-working-properly-when-multiple-dimensions/298062 "2022-02-23T16:19:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yves\_Blt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yves_blt/32/84563_2.png) [@Yves\_Blt](https://discuss.elastic.co/u/Yves_Blt)\
**Post date:** [February 23, 2022, 4:19pm UTC](https://discuss.elastic.co/t/function-rate-counter-not-working-properly-when-multiple-dimensions/298062/1 "2022-02-23T16:19:20Z")

</div>

Hello everybody,

I am currently using counter\_rate function in TSBV for my incremental counter, but I found out that this is not working properly when several dimensions are presents.

I have a counter called "http\_server\_requests\_seconds\_count" which is declined over several dimensions :  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/1/a1e0cf2f0e54e1c99090f8d52b54ec4d0a38cf13.png)

This counter is incremental, the value is always increasing.

But when I would like get the rate of the counter, it give me wrong values.  
For example, between 2 buckets, we have :

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/1/f1241ab1402a839a7dab340e8060c182a4d91c68.jpeg)

The difference between the bucket is : 511 796 - 511 649 = 147. It is every 10s so we need to divide by 10 and it counter\_rate per second should be 14.7. Whereas it gives a counter\_rates of 2.6.

I think takes the maximum value of each bucket independently of the dimensions then do the difference. Whereas it should do the counter\_rate for each combination of dimensions and then sum all counter\_rates.

Any idea on how we can make it works ?

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 23, 2022, 4:19pm UTC](https://discuss.elastic.co/t/function-rate-counter-not-working-properly-when-multiple-dimensions/298062/2 "2022-03-23T16:19:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
