Two easy ways to poll apache Cassandra Metrics using JMX Http Bridge
There are many different methods to monitor Apache Cassandra metrics. From a high level, these methods can be grouped in two general types of techniques: push versus poll. The meaning of the two types is actually quite simple. If a technique used is helping Cassandra service to push out its internal metrics to a target receiver/sink, this technique belongs to "push" type. Otherwise, if a technique is used to query Cassandra service on demand in order to get the required metrics, this technique belongs to "poll" type. The
Pluggable Metrics Reporting feature as introduced in Cassandra 2.0.2 is a push type technique, which I have described with much more detail in another post that can be found
here. In this post, I will explore two simple but useful methods to poll Cassandra metrics through a JMX Http Bridge. One method is to pull Cassandra metrics through MX4J Http Adaptor and another method is through Jolokia JVM agent. At very high level, both methods contains a lightweight HTTP server in order to translate HTTP based Cassandra metrics requests to JMX requests. The difference is that MX4J works as a regular standard web page operation, but Jolokia works as a REST API. Please note that both MX4J and Jolokia are general JMX related techniques, the detailed description of them is beyond the scope of this post. If you're interested, please refer to their web pages respectively:
MX4J,
Jolokia. In this post, I will focus on how to configure Apache Cassandra in order to enable the features of polling metrics through MX4J and Jolokia.