-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DatadogReporter is incorrectly reporting counters to Datadog #45
Comments
I'm not sure this is going to work. Transport.Request is created anew for each reporting period, and so the logic in Request.addCounter won't help between reports. It would be awesome if the Datadog reported tracked the history of reports for counters across reporting periods, so that this could be done correctly, but I think that's a larger change, though one I think was intended, originally. |
@vasileiosC Thanks for raising this dilemma. We've been back and forth on this quite a bit. See #32 and #22 for context |
I came across the thread but this conversation confuses me. Actually I don't think any of the proposed solutions is correct simply because they don't seem to address the root problem which is the metrics library introduces an unnecessary extra layer of aggregation when statsd is used. The solution seems to me is just not to use counter or even not to use the metrics library at all and let statsd do the aggregation. |
Wondering if this issue has been addressed? I'm experiencing a similar issue, the counter metric reported seems to be inaccurate, see inconsistency between intervals in dataDog, i.e when looking at the "last day" or "last week" the count number is lower than looking at "last hour" count, number make no sense |
According to the mapping of metrics specified by datadog Statsd counter should be datadog's rate. According to statsd , its counter is events per second i.e. rate. Therefore metrics meter should be mapped to statsd's counter which gets converted to datadog's rate. I often plot raw count by applying .as_count() function in datadog. This is only possible when the metric is rate. As datadog states
Hence my proposal would be to change #32, let metric's histogram.count and meter.count be reported as statsd's counter, other histogram and meter metrics such as percentile and average rates can be treated as gauge. |
It's useful to note that there is a "pure" statsd reporter for metrics that takes another approach, of reporting everything as a gauge. See ReadyTalk/metrics-statsd#15 for further details. Reading the explanation, I think that they got it right, and the UDP transport needs to send all stats as gauges. I don't know what this means for the HTTP transport. |
Agree with arguement.
In the UDP, events passes though both metric and statsd aggregation with different semantics i.e. Your application -> Metric (aggregated here) -> this library -> (dog)statsd (aggregated again)-> datadog server For HTTP, events does not follow through double aggregation i.e. Hence sending with compatible (Metric and Datadog) semantic is better idea. Side note: In my forked repo, I send "count" as counter to statsd (than "gauage") and it works perfectly. Not sure why. More investigation requires. |
If you are reading this, I suggest replacing your usage of this repo with micrometer-metrics. You can see what a proper implementation of counter should be here, which is to treat statsd reporting differently from in-app reporting by sending actual value to statsd directly as COUNT type. The problem with this repo is that it thinks Http reporting and statsd are the same, which caused double counting/missing counting (depending on the difference between reporting interval of this lib and statsd's) when you use dogstatsd. This is accurate as of when this comment is posted as shown here. |
1.1.4+ is broken, I had to revert version because of the same issue. |
dropwizard metrics Meter is mapped to statsd's Counter. IF we use dropwizard Counter then the metric will endup as a gauge in Datadog. Reference coursera/metrics-datadog#45 The referenced issue also mentioned a version downgrade for metrics-datadog. I tried it locally and the version didn't seem to make a difference.
dropwizard metrics Meter is mapped to statsd's Counter. IF we use dropwizard Counter then the metric will endup as a gauge in Datadog. Reference coursera/metrics-datadog#45 The referenced issue also mentioned a version downgrade for metrics-datadog. I tried it locally and the version didn't seem to make a difference.
For me version 1.1.2 worked, from version 1.1.3 |
To reproduce
At time X increase the counter's count value by 5. Datadog should (correctly) display the value 5 for time X.
At a later time increase the counter's count value by 5. Datadog should normally display the value 5 for time X + 10 but it will instead display the value 10.
Additionally, in the time frame between X and X + 10, the
DatadogReporter
should report the value 0 to Datadog (as no changes to the counter occured) but will instead report the value 5.This behaviour occurs due to the fact that the
DatadogReporter
is treating the counters as gauges in the reporting level.By changing the reporter to treat counters as what they really are, the problem is solved.
This is because
addCounter()
is keeping a history of the reported counters and is instead reporting the counter values as relative values instead of absolute.The text was updated successfully, but these errors were encountered: