# How are metrics calculated?

**URL:** <https://discuss.elastic.co/t/how-are-metrics-calculated/56982>\
**Category:** Logstash\
**Created:** [August 2, 2016, 9:13am UTC](https://discuss.elastic.co/t/how-are-metrics-calculated/56982 "2016-08-02T09:13:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![trondhindenes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trondhindenes/32/10534_2.png) [@trondhindenes](https://discuss.elastic.co/u/trondhindenes)\
**Post date:** [August 2, 2016, 9:13am UTC](https://discuss.elastic.co/t/how-are-metrics-calculated/56982/1 "2016-08-02T09:13:54Z")

</div>

I'm trying to figure out how the "metrics" filter calculates its value. We're using metrics in conjunction with the datadog\_metrics plugin to send messagerate data to datadog. However, the rate we're seeing doesn't add up with the counts when looking at kibana.

For instance, if I do count per minute in kibana, the we're getting between 800 and 1400 messages per minute. The "metrics" counter (I'm using "%{[events][rate\_1m]}") is around 200 per minute. As far as I understand, the rate\_1m measures last 1m of data as a "moving target". I'm pretty sure datadog doesn't do anything with the data except just visualising it, so how could these values be so different? I've also tested this in our dev using stdout, and the result is the same: kibana's "count" per minute is way higher than what the metrics filter reports.

I'm pretty sure there's something I don't understand, but not sure what...

---

<div class="post-metadata">

**Author:** ![thematthewgreen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thematthewgreen/32/472_2.png) [@thematthewgreen](https://discuss.elastic.co/u/thematthewgreen)\
**Post date:** [September 9, 2016, 10:18pm UTC](https://discuss.elastic.co/t/how-are-metrics-calculated/56982/2 "2016-09-09T22:18:37Z")

</div>

Were you able to get a resolution on this?

I'm using the datadog\_metrics plugin as well and our counts aren't matching up as well.

Once thing that I noticed was that the plugin is using the "counter" metric which is deprecated in the API.

---

<div class="post-metadata">

**Author:** ![trondhindenes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trondhindenes/32/10534_2.png) [@trondhindenes](https://discuss.elastic.co/u/trondhindenes)\
**Post date:** [September 10, 2016, 1:53pm UTC](https://discuss.elastic.co/t/how-are-metrics-calculated/56982/3 "2016-09-10T13:53:57Z")

</div>

Nope, we gave up. I setup a custom check in datadog which queries Elastic's  
rest api directly instead, to get a count of messagerate that way. Much  
better.

---

<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:** [July 6, 2017, 4:39am UTC](https://discuss.elastic.co/t/how-are-metrics-calculated/56982/4 "2017-07-06T04:39:03Z")

</div>


