Apache Cassandra integration for Grafana Cloud
Apache Cassandra is an open source NoSQL distributed database. This integration for Grafana Cloud allows users to collect metrics and system logs for monitoring an Apache Cassandra instance or clustered deployment.
Metrics include number of nodes in a cluster, virtual memory and cpu usage, read/write latencies, compaction tasks, and garbage collections. It includes useful visualizations for cluster, node, and keyspace metrics.
This integration includes 8 useful alerts and 3 pre-built dashboards to help monitor and visualize Apache Cassandra metrics and logs.
Before you begin
In order for the integration to properly work, you must set up the JMX Exporter for Prometheus on each node in your cluster.
Set up JMX Exporter
Each instance of the JMX Exporter can be run with this Apache Cassandra JMX Exporter configuration file.
For more information on how to configure the JVM on each node, please refer to the JMX Exporter documentation for further configuration details.
Apache Cassandra nodes by default expose 7199
for JMX by default, please make sure the port matches your environment. The JMX URL for the exporter should be properly configured to match your environment e.g. jmxUrl: service:jmx:rmi:///jndi/rmi://localhost:7199/jmxrmi
Once deployed, the Grafana Agent will be able to scrape JMX Exporter.
Install Apache Cassandra integration for Grafana Cloud
- In your Grafana Cloud stack, click Connections.
- Navigate to the Apache Cassandra tile and review the prerequisites. Then click Install integration.
- Once the integration is installed, follow the steps on the Configuration Details page to set up Grafana Agent and start sending Apache Cassandra metrics and logs to your Grafana Cloud instance.
Post-install configuration for the Apache Cassandra integration
After enabling the metrics generation, instruct the Grafana Agent to scrape your Apache Cassandra nodes.
Make sure to change targets
in the snippet according to your environment.
You must configure a custom label for this integration:
cluster
, the value that identifies a Apache Cassandra cluster
You can define a cluster label by adding an extra label to the scrape_configs of the JMX Exporter.
If you want to show logs and metrics signals correlated in your dashboards as a single pane of glass, ensure the following:
job
andinstance
label values must match for the Apache Cassandra integration and logs scrape config in your agent configuration file.job
must be set tointegrations/apache-cassandra
instance
label must be set to a value that uniquely identifies your Apache Cassandra node. Please replace the default hostname value according to your environment - it should be set manually. Note that if you use localhost for multiple nodes, the dashboards will not be able to filter correctly by instance.cluster
must be the value that identifies the Apache Cassandra Cluster this node belongs to.
metrics:
configs:
- scrape_configs:
- job_name: integrations/apache-cassandra
static_configs:
- targets:
- '<node1>:<exporter-port>'
- '<node2>:<exporter-port>'
- '<node3>:<exporter-port>'
labels:
cluster: '<your-cluster-name>'
logs:
configs:
scrape_configs:
- job_name: integrations/apache-cassandra
static_configs:
- targets: [localhost]
labels:
job: integrations/apache-cassandra
instance: '<your-instance-name>:<exporter-port>'
cluster: '<your-cluster-name>'
__path__: /var/log/cassandra/system.log
Dashboards
The Apache Cassandra integration installs the following dashboards in your Grafana Cloud instance to help monitor your system.
- Apache Cassandra keyspaces
- Apache Cassandra nodes
- Apache Cassandra overview
Apache Cassandra overview 1
Apache Cassandra overview 2
Apache Cassandra nodes 1
Alerts
The Apache Cassandra integration includes the following useful alerts:
Alert | Description |
---|---|
HighReadLatency | Critical: There is a high level of read latency within the node. |
HighWriteLatency | Critical: There is a high level of write latency within the node. |
HighPendingCompactionTasks | Warning: Compaction task queue is filling up. |
BlockedCompactionTasksFound | Critical: Compaction task queue is full. |
HintsStoredOnNode | Warning: Hints have been recently written to this node. |
UnavailableWriteRequestsFound | Critical: Unavailable exceptions have been encountered while performing writes in this cluster. |
HighCpuUsage | Critical: A node has a CPU usage higher than the configured threshold. |
HighMemoryUsage | Critical: A node has a higher memory utilization than the configured threshold. |
Metrics
The most important metrics provided by the Apache Cassandra integration, which are used on the dashboards (and Prometheus Alerts and rules) are as follows:
Name | Type | Description |
---|---|---|
cassandra_cache_hitrate | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=HitRate,type=Cache,attribute=Value |
cassandra_cache_size | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=Size,type=Cache,attribute=Value |
cassandra_clientrequest_latency_seconds_count | untyped | Attribute exposed for management org.apache.cassandra.metrics:name=Latency,type=ClientRequest,attribute=Count |
cassandra_clientrequest_timeouts_count | untyped | Attribute exposed for management org.apache.cassandra.metrics:name=Timeouts,type=ClientRequest,attribute=Count |
cassandra_clientrequest_unavailables_count | untyped | Attribute exposed for management org.apache.cassandra.metrics:name=Unavailables,type=ClientRequest,attribute=Count |
cassandra_compaction_pendingtasks | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=PendingTasks,type=Compaction,attribute=Value |
cassandra_connection_largemessageactivetasks | ||
cassandra_connection_largemessagedroppedtasks | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=LargeMessageDroppedTasks,type=Connection,attribute=Value |
cassandra_connection_largemessagependingtasks | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=LargeMessagePendingTasks,type=Connection,attribute=Value |
cassandra_connection_smallmessageactivetasks | ||
cassandra_connection_smallmessagedroppedtasks | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=SmallMessageDroppedTasks,type=Connection,attribute=Value |
cassandra_connection_smallmessagependingtasks | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=SmallMessagePendingTasks,type=Connection,attribute=Value |
cassandra_connection_timeouts_count | untyped | Attribute exposed for management org.apache.cassandra.metrics:name=Timeouts,type=Connection,attribute=Count |
cassandra_down_endpoint_count | gauge | Attribute exposed for management org.apache.cassandra.net:name=null,type=FailureDetector,attribute=DownEndpointCount |
cassandra_keyspace_caspreparelatency_seconds | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=CasPrepareLatency,type=Keyspace,attribute=50thPercentile |
cassandra_keyspace_pendingcompactions | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=PendingCompactions,type=Keyspace,attribute=Value |
cassandra_keyspace_readlatency_seconds | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=ReadLatency,type=Keyspace,attribute=50thPercentile |
cassandra_keyspace_readlatency_seconds_average | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=ReadLatency,type=Keyspace,attribute=Mean |
cassandra_keyspace_readlatency_seconds_count | untyped | Attribute exposed for management org.apache.cassandra.metrics:name=ReadLatency,type=Keyspace,attribute=Count |
cassandra_keyspace_repairjobscompleted_count | ||
cassandra_keyspace_repairjobsstarted_count | ||
cassandra_keyspace_totaldiskspaceused | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=TotalDiskSpaceUsed,type=Keyspace,attribute=Value |
cassandra_keyspace_writelatency_seconds | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=WriteLatency,type=Keyspace,attribute=50thPercentile |
cassandra_keyspace_writelatency_seconds_average | gauge | Attribute exposed for management org.apache.cassandra.metrics:name=WriteLatency,type=Keyspace,attribute=Mean |
cassandra_keyspace_writelatency_seconds_count | untyped | Attribute exposed for management org.apache.cassandra.metrics:name=WriteLatency,type=Keyspace,attribute=Count |
cassandra_keyspace_writelatency_seconds_sum | untyped | Attribute exposed for management org.apache.cassandra.metrics:name=WriteTotalLatency,type=Keyspace,attribute=Count |
cassandra_messaging_crossnodelatency_seconds | ||
cassandra_storage_load_count | untyped | Attribute exposed for management org.apache.cassandra.metrics:name=Load,type=Storage,attribute=Count |
cassandra_storage_totalhints_count | untyped | Attribute exposed for management org.apache.cassandra.metrics:name=TotalHints,type=Storage,attribute=Count |
cassandra_table_maxpartitionsize | ||
cassandra_table_readlatency_seconds_count | ||
cassandra_table_readlatency_seconds_sum | ||
cassandra_threadpools_currentlyblockedtasks_count | untyped | Attribute exposed for management org.apache.cassandra.metrics:name=CurrentlyBlockedTasks,type=ThreadPools,attribute=Count |
cassandra_up_endpoint_count | gauge | Attribute exposed for management org.apache.cassandra.net:name=null,type=FailureDetector,attribute=UpEndpointCount |
jvm_gc_collection_count | gauge | java.lang:name=ConcurrentMarkSweep,type=GarbageCollector,attribute=CollectionCount |
jvm_gc_duration_seconds | gauge | CompositeType for GC info for ConcurrentMarkSweep java.lang:name=ConcurrentMarkSweep,type=GarbageCollector,attribute=duration |
jvm_memory_usage_used_bytes | gauge | java.lang.management.MemoryUsage java.lang:name=null,type=Memory,attribute=used |
jvm_physical_memory_size | gauge | java.lang:name=null,type=OperatingSystem,attribute=TotalPhysicalMemorySize |
jvm_process_cpu_load | gauge | java.lang:name=null,type=OperatingSystem,attribute=ProcessCpuLoad |
Changelog
# 0.0.1 - March 2023
* Initial release
Cost
By connecting your Apache Cassandra instance to Grafana Cloud you might incur charges. To view information on the number of active series that your Grafana Cloud account uses for metrics included in each Cloud tier, see Active series and dpm usage and Cloud tier pricing.