How to connect Prometheus to Cassandra

I’m trying to use this [Cassandra detail dashboard]( Dashboards | Grafana Labs 371) on a cassandra node. The steps I have done for this to work were:
Grafana service up & running accesible at http://grafana.staged-by-discourse.com
Prometheus as a data source available at http://localhost:9090
Import this dashboard using URL from Grafana Home - Import

The dashboard itself imported fine. but there is no data. Obviously because so far I have’nt told cassandra to save or send metrics.

Could anyone tell me what I’m missing here. As you may tell I’m new to grafana & prometheus Thanks.

Think you need node exporter plugin for cassandra (node exporter is metrics collector for Prometheus)

I followed above steps and installed node exported plugin …still not geting data from cassandra


Could you please help how i can export cassandra data to grafana

make sure the node exporter cassandra plugin is working and able to collect metrics

Its working
root 10678 1 0 Jul31 ? 00:00:26 ./node_exporter
root 22804 18076 0 08:32 pts/4 00:00:00 grep --color=auto -i node_exporter

Node exporter is running and able to get the data but for cassandra data it is not pulling.
Could you please help me is there any steps need to follow to get cassandra nodes data

Please find screenshot …other data it is collecting.

But for cassandra it is not collecting data

you need to ask the people behind the cassandra node exporter plugin, we are not familiar with it and are unsure what could be the reasons for this node exporter plugin not collecting data.

In order to expose Cassandra metrics, you first need to pull the jmx data from cassandra via promehtues jmx exporter.

you can see an example here

Hi Sreenath…I need the exact same graph for Cassandra.I have already setup Prometheus with node exporter, but that is not helping me to get Cassandra related graphs.Did you install JMX installer to get those graphs.Can you guide me with the steps how you got those graphs for cassandra

Hi Sunitha,

Yes i installed JMX exporter.

Step1:
#wget https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.10/jmx_prometheus_javaagent-0.10.jar

#wget https://raw.githubusercontent.com/prometheus/jmx_exporter/master/example_configs/cassandra.yml

Note:Check for the latest version and install.

#chown cassandra:cassandra jmx_prometheus_javaagent-0.10.jar

Step2:Add below line at the end of “cassandra-env.sh”:
JVM_OPTS="$JVM_OPTS -Dcassandra.metricsReporterConfigFile=metrics_reporter_graphite.yaml"

Step3:Restart cassandra

Step4:If you visit http://localhost:7070/metrics you’ll see the metrics.

Step5: Add below lines to prometheus.yml

  • job_name: ‘cassandra’
    static_configs:
    • targets: [‘ip:7070’]

Step6: Restart prometheus and check

Thank you sreenath.I will try the steps.
In step 2 you have mentioned about “metrics_reporter_graphite.yaml”.From where I will get this file

Hi Sunitha,
Sorry for confusion that line for graphite.

For prometheus you have to use:
#Add at the end
vi cassandra-env.sh
JVM_OPTS=“$JVM_OPTS -javaagent:/etc/cassandra/jmx_prometheus_javaagent-0.10.jar=7070:/etc/cassandra/cassandra.yml”

Hey Sreenath,

Did you get it worked by any chance? I’m stuck at the same level but with two errors in grafana dashboard
? “multiple series error” in node status
? “datasource name prometheus was not found” in all other cassandra graphs.

However, JVM heap size, pending compaction, pending threads are showing the proper values.
Also, gafana dashboard and prometheus is working fine for other DBMS like MySQL

.
Please let us know if you’re able to make it work by any chance.

@sidsagravat is JMX exporter is downloaded and can you pls provide cassandra-env.sh file still if it is not working

Was this resolved. I have the same issue nothing comes to the dashboard but when you edit I see the vale’s show up.

Hi @sreenath did you ever get grafana to retrieve data from cassandra using the steps provided?

I also tried but not getting the complete metrics like cpu usage, memory, disk usage, reads and writes. If any one tell , which exporter we use to get the metrics from cassandra