DataDog / java-dogstatsd-client

Java statsd client library
MIT License
176 stars 101 forks source link

NonBlockingStatsDClient appends alphanumeric in counters #214

Closed DimitrisKoumantos closed 1 year ago

DimitrisKoumantos commented 1 year ago

Hi,

I am using v4.1.0 in a scala project and I have a shared NonBlockingStatsDClient among threads. The client's configuration is as simple as this:

new NonBlockingStatsDClientBuilder()
      .port(statsDConfiguration.port)
      .hostname(statsDConfiguration.hostName)
      .errorHandler(errorHandler)
      .build()

All the metrics my app sends are counters and are sent with client.increment(metricName). However the statsd server (backend of graphite setup in my case) logs that receives bad lines that look like this:

Bad line: <the random alphanumeric appended in my metric> in msg `my_metric_name:1|c|c:a_random_alphanumeric`

I am struggling to understand how this part |c:alphanumeric is appended in the actual message. Does anyone have any clue or know why/how is this produced?

DimitrisKoumantos commented 1 year ago

I took a better look at the code and read some comments that state most methods of StatsDClient interface are a DataDog extension and might not work with other servers.

So, my guess is that additions by the library in metrics messages, like the one described above, are allowed in DataDog but not in a vanilla statsd server (?). I am going to close the issue since the comments pretty much suggest to use some other resource/lib to send metrics to a vanilla statsd server.