1
votes

I want to capture Dropwizard Metrics of my Cassandra cluster in my Java Program(I don't want to use JMX) and pass those values in JSON to some other server(which will use these values to generate alarms etc). I'm new in Java and would really appreciate if I can get some guidance. Are there any native Dropwizard APIs for collecting these metrics? Can you provide a sample Java code of using that API for fetching any metric for example? The reason for not using JMX is that I've read here that it's not recommended to try to gather metrics from production environment as JMX’s RPC API is fragile.

1

1 Answers

1
votes

You can send metrics using available plugins for Metrics library, such as graphite, or ganglia...

To do this, you need to put .jar file for corresponding plugin into lib directory of Cassandra, add corresponding configuration file for plugin, modify Cassandra's jvm.options file with following line:

-Dcassandra.metricsReporterConfigFile=<reporting-configuration>.yaml

and restart Cassandra to pickup the changes.

There are several blog post on configuration of Cassandra to use custom metrics plugins that could provide more details: 1, 2.

You may also try to setup standard Metrics Servlets to do query - it should be configured almost the same way - add library & provide configuration