Parul Chourasia
Parul Chourasia

Reputation: 117

how to integrate dropwizard metrics for monitoring cassandra database

I want to monitor health of my cassandra cluster. And got to know about dropwizard metrics, but dont know how to integrate dropwizard metrics with my cassandra cluster to monitor it. For this I want to use JMX as metrics reporter,graphite as metrics collector and Grafana as visualization GUI can anyone help me here please.

Upvotes: 1

Views: 503

Answers (1)

Andy Tolbert
Andy Tolbert

Reputation: 11638

Cassandra itself uses dropwizard Metrics and has a pluggable reporting interface since 2.0.2 (announcement post). 'Monitoring Apache Cassandra Metrics With Graphite and Grafana' gives a good overview on how to configure Cassandra to report metrics to graphite:

1). Download Graphite metrics reporter jar file

2). Put the downloaded jar file in Cassandra library folder, e.g. /usr/share/cassandra/lib/ (the default Cassandra library folder under packaged installation on Ubuntu 14.0.4)

3). Create a metrics reporter configuration file (e.g. metrics_reporter_graphite.yaml) and put it under the same folder as cassandra.yaml file, e.g. /etc/cassandra/ (the default Cassandra configuration folder under packaged installation on Ubuntu 14.0.4).

graphite:
  -
    period: 30
    timeunit: 'SECONDS'
    prefix: 'cassandra-clustername-node1'
    hosts:
     - host: 'localhost'
       port: 2003
    predicate:
      color: 'white'
      useQualifiedName: true
      patterns:
        - '^org.apache.cassandra.+'
        - '^jvm.+'

4). Modify cassandra-env.sh file to include the following JVM option:

METRICS_REPORTER_CFG="metrics_reporter_graphite.yaml"
JVM_OPTS="$JVM_OPTS -Dcassandra.metricsReporterConfigFile=$METRICS_REPORTER_CFG"

5). Restart Cassandra service

Upvotes: 2

Related Questions