Open djudd opened 9 years ago
+1. I observe the same as well. I can see that the KafkaStatsdMetricsReporter
is getting initialized as I can see errors reported when I give an incorrect value for any of the statsd settings. However I don't see any metrics reported to statsd server. Any help will be appreciated.
I had the same problem using Scala 2.10, kafka 8.2.2. The reporter would initialize properly but no statsd metrics were emitted. After making sure my CLASSPATH only included the kafka core libs, I rebuilt using ./gradlew shadowJar
and copied the resulting build/libs/kafka-statsd-metrics2-0.4.1-all.jar
to the kafka lib dir - works great now.
E.g:
git clone https://github.com/airbnb/kafka-statsd-metrics2.git
cd kafka-statsd-metrics2
env CLASSPATH=/usr/lib/kafka/kafka_2.10-0.8.2.2/libs/* ./gradlew shadowJar --info
cp build/libs/kafka-statsd-metrics2-0.4.1-all.jar /usr/lib/kafka/kafka_2.10-0.8.2.2/libs/
Seeing this same problem, with kafka 0.9, scala 2.11, recompiling didn't fix it.
I am also seeing this issue, also with Kafka 0.9. I've followed the above recommendations and still have no positive results.
I encountered the same issue. Everything was initializing ("Started KafkaStatsDReporter..." in the logs), but no metrics were being produced. I tracked down the issue to our inclusion of another library, https://github.com/endgameinc/storm-metrics-statsd which uses the popular com.timgroup.java-statsd-client. It turns out, this repo, kafka-statsd-metrics2 includes com.indeed:java-dogstatsd-client which has classes with the same name and package as the timgroup jar its forked from. These seem to be conflicting at runtime.
https://github.com/tim-group/java-statsd-client/blob/master/src/main/java/com/timgroup/statsd/NonBlockingStatsDClient.java https://github.com/indeedeng/java-dogstatsd-client/blob/master/src/main/java/com/timgroup/statsd/NonBlockingStatsDClient.java
I made it so my project just imports one, and everything works. I'll let the maintainers, now datadog, know they should update the package name to prevent these conflicts.
I'm running into this same issue
I think I'm running into the same issue. But I cannot see any evidence of class loader or type errors anywhere in my logs. Has anyone tracked down why the metrics are just silently missing?
FTR, using the datadog's distribution rather than the timgroup one fixed it for me:
- "com.timgroup" % "java-statsd-client" % "3.0.1"
+ "com.datadoghq" % "java-dogstatsd-client" % "2.5"
(I'm not sure if this is a bug or just something I'm doing wrong but I'm not sure where else to ask for help. At least, the installation instructions may be missing something.)
I added the jar to the kafka libs directory (and later verified that it's on the classpath with
ps
). I added the following configuration lines to server.properties, and restarted my kafka broker:Initially I got an error for a missing statsd client class, which I fixed by adding the linked statsd client jar as well - perhaps this should be more explicit in the installation instructions. But then I failed to get any further results. No message like "Kafka Statsd metrics reporter is enabled" and no errors in the logs.
This is with kafka 0.8.2.1 and kafka-statsd-metrics2 0.4.1