Java

How to send metrics using Java

Contents

  • Coda Hale’s metrics library

    http://metrics.dropwizard.io/ - Developed by Yammer to instrument their JVM-based backend services, it’s a really comprehensive Java metrics library and works well with Hosted Graphite.

  • Metrics-StatsD for Coda Hale’s metrics library

Java’s default JVM behaviour includes an optimisation/attempt to prevent DNS cache poisoning whereby it will read DNS entries for a service and then cache them forever. This is something that will result in problems with Hosted Graphite.

To service our hundreds of customers we run a lot of different machines and we swap machines in and out all the time. This means that if you have cached the DNS entry for a machine that no longer exists, you’re going to drop a lot of data.

To prevent this, you can set the JVM cache behaviour to only cache entries for 60 seconds:

Your API key can be found on your account home page.

Last updated

Was this helpful?