email iconemail phone iconcall

Pluggable metrics reporting in Cassandra 2.0.2

By Jonathan Ellis, CTO and Co-founder -  November 5, 2013 | 15 Comments

Guest post by Chris Burroughs

Starting in 1.1, Apache Cassandra® began exposing its already bountiful internal metrics using the popular Metrics library. The number of metrics has since been greatly expanded in 1.2 and beyond. There are now a variety of metrics for cache size, hit rate, client request latency, thread pool status, per column family statistics, and other operational measurements.

You could always write some custom java code to send these metrics onto a system like graphite or ganglia for data storage and graphing. Starting in Cassandra 2.0.2, pluggable Metrics reporter support is built in.


  1. Grab your favorite reporter jar (such as metrics-graphite) and add it to the server's lib
  2. Create a configuration file for the reporters following the sample.
  3. Start the server with -Dcassandra.metricsReporterConfigFile=yourCoolFile.yaml
  4. Happy Graphing!

A config file to send some basic metrics to a single local graphite server once a minute might look like:

    period: 60
    timeunit: 'SECONDS'
     - host: 'graphite-server.domain.local'
       port: 2003
      color: "white"
      useQualifiedName: true
        - "^org.apache.cassandra.metrics.Cache.+"
        - "^org.apache.cassandra.metrics.ClientRequest.+"
        - "^org.apache.cassandra.metrics.Storage.+"
        - "^org.apache.cassandra.metrics.ThreadPools.+"

You can specifically include or exclude groups of metrics. For example, detailed per column family metrics for a cluster with a single column family might be useful, while excluding them to avoid overwhelming the graphing system might be preferable for a cluster with hundreds of column families. See the metrics-reporter-config library for all of the configuration details.

Example Graphs

Data Load

Data Load graph

A simple stacked graph showing the amount of data stored in a cluster growing over the past month. Presumably new nodes will eventually be required if the trend continues.

Read Latency


Troubleshooting 95th percentile latency on a node that clients detected erratic behavior on. The top blue line is coordinator latency, while the bottom line is latency for satisfying read requests within this node's range. The lack of correlation between the two implies the problem causing the large blue spikes lies elsewhere in the cluster and not with the coordinator that happens to be receiving client requests (or at the least that the problem does not have to do with local IO).

Cache Size


For a newly bootstrapped node, both the number of entries in the RowCache and the graphite calculated derivative showing growth rate.

DataStax has many ways for you to advance in your career and knowledge.

You can take free classes, get certified, or read one of our many white papers.

register for classes

get certified

DBA's Guide to NoSQL


  1. Justin Sweeney says:

    Interesting post. The graphs of metrics coming out of this look promising. Did you notice any impact on Cassandra when reporting out these metrics to something like graphite?

  2. Chris Burroughs says:

    Reporters do their thing in separate threads that only wake up on the order of seconds. Their overhead should be minimal (even less than actually calculating the metrics in the first place).

  3. Peter Fales says:

    In the “Read Latency” graph, which metrics allow you to distinguish between “coordinator latency” and “requests within this node’s range?”

  4. Tom says:

    What would I need to do to use a reporter other than the 4 that are supported by metrics-reporter-config (console, cvs, ganglia and graphite)?

  5. Shekh says:

    metrics-reporter-config is not supporting prefix parameter any plan to add this ?

  6. Brice says:

    The reader should note the importance of color in the predicate section, it indicate if the patterns will whitelist or blacklist the metrics.

    color: “white”

  7. sumit says:

    Hello Team,

    Can you please also explain the configuration(with step ) of ganglia to handle cassandra reporting?

  8. zerth says:

    Grab your favorite reporter jar (such as metrics-graphite) and add it to the server’s lib
    Can you explain where should I add the reporter jar ?

  9. Wenyu says:

    There are other metrics that are not under org.apache.cassandra.metrics.*. I have tried to add the pattern, but it didn’t work. Does that mean only metrics under org.apache.cassandra.metrics.* can be exposed to graphite?

    1. Or says:

      Adding to your question,

      Even if on Cassandra 2.2 all the metrics had moved to org.apache.cassandra.metrics.*, there are still metrics on java.lang.* etc.

      How can I expose them? it didn’t expose them when I put “java.lang.*” on the configuration file.

        1. Ganga says:

          Hi Bhuvan,

          Do you have any pointers why the ClinetRequest.* and storage.* metrices are not emitted ? I tried with ConsoleReporter , CSVReporter and StatsD Reporter, but no luck . I see all other metrics but not these . Btw, I generated writes and reads with Cassandra-stress and CQLSh .

  10. Or says:

    I’m using metrics-graphite-3.1.2.jar on Cassandra 2.2

  11. SC says:

    Aren’t those regular expressions? So instead of:


    It should be:



  12. ganga says:

    Even though reads and writes are there, can’t get metrics related to read/writes under org.apache.cassandra.metrics.ClientRequest via ConsoleReporter (or other reporters like StatsD) where as I can get all the metrics including the following metrics under ClientRequest group connectedNativeClients

    Any insights why read/write specific metrics are not emitted?


Your email address will not be published. Required fields are marked *

Subscribe for newsletter: