java-dogstatsd-client: 2.10.0 breaks my Datadog metrics
So this is how I currently setup my StatsDClient:
new NonBlockingStatsDClient("", "localhost", 8125);
I just tried updating the version to 2.10.0, and I’ve tried using the old deprecated constructor and then this:
new NonBlockingStatsDClientBuilder().prefix("").hostname("localhost").port(8125).build();
And Datadog metrics stopped showing up if I use either of those. And as soon as I downgraded to 2.9.0, metrics started working again. So am I doing something wrong? Is there some additional thing I need to do in 2.10.0? Thanks!
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (9 by maintainers)
Commits related to this issue
- Update version number in README Version 2.10.0 is broken for JDK 8 as described in https://github.com/DataDog/java-dogstatsd-client/issues/112, so we shouldn't be recommending use of that version. — committed to lalpert/java-dogstatsd-client by lalpert 4 years ago
- Update version number in README (#119) Version 2.10.0 is broken for JDK 8 as described in https://github.com/DataDog/java-dogstatsd-client/issues/112, so we shouldn't be recommending use of that vers... — committed to DataDog/java-dogstatsd-client by lalpert 4 years ago
- Update version number in README (#119) Version 2.10.0 is broken for JDK 8 as described in https://github.com/DataDog/java-dogstatsd-client/issues/112, so we shouldn't be recommending use of that vers... — committed to locationlabs/java-dogstatsd-client by lalpert 4 years ago
2.10.1should be available soon. It’s been released but it hasn’t shown up on maven central just yet. I’m waiting to see if it’s an indexing issue or what not. If the fixed lib isn’t available tomorrow morning (EST) I will chase it down.The issue derived from the fact
2.10.0was accidentally built atop JDK11 (I had changed the local JDK with jenv to JDK11 and forgot setting it back) and this is what caused the JDK8 problems. The target was1.7so I’m still a little surprised. In any case2.10.1should now be good. Apologies for the issue.EDIT: available here - https://mvnrepository.com/artifact/com.datadoghq/java-dogstatsd-client/2.10.1
@truthbk thanks for the fix. One more comment: it would be great if you could keep the code examples on the datadog website up to date. It’s still referring to version 2.8: https://docs.datadoghq.com/developers/dogstatsd/?tab=java
OK, I’ve finally been able to reproduce! Now I can finally work on the fix. Thank you all for all your help. And thank you for the tip @pbarsotti-glovo that stuff was key to help me finally reproduce the problem.
It appears to be JDK8 specific. I have not been able to reproduce on later JVMs, but if anyone finds this on a version other than JDK8 let me know!
Thank you for your patience everyone, I hope to have something ready early next week.
@truthbk I confirm version 2.10.1 is working as expected with
NonBlockingStatsDClientBuilder. Thanks for the quick fix!Just wanted to leave a +1. I can also reproduce these effects. Metrics are reported correctly from my test rig running JDK 11, but not on prod with JDK 8.
@truthbk I confirm that I’m testing on JRE 1.8 and
NonBlockingStatsDClientBuilderdoesn’t work butNonBlockingStatsDClientdoes.@truthbk I did this test on my local computer (macOS Catalina 10.15.4) with this Java setup:
Our services run on Amazon Linux 2, but I didn’t tried to use the version compiled locally on them. If you need more information or help to try a different setup, feel free to ask.
I’m running Java 8 on GCP Container-Optimized OS.
just to add another data point - sadly, i don’t have time to debug this any further:
when i switched from 2.9.0 to 2.10.0 and changed from
new NonBlockingStatsDClient("my-application", "localhost", 8125)tonew NonBlockingStatsDClientBuilder().prefix("my-application").hostname("localhost").port(8125).build()metrics stopped appearing in datadog.i guess this is the exact same problem.