github.com/netdata/go.d.plugin@v0.58.1/modules/cassandra/integrations/cassandra.md (about) 1 <!--startmeta 2 custom_edit_url: "https://github.com/netdata/go.d.plugin/edit/master/modules/cassandra/README.md" 3 meta_yaml: "https://github.com/netdata/go.d.plugin/edit/master/modules/cassandra/metadata.yaml" 4 sidebar_label: "Cassandra" 5 learn_status: "Published" 6 learn_rel_path: "Data Collection/Databases" 7 most_popular: False 8 message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" 9 endmeta--> 10 11 # Cassandra 12 13 14 <img src="https://netdata.cloud/img/cassandra.svg" width="150"/> 15 16 17 Plugin: go.d.plugin 18 Module: cassandra 19 20 <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> 21 22 ## Overview 23 24 This collector gathers metrics about client requests, cache hits, and many more, while also providing metrics per each thread pool. 25 26 27 The [JMX Exporter](https://github.com/prometheus/jmx_exporter) is used to fetch metrics from a Cassandra instance and make them available at an endpoint like `http://127.0.0.1:7072/metrics`. 28 29 30 This collector is supported on all platforms. 31 32 This collector supports collecting metrics from multiple instances of this integration, including remote instances. 33 34 35 ### Default Behavior 36 37 #### Auto-Detection 38 39 This collector discovers instances running on the local host that provide metrics on port 7072. 40 41 On startup, it tries to collect metrics from: 42 43 - http://127.0.0.1:7072/metrics 44 45 46 #### Limits 47 48 The default configuration for this integration does not impose any limits on data collection. 49 50 #### Performance Impact 51 52 The default configuration for this integration is not expected to impose a significant performance impact on the system. 53 54 55 ## Metrics 56 57 Metrics grouped by *scope*. 58 59 The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. 60 61 62 63 ### Per Cassandra instance 64 65 These metrics refer to the entire monitored application. 66 67 This scope has no labels. 68 69 Metrics: 70 71 | Metric | Dimensions | Unit | 72 |:------|:----------|:----| 73 | cassandra.client_requests_rate | read, write | requests/s | 74 | cassandra.client_request_read_latency_histogram | p50, p75, p95, p98, p99, p999 | seconds | 75 | cassandra.client_request_write_latency_histogram | p50, p75, p95, p98, p99, p999 | seconds | 76 | cassandra.client_requests_latency | read, write | seconds | 77 | cassandra.row_cache_hit_ratio | hit_ratio | percentage | 78 | cassandra.row_cache_hit_rate | hits, misses | events/s | 79 | cassandra.row_cache_utilization | used | percentage | 80 | cassandra.row_cache_size | size | bytes | 81 | cassandra.key_cache_hit_ratio | hit_ratio | percentage | 82 | cassandra.key_cache_hit_rate | hits, misses | events/s | 83 | cassandra.key_cache_utilization | used | percentage | 84 | cassandra.key_cache_size | size | bytes | 85 | cassandra.storage_live_disk_space_used | used | bytes | 86 | cassandra.compaction_completed_tasks_rate | completed | tasks/s | 87 | cassandra.compaction_pending_tasks_count | pending | tasks | 88 | cassandra.compaction_compacted_rate | compacted | bytes/s | 89 | cassandra.jvm_memory_used | heap, nonheap | bytes | 90 | cassandra.jvm_gc_rate | parnew, cms | gc/s | 91 | cassandra.jvm_gc_time | parnew, cms | seconds | 92 | cassandra.dropped_messages_rate | dropped | messages/s | 93 | cassandra.client_requests_timeouts_rate | read, write | timeout/s | 94 | cassandra.client_requests_unavailables_rate | read, write | exceptions/s | 95 | cassandra.client_requests_failures_rate | read, write | failures/s | 96 | cassandra.storage_exceptions_rate | storage | exceptions/s | 97 98 ### Per thread pool 99 100 Metrics related to Cassandra's thread pools. Each thread pool provides its own set of the following metrics. 101 102 Labels: 103 104 | Label | Description | 105 |:-----------|:----------------| 106 | thread_pool | thread pool name | 107 108 Metrics: 109 110 | Metric | Dimensions | Unit | 111 |:------|:----------|:----| 112 | cassandra.thread_pool_active_tasks_count | active | tasks | 113 | cassandra.thread_pool_pending_tasks_count | pending | tasks | 114 | cassandra.thread_pool_blocked_tasks_count | blocked | tasks | 115 | cassandra.thread_pool_blocked_tasks_rate | blocked | tasks/s | 116 117 118 119 ## Alerts 120 121 There are no alerts configured by default for this integration. 122 123 124 ## Setup 125 126 ### Prerequisites 127 128 #### Configure Cassandra with Prometheus JMX Exporter 129 130 To configure Cassandra with the [JMX Exporter](https://github.com/prometheus/jmx_exporter): 131 132 > **Note**: paths can differ depends on your setup. 133 134 - Download latest [jmx_exporter](https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/) jar file 135 and install it in a directory where Cassandra can access it. 136 - Add 137 the [jmx_exporter.yaml](https://raw.githubusercontent.com/netdata/go.d.plugin/master/modules/cassandra/jmx_exporter.yaml) 138 file to `/etc/cassandra`. 139 - Add the following line to `/etc/cassandra/cassandra-env.sh` 140 ``` 141 JVM_OPTS="$JVM_OPTS $JVM_EXTRA_OPTS -javaagent:/opt/jmx_exporter/jmx_exporter.jar=7072:/etc/cassandra/jmx_exporter.yaml 142 ``` 143 - Restart cassandra service. 144 145 146 147 ### Configuration 148 149 #### File 150 151 The configuration file name for this integration is `go.d/cassandra.conf`. 152 153 154 You can edit the configuration file using the `edit-config` script from the 155 Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory). 156 157 ```bash 158 cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata 159 sudo ./edit-config go.d/cassandra.conf 160 ``` 161 #### Options 162 163 The following options can be defined globally: update_every, autodetection_retry. 164 165 166 <details><summary>Config options</summary> 167 168 | Name | Description | Default | Required | 169 |:----|:-----------|:-------|:--------:| 170 | update_every | Data collection frequency. | 5 | no | 171 | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | 172 | url | Server URL. | http://127.0.0.1:7072/metrics | yes | 173 | username | Username for basic HTTP authentication. | | no | 174 | password | Password for basic HTTP authentication. | | no | 175 | proxy_url | Proxy URL. | | no | 176 | proxy_username | Username for proxy basic HTTP authentication. | | no | 177 | proxy_password | Password for proxy basic HTTP authentication. | | no | 178 | timeout | HTTP request timeout. | 2 | no | 179 | not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no | 180 | tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no | 181 | tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no | 182 | tls_cert | Client TLS certificate. | | no | 183 | tls_key | Client TLS key. | | no | 184 185 </details> 186 187 #### Examples 188 189 ##### Basic 190 191 A basic example configuration. 192 193 ```yaml 194 jobs: 195 - name: local 196 url: http://127.0.0.1:7072/metrics 197 198 ``` 199 ##### HTTP authentication 200 201 Local server with basic HTTP authentication. 202 203 <details><summary>Config</summary> 204 205 ```yaml 206 jobs: 207 - name: local 208 url: http://127.0.0.1:7072/metrics 209 username: foo 210 password: bar 211 212 ``` 213 </details> 214 215 ##### HTTPS with self-signed certificate 216 217 Local server with enabled HTTPS and self-signed certificate. 218 219 <details><summary>Config</summary> 220 221 ```yaml 222 jobs: 223 - name: local 224 url: https://127.0.0.1:7072/metrics 225 tls_skip_verify: yes 226 227 ``` 228 </details> 229 230 ##### Multi-instance 231 232 > **Note**: When you define multiple jobs, their names must be unique. 233 234 Collecting metrics from local and remote instances. 235 236 237 <details><summary>Config</summary> 238 239 ```yaml 240 jobs: 241 - name: local 242 url: http://127.0.0.1:7072/metrics 243 244 - name: remote 245 url: http://192.0.2.1:7072/metrics 246 247 ``` 248 </details> 249 250 251 252 ## Troubleshooting 253 254 ### Debug Mode 255 256 To troubleshoot issues with the `cassandra` collector, run the `go.d.plugin` with the debug option enabled. The output 257 should give you clues as to why the collector isn't working. 258 259 - Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on 260 your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. 261 262 ```bash 263 cd /usr/libexec/netdata/plugins.d/ 264 ``` 265 266 - Switch to the `netdata` user. 267 268 ```bash 269 sudo -u netdata -s 270 ``` 271 272 - Run the `go.d.plugin` to debug the collector: 273 274 ```bash 275 ./go.d.plugin -d -m cassandra 276 ``` 277 278