You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*cassandra-exporter* is a Java agent (with optional standalone mode) that exports Cassandra metrics to [Prometheus](http://prometheus.io).
4
+
3
5
*Project Status: beta*
4
6
5
7
6
8
## Introduction
7
9
8
-
*cassandra-exporter* is a Java agent (with optional standalone mode) that exports Cassandra metrics to [Prometheus](http://prometheus.io).
9
-
10
-
It enables high performance collection of Cassandra metrics and follows the Prometheus best practices for metrics naming and labeling.
10
+
*cassandra-exporter* enables high performance collection of Cassandra metrics and follows the Prometheus best practices for metrics naming and labeling.
11
11
12
12

13
13
14
14
*cassandra-exporter* is fast. In a worst-case benchmark, where the Cassandra schema contains 1000+ tables (resulting in ~174 thousand metrics),
15
15
*cassandra-exporter* completes exposition in ~140ms. Compared to the next-best, *jmx_exporter*, which completes exposition in _~8 seconds_.
16
16
Other solutions can take _tens of seconds_, during which CPU time is consumed querying JMX and serialising values.
17
17
18
-
There is no caching involved -- all metrics exposed by *cassandra-exporter* are live
19
-
(except `cassandra_table_snapshots_size_total_bytes`, which is expensive to query).
18
+
See the [Exported Metrics](https://github.com/instaclustr/cassandra-exporter/wiki/Exported-Metrics) wiki page for a list of available metrics.
19
+
20
+
All but a few select metrics exposed by *cassandra-exporter* are live with no caching involved.
21
+
The few that are cached are done so for performance reasons.
22
+
23
+
24
+
20
25
21
26
*cassandra-exporter* exports metric families, where the names, labels, metric types (gauge, counter, summary, etc), and value scales
22
27
have been hand-tuned to produce easy-to-query output.
@@ -95,23 +100,46 @@ The format/structure of the JSON output is subject to change.
95
100
96
101
The available command line options may be seen by passing `-h`/`--help`:
or custom), 'INDEX_CLASS' (the index class name for
130
+
custom indexes), 'COMPACTION_STRATEGY_CLASS' (for
131
+
tables & views, compaction-related metrics only). The
132
+
default is to include all table labels. To disable all
133
+
table labels use --no-table-labels.
112
134
--enable-per-thread-cpu-times
113
135
Collect per-thread CPU times, where each thread gets its
114
136
own time-series. (EXPERIMENTAL)
137
+
--enable-collector-timing
138
+
Record the cumulative time taken to run each collector
139
+
and export the results.
140
+
--exclude-keyspaces=<excludedKeyspaces>
141
+
142
+
--no-global-labels Disable all global labels.
115
143
-e, --exclude=EXCLUSION...
116
144
Exclude a metric family or MBean from exposition.
117
145
EXCLUSION may be the full name of a metric family
@@ -125,8 +153,10 @@ The available command line options may be seen by passing `-h`/`--help`:
125
153
prefixed with '#' are considered comments and are
126
154
ignored. This option may be specified more than once
127
155
to define multiple exclusions.
156
+
--no-table-labels Disable all table labels.
128
157
--no-fast-float Disable the use of fast float -> ascii conversion.
129
-
--no-global-labels Disable all global labels.
158
+
--exclude-system-tables
159
+
Exclude system table/keyspace metrics.
130
160
-l, --listen=[ADDRESS][:PORT]
131
161
Listen address (and optional port). ADDRESS may be a
132
162
hostname, IPv4 dotted or decimal address, or IPv6
@@ -146,16 +176,23 @@ The available command line options may be seen by passing `-h`/`--help`:
146
176
bandwidth. Can be overridden with the "?
147
177
help=true|false" URI query parameter. Valid values:
148
178
INCLUDE, EXCLUDE, AUTOMATIC. Defaults to AUTOMATIC.
149
-
--jmx-service-url=URL The JMX service URL of the Cassandra instance to connect
150
-
to and collect metrics. Defaults to 'service:jmx:rmi:
179
+
--jmx-service-url=URL JMX service URL of the Cassandra instance to connect to
180
+
and collect metrics. Defaults to 'service:jmx:rmi:
151
181
///jndi/rmi://localhost:7199/jmxrmi'
152
-
--jmx-user=NAME The JMX authentication user name.
182
+
--jmx-user=NAME JMX authentication user name.
153
183
--jmx-password=PASSWORD
154
-
The JMX authentication password.
184
+
JMX authentication password.
185
+
--cql-address=[ADDRESS][:PORT]
186
+
Address/hostname and optional port for the CQL metadata
187
+
connection. Defaults to 'localhost:9042'
188
+
--cql-user=NAME CQL authentication user name.
189
+
--cql-password=PASSWORD
190
+
CQL authentication password.
155
191
-h, --help Show this help message and exit.
156
192
-V, --version Print version information and exit.
157
193
158
194
195
+
159
196
Options may also be provided via an `@`-file:
160
197
161
198
-*Standalone*
@@ -168,7 +205,9 @@ Options may also be provided via an `@`-file:
168
205
169
206
`@$CASSANDRA_CONF/cassandra-exporter.options` is a good choice.
170
207
171
-
Note that `--jmx-service-url`, `--jmx-user` and `--jmx-password` are only applicable to the standalone version -- the agent does not use JMX.
208
+
Note that `--jmx-service-url`, `--jmx-user`, `--jmx-password`, `--cql-address`, `--cql-user` and `--cql-password`
209
+
are only applicable to the standalone version -- the agent does not use JMX or CQL connections.
210
+
172
211
To protect the JMX password and prevent it from showing up in `ps`, `top` and other utilities, use an `@`-file that contains `--jmx-password=PASSWORD`.
173
212
174
213
When run as an agent, command line options must be provided as part of the `-javaagent` flag, with an equals sign (`=`) separating the JAR path and the agent options.
@@ -213,11 +252,13 @@ For exporters that run as a separate process there is additional overhead of int
213
252
214
253
### Best practices
215
254
216
-
The exporter follows Prometheus best practices for metric names, labels and data types.
255
+
The exporter attempts to follow Prometheus' best practices for metric names, labels and data types.
217
256
218
-
Aggregate metrics, such as the aggregated table metrics at the keyspace and node level, are skipped. Instead these should be aggregated using PromQL queries or Prometheus recording rules.
257
+
Cassandras built-in aggregate metrics, such as the table-related metrics at the keyspace and node level, are skipped.
258
+
Instead only the table-level metrics are exported — aggregates can be computed on-the-fly using PromQL queries or once using Prometheus recording rules.
219
259
220
-
Metrics are coalesced when appropriate so they share the same name, opting for *labels* to differentiate indiviual time series. For example, each table level metric has a constant name and at minimum a `table` & `keyspace` label, which allows for complex PromQL queries.
260
+
Unlike the metrics exported via JMX, where each table metric has a unique name, Cassandras metrics are coalesced when appropriate so they share the same exported metric family name, opting for *labels* to differentiate individual time series.
261
+
For example, each table level metric has a constant name and at minimum a `table` & `keyspace` label, which allows for complex PromQL queries.
221
262
222
263
For example the `cassandra_table_operation_latency_seconds[_count|_sum]` summary metric combines read, write, range read, CAS prepare, CAS propose and CAS commit latency metrics together into a single metric family.
223
264
A summary exposes percentiles (via the `quantile` label), a total count of recorded samples (via the `_count` metric),
@@ -256,33 +297,33 @@ Element | Value
256
297
### Global Labels
257
298
258
299
The exporter does attach global labels to the exported metrics.
259
-
These may be configured with the `--global-labels` CLI option.
300
+
These may be configured with the `--global-labels`(or disabled via `--no-global-labels) CLI option.
260
301
261
302
These labels are:
262
303
263
-
-`cassandra_cluster_name`
304
+
-`cassandra_cluster`
264
305
265
-
The name of the cluster, as specified in cassandra.yaml
306
+
The name of the cluster, as specified in cassandra.yaml.
266
307
267
308
-`cassandra_host_id`
268
309
269
-
The unique UUID of the node
310
+
The unique UUID of the node. _Not enabled by default_
270
311
271
312
-`cassandra_node`
272
313
273
-
The IP address of the node
314
+
The IP address of the node.
274
315
275
316
-`cassandra_datacenter`
276
317
277
-
The configured data center name of the node
318
+
The configured data center name of the node.
278
319
279
320
-`cassandra_rack`
280
321
281
-
The configured rack name of the node
322
+
The configured rack name of the node.
282
323
283
324
These labels allow aggregation of metrics at the cluster, data center and rack levels.
284
325
285
-
While these labels could be defined in the prometheus scrape config, we feel that having these labels be automatically
326
+
While these labels could be defined in the Prometheus scrape config, we feel that having these labels be automatically
286
327
applied simplifies things, especially when Prometheus is monitoring multiple clusters across numerous DCs and racks.
287
328
288
329
@@ -303,13 +344,12 @@ See the [project issue tracker](https://github.com/instaclustr/cassandra-exporte
303
344
Early versions supported outputting metrics as a HTML document for easier viewing in a browser.
304
345
305
346
The format writer was complicated and we didn't want to add dependencies on a templating library (e.g. Freemarker) to make it simpler.
306
-
Instead the JSON format writer has been improved and optimized with the intent that the data could be consumed by simple static Javascript webapp.
347
+
Instead the JSON format writer has been improved and optimized with the intent that the data could be consumed by simple static JavaScript webapp.
0 commit comments