Skip to content
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

Jar silently fails to initialize? #13

Open
djudd opened this issue Aug 16, 2015 · 7 comments
Open

Jar silently fails to initialize? #13

djudd opened this issue Aug 16, 2015 · 7 comments

Comments

@djudd
Copy link

djudd commented Aug 16, 2015

(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:

kafka.metrics.reporters=com.airbnb.kafka.KafkaStatsdMetricsReporter

external.kafka.statsd.reporter.enabled=true
external.kafka.statsd.host=localhost
external.kafka.statsd.port=8125

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

@Praburaj
Copy link

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

@dlanderson
Copy link

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:

  1. git clone https://github.com/airbnb/kafka-statsd-metrics2.git
  2. cd kafka-statsd-metrics2
  3. env CLASSPATH=/usr/lib/kafka/kafka_2.10-0.8.2.2/libs/* ./gradlew shadowJar --info
  4. cp build/libs/kafka-statsd-metrics2-0.4.1-all.jar /usr/lib/kafka/kafka_2.10-0.8.2.2/libs/

@dtboctor
Copy link

Seeing this same problem, with kafka 0.9, scala 2.11, recompiling didn't fix it.

@brendan-munro
Copy link

I am also seeing this issue, also with Kafka 0.9. I've followed the above recommendations and still have no positive results.

@michaelmoss
Copy link

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.

https://github.com/DataDog/java-dogstatsd-client/blob/master/src/main/java/com/timgroup/statsd/NonBlockingStatsDClient.java

@KendallWeihe
Copy link

I'm running into this same issue

@porridge
Copy link

porridge commented Jun 6, 2018

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants