Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Cassandra JMX Reference

JMX is how to see inside Cassandra. Every metric the database tracks—request latencies, compaction progress, thread pool utilization, disk usage—is exposed through JMX. When nodetool status runs, it is querying JMX. When Prometheus scrapes metrics, it is reading JMX.

The metric names are verbose (org.apache.cassandra.metrics:type=ClientRequest,scope=Read,name=Latency) but logical once the structure is understood. Most metrics include multiple statistics: count, mean, p50, p75, p95, p99, p999, and rate.

This reference documents the MBeans used in practice, what each metric means, and how to interpret the values.

Cassandra exposes hundreds of metrics through JMX, organized into MBeans (Managed Beans). These metrics provide visibility into:

  • Cluster Health: Node status, gossip, and membership
  • Performance: Latencies, throughput, and resource utilization
  • Storage: Disk usage, compaction, and SSTable statistics
  • Operations: Read/write patterns, cache efficiency
  • Resources: Memory, threads, and connections
Terminal window
# Most nodetool commands use JMX internally
nodetool status
nodetool info
nodetool tpstats
Terminal window
# Connect to local node
jconsole
# Connect to remote node
jconsole cassandra.example.com:7199
Terminal window
# With JMX plugin
visualvm --openjmx cassandra.example.com:7199
import javax.management.*;
import javax.management.remote.*;
String url = "service:jmx:rmi:///jndi/rmi://localhost:7199/jmxrmi";
JMXServiceURL serviceUrl = new JMXServiceURL(url);
JMXConnector connector = JMXConnectorFactory.connect(serviceUrl);
MBeanServerConnection mbsc = connector.getMBeanServerConnection();
// Query all Cassandra metrics
ObjectName pattern = new ObjectName("org.apache.cassandra.metrics:*");
Set<ObjectName> names = mbsc.queryNames(pattern, null);

Cassandra organizes MBeans into these primary domains:

DomainPurpose
org.apache.cassandra.metricsPerformance metrics
org.apache.cassandra.dbDatabase operations
org.apache.cassandra.netNetwork/messaging
org.apache.cassandra.internalInternal operations
org.apache.cassandra.requestRequest handling
MBeanPurposeKey Operations
StorageServiceMBeanCluster operationsBootstrap, decommission, repair
StorageProxyMBeanRequest coordinationTimeout settings
CompactionManagerMBeanCompaction controlStart/stop compaction
ColumnFamilyStoreMBeanTable operationsForce flush, snapshots
GossiperMBeanGossip protocolNode status
StreamManagerMBeanStreaming operationsMonitor transfers
CacheServiceMBeanCache managementKey/row cache
CommitLogMBeanCommit logArchive settings
HintedHandoffManagerMBeanHinted handoffHint delivery
MessagingServiceMBeanInter-node messagingDropped messages


MetricWarningCriticalAction
Heap Usage> 70%> 85%Check GC, reduce load
Pending Compactions> 20> 50Check disk I/O
Dropped Messages> 0> 100/minCheck timeouts
Read Latency (p99)> 50ms> 500msCheck data model
Write Latency (p99)> 10ms> 100msCheck disk I/O
# Read latency (per table)
org.apache.cassandra.metrics:type=Table,keyspace=ks,scope=table,name=ReadLatency
# Write latency (per table)
org.apache.cassandra.metrics:type=Table,keyspace=ks,scope=table,name=WriteLatency
# Compactions pending
org.apache.cassandra.metrics:type=Compaction,name=PendingTasks
# Heap usage
java.lang:type=Memory/HeapMemoryUsage
# Thread pool stats
org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=ReadStage,name=ActiveTasks

Always Monitor:

  1. Request latencies (read/write p99)
  2. Heap usage and GC activity
  3. Pending compactions
  4. Dropped messages
  5. Disk space utilization

Monitor for Capacity:

  1. Request rates
  2. Storage growth
  3. Connection counts
  4. Thread pool utilization

Monitor for Problems:

  1. Timeout exceptions
  2. Unavailable exceptions
  3. Tombstone warnings
  4. Large partition warnings
MetricWarningCritical
Heap Usage70%85%
Disk Usage60%80%
Read Latency p9950ms500ms
Write Latency p9910ms100ms
Pending Compactions2050
Dropped Mutations0100/min
GC Pause Time200ms500ms
Metric TypeIntervalReason
Latencies10-30sHigh granularity needed
Throughput30-60sTrend analysis
Resource usage60sCapacity planning
Compaction60sLong-running operations

While JMX can be accessed directly via nodetool, jconsole, or custom tooling, AxonOps provides automated JMX metric collection with purpose-built Cassandra dashboards and alerting.

AxonOps eliminates the need to manually configure JMX exporters or build dashboards:

Manual JMX ApproachAxonOps
Configure JMX exporter YAML rulesAutomatic—no configuration needed
Build and maintain Grafana dashboardsPre-built Cassandra dashboards
Write custom alerting rulesIntegrated alerting with Cassandra-aware thresholds
Correlate metrics across nodes manuallyUnified cluster view
No historical retention by defaultFull metric history with trends
axon-agent.yml
cassandra:
jmx:
host: localhost
port: 7199

The axon-agent automatically collects all critical Cassandra JMX metrics:

  • Request metrics — Read/write latency percentiles, throughput, timeouts, unavailables
  • Thread pool metrics — Pending tasks, active threads, blocked threads per stage
  • Storage metrics — SSTable counts, disk usage, compaction pending/completed
  • JVM metrics — Heap usage, GC pause times, off-heap memory
  • Table-level metrics — Per-table latency, partition sizes, tombstone counts
  • Streaming metrics — Repair progress, bootstrap/decommission status

See AxonOps Installation for setup instructions and AxonOps Monitoring for dashboard features.


ObjectName compactionManager = new ObjectName(
"org.apache.cassandra.db:type=CompactionManager"
);
mbsc.invoke(compactionManager, "forceUserDefinedCompaction",
new Object[]{"keyspace", "table"},
new String[]{"java.lang.String", "java.lang.String"});
ObjectName storageService = new ObjectName(
"org.apache.cassandra.db:type=StorageService"
);
mbsc.invoke(storageService, "forceKeyspaceFlush",
new Object[]{"keyspace"},
new String[]{"java.lang.String"});
ObjectName storageService = new ObjectName(
"org.apache.cassandra.db:type=StorageService"
);
List<String> liveNodes = (List<String>) mbsc.getAttribute(
storageService, "LiveNodes"
);