How are metrics calculated?

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...

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.

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.