instaclustr / cassandra-exporter

Java agent for exporting Cassandra metrics to Prometheus
Apache License 2.0
73 stars 46 forks source link

Feature: Export keyspace replication factor metrics #91

Open JensRantil opened 4 years ago

JensRantil commented 4 years ago

We have a custom developed Cassandra exporter that uses the system_schema.keyspaces table to export metrics like the following Gauge (containing the replica factor):

$ curl localhost:8080/metrics|grep cassandra_keyspace_replication
# HELP cassandra_keyspace_replication The keyspace replication factor(s) for a keyspace.
# TYPE cassandra_keyspace_replication gauge
cassandra_keyspace_replication{class="org.apache.cassandra.locator.NetworkTopologyStrategy",keyspace="cassandra_pinger",param="Cassandra"} 3
cassandra_keyspace_replication{class="org.apache.cassandra.locator.SimpleStrategy",keyspace="system_auth",param="replication_factor"} 1
...

This might be very useful information to make inventory and alerts on keyspaces that are under replicated (for example system_auth keyspace defaults to 1).