linkedin / kafka-monitor

Xinfra Monitor monitors the availability of Kafka clusters by producing synthetic workloads using end-to-end pipelines to obtain derived vital statistics - E2E latency, service produce/consume availability, offsets commit availability & latency, message loss rate and more.
https://engineering.linkedin.com/blog/2016/05/open-sourcing-kafka-monitor
Apache License 2.0
2.02k stars 445 forks source link

StatsD reporting double support #367

Open kkonstan-ovo opened 2 years ago

kkonstan-ovo commented 2 years ago

Currently the StatsD reporting service converts metric values from double to long when calling the StatsD client.

This makes it unsuitable for the availability metrics because all digits after the decimal point are lost and therefore the only possible values are 1 (if value is 1) or 0 (if value is <1).

The next minor release of the StatsD client adds support for double value for gauges, without introducing any other changes:

https://github.com/tim-group/java-statsd-client/releases/tag/v3.0.2

This PR switches the StatsD client to this version and removes the conversion from double to long when calling the StatsD client, which fixes this issue and closes https://github.com/linkedin/kafka-monitor/issues/365

No tests were included for the StatsD service, however since the StatsD client ultimately converts the value supplied (wether long or double) to string to report to the StatsD server, this change should have no effect on any of the other metrics that are integers.

chrisbeard commented 2 years ago

I've been running the same patch for some time now and can confirm this patch is both sound and essential to get accurate metrics from StatsD. It would be great for this to be merged upstream here.