Skip to content
This repository was archived by the owner on Jan 14, 2026. It is now read-only.

Commit 9aa3a73

Browse files
authored
Merge pull request #6 from zegelin/doc-updates
Doc updates
2 parents 14c5739 + 6c90480 commit 9aa3a73

2 files changed

Lines changed: 28 additions & 14 deletions

File tree

README.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1-
# cassandra-exporter
1+
# cassandra-exporter [![CircleCI](https://circleci.com/gh/zegelin/cassandra-exporter.svg?style=svg)](https://circleci.com/gh/zegelin/cassandra-exporter)
22

33
*Project Status: beta*
44

5-
[![CircleCI](https://circleci.com/gh/zegelin/cassandra-exporter.svg?style=svg)](https://circleci.com/gh/zegelin/cassandra-exporter)
65

76
## Introduction
87

98
*cassandra-exporter* is a Java agent (with optional standalone mode) that exports Cassandra metrics to [Prometheus](http://prometheus.io).
109

1110
It enables high performance collection of Cassandra metrics and follows the Prometheus best practices for metrics naming and labeling.
1211

13-
For example, the following PromQL query will return an estimate of the number of pending compactions per keyspace, per node.
12+
![Benchamrk Results](doc/benchmark-results.png)
13+
14+
*cassandra-exporter* is fast. In a worst-case benchmark, where the Cassandra schema contains 1000+ tables (resulting in ~174 thousand metrics),
15+
*cassandra-exporter* completes exposition in ~140ms. Compared to the next-best, *jmx_exporter*, which completes exposition in _~8 seconds_.
16+
Other solutions can take _tens of seconds_, during which CPU time is consumed querying JMX and serialising values.
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).
20+
21+
*cassandra-exporter* exports metric families, where the names, labels, metric types (gauge, counter, summary, etc), and value scales
22+
have been hand-tuned to produce easy-to-query output.
23+
24+
For example, the following PromQL query will return an estimate of the number of pending compactions per-keyspace, per-node.
1425

1526
sum(cassandra_table_estimated_pending_compactions) by (cassandra_node, keyspace)
1627

@@ -21,7 +32,7 @@ For example, the following PromQL query will return an estimate of the number of
2132

2233
| Component | Version |
2334
|-----------------|---------------|
24-
| Apache Cassandra| 3.11.2 |
35+
| Apache Cassandra| 3.11.2, 3.11.3 |
2536
| Prometheus | 2.0 and later |
2637

2738
Other Cassandra and Prometheus versions will be tested for compatibility in the future.
@@ -54,10 +65,10 @@ Prometheus metrics will now be available at <http://localhost:9500/metrics>.
5465
In this mode metrics will be queried via JMX which will incur a performance overhead.
5566
The standalone mode was originally designed to assist with benchmarking and development of the exporter.
5667

57-
The set of metrics available should be identical to that of the agent.
68+
The set of metrics available is close to that of the agent -- Gossiper related metrics are unavailable as these aren't readily available over JMX.
5869

5970
Currently some additional metadata labels, such as the table type (table, index, view, etc) attached to the `cassandra_table_*` metrics, are
60-
not available.
71+
not available (this feature has yet to be written).
6172

6273

6374
### Prometheus Configuration
@@ -69,11 +80,12 @@ Configure Prometheus to scrape the endpoint by adding the following to `promethe
6980
7081
- job_name: 'cassandra'
7182
static_configs:
72-
- targets: ['<cassandra node IP>:9500']
83+
- targets: ['<cassandra node IP>:9500', '<cassandra node IP>:9500', '<cassandra node IP>:9500', ...]
7384

7485
See the [Prometheus documentation](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#%3Cscrape_config%3E) for more details on configuring scrape targets.
7586

76-
To view the raw, plain text metrics (in the Prometheus text exposition format), request the endpoint with a HTTP client such as a browser or cURL.
87+
To view the raw, plain text metrics (in the Prometheus text exposition format), request the endpoint
88+
(by default, <http://localhost:9500/metrics>) with a HTTP client such as a browser or cURL.
7789

7890
Experimental JSON output is also provided if the `Accept: application/json` header or `?x-accept=application/json` URL parameter is specified.
7991
The format/structure of the JSON output is subject to change.
@@ -83,7 +95,8 @@ The format/structure of the JSON output is subject to change.
8395

8496
The available command line options may be seen by passing `-h`/`--help`:
8597

86-
Usage: cassandra-exporter [-hV] [--no-global-labels]
98+
Usage: cassandra-exporter-standalone [-hV] [--enable-per-thread-cpu-times]
99+
[--no-fast-float] [--no-global-labels]
87100
[--family-help=VALUE]
88101
[--jmx-password=PASSWORD]
89102
[--jmx-service-url=URL] [--jmx-user=NAME]
@@ -96,7 +109,9 @@ The available command line options may be seen by passing `-h`/`--help`:
96109
'datacenter', 'rack'. The default is to include all
97110
global labels. To disable all global labels use
98111
--no-global-labels.
99-
--no-global-labels Disable all global labels.
112+
--enable-per-thread-cpu-times
113+
Collect per-thread CPU times, where each thread gets its
114+
own time-series. (EXPERIMENTAL)
100115
-e, --exclude=EXCLUSION...
101116
Exclude a metric family or MBean from exposition.
102117
EXCLUSION may be the full name of a metric family
@@ -110,6 +125,8 @@ The available command line options may be seen by passing `-h`/`--help`:
110125
prefixed with '#' are considered comments and are
111126
ignored. This option may be specified more than once
112127
to define multiple exclusions.
128+
--no-fast-float Disable the use of fast float -> ascii conversion.
129+
--no-global-labels Disable all global labels.
113130
-l, --listen=[ADDRESS][:PORT]
114131
Listen address (and optional port). ADDRESS may be a
115132
hostname, IPv4 dotted or decimal address, or IPv6
@@ -138,6 +155,7 @@ The available command line options may be seen by passing `-h`/`--help`:
138155
-h, --help Show this help message and exit.
139156
-V, --version Print version information and exit.
140157

158+
141159
Options may also be provided via an `@`-file:
142160

143161
- *Standalone*
@@ -287,10 +305,6 @@ See the [project issue tracker](https://github.com/zegelin/cassandra-exporter/is
287305
The format writer was complicated and we didn't want to add dependencies on a templating library (e.g. Freemarker) to make it simpler.
288306
Instead the JSON format writer has been improved and optimized with the intent that the data could be consumed by simple static Javascript webapp.
289307

290-
- JVM metrics
291-
292-
Future versions should add support for collecting and exporting JVM metrics (memory, GC pause times, etc).
293-
294308
- Add some example queries
295309
- Add Grafana dashboard templates
296310
- Documentation improvements

doc/benchmark-results.png

28.7 KB
Loading

0 commit comments

Comments
 (0)