> For the complete documentation index, see [llms.txt](https://docs.bindplane.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bindplane.com/integrations/sources/cassandra.md).

# Cassandra

The Apache Cassandra source collects metrics and logs from Cassandra. Metrics are scraped over JMX using the OpenTelemetry JMX metrics JAR with the `cassandra` target system. Logs are read from Cassandra's system, debug, and garbage collection log files and parsed into structured records.

### Supported Telemetry

| Platform | Metrics | Logs | Traces |
| -------- | ------- | ---- | ------ |
| macOS    | ✓       | ✓    |        |
| Linux    | ✓       | ✓    |        |
| Windows  | ✓       | ✓    |        |

### Prerequisites

#### Metrics (JMX)

* JMX remote access enabled on the Cassandra node, with a reachable JMX/RMI port (default `7199`). By default Cassandra binds JMX to localhost only; enabling remote access requires changing `LOCAL_JMX` in `cassandra-env.sh` and is described in the [Apache Cassandra monitoring documentation](https://cassandra.apache.org/doc/4.1/cassandra/operating/metrics.html).
* The OpenTelemetry JMX metrics JAR present on the collector host (`jar_path`, default `/opt/opentelemetry-java-contrib-jmx-metrics.jar`).
* A Java runtime on the collector host to run the JMX metrics JAR.
* Network reachability from the collector to the Cassandra JMX/RMI port.

#### Logs

* The Cassandra node writing the log files you want to collect (system, debug, garbage collection).
* The collector running on the same host as Cassandra with read access to the log file paths.

### Configuration

<figure><img src="/files/1KRAyKfRkOrx3cMIWZaC" alt="Bindplane docs - Apache Cassandra - image 1"><figcaption></figcaption></figure>

**General**

| Parameter             | Type               | Required | Default               | Description                                            |
| --------------------- | ------------------ | -------- | --------------------- | ------------------------------------------------------ |
| Choose Telemetry Type | Telemetry Selector | No       | `["Logs", "Metrics"]` | Which signals to collect. Valid values: Logs, Metrics. |

**Logs**

Shown when Telemetry Type includes Logs.

| Parameter               | Type    | Required | Default                             | Description                                                                           |
| ----------------------- | ------- | -------- | ----------------------------------- | ------------------------------------------------------------------------------------- |
| System Logs             | Boolean | No       | `true`                              | Enable collection of system logs.                                                     |
| System Log Path(s)      | Strings | Yes      | `["/var/log/cassandra/system.log"]` | File paths to system logs. Shown when System Logs is enabled.                         |
| Debug Logs              | Boolean | No       | `true`                              | Enable collection of debug logs.                                                      |
| Debug Log Path(s)       | Strings | Yes      | `["/var/log/cassandra/debug.log"]`  | File paths to debug logs. Shown when Debug Logs is enabled.                           |
| Garbage Collection Logs | Boolean | No       | `true`                              | Enable collection of garbage collection logs.                                         |
| GC Log Path(s)          | Strings | Yes      | `["/var/log/cassandra/gc.log"]`     | File paths to garbage collection logs. Shown when Garbage Collection Logs is enabled. |

**Metrics**

Shown when Telemetry Type includes Metrics.

| Parameter | Type    | Required | Default     | Description                                             |
| --------- | ------- | -------- | ----------- | ------------------------------------------------------- |
| Address   | String  | No       | `localhost` | IP address or hostname to scrape for Cassandra metrics. |
| Port      | Integer | No       | `7199`      | Port to scrape for Cassandra metrics.                   |

**Advanced**

| Parameter                       | Type                 | Required | Default                                           | Description                                                               |
| ------------------------------- | -------------------- | -------- | ------------------------------------------------- | ------------------------------------------------------------------------- |
| Timezone                        | Timezone             | No       | `UTC`                                             | The timezone to use when parsing timestamps. Shown when collecting Logs.  |
| Start At                        | Enum: beginning, end | No       | `end`                                             | Start reading logs from `beginning` or `end`. Shown when collecting Logs. |
| Parse                           | Boolean              | No       | `true`                                            | Parse the log fields into structured data. Shown when collecting Logs.    |
| JMX Metrics Collection Jar Path | String               | No       | `/opt/opentelemetry-java-contrib-jmx-metrics.jar` | Full path to the JMX metrics jar. Shown when collecting Metrics.          |
| Collection Interval             | Integer              | No       | `60`                                              | How often (seconds) to scrape for metrics. Shown when collecting Metrics. |

### Examples

#### Collect metrics and logs from a local Cassandra node

Collect JMX metrics from Cassandra on the default port and read the system, debug, and garbage collection logs from their default paths on the same host.

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Source
metadata:
  name: cassandra
spec:
  type: cassandra
  parameters:
    - name: telemetry_types
      value: ["Logs", "Metrics"]
    - name: address
      value: localhost
    - name: port
      value: 7199
    - name: enable_system_logs
      value: true
    - name: system_log_path
      value:
        - /var/log/cassandra/system.log
    - name: enable_debug_logs
      value: true
    - name: debug_log_path
      value:
        - /var/log/cassandra/debug.log
    - name: enable_gc_logs
      value: true
    - name: gc_log_path
      value:
        - /var/log/cassandra/gc.log
```

#### Metrics only from a remote node

Scrape JMX metrics from a remote Cassandra node every 30 seconds and disable log collection.

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Source
metadata:
  name: cassandra
spec:
  type: cassandra
  parameters:
    - name: telemetry_types
      value: ["Metrics"]
    - name: address
      value: 10.0.0.21
    - name: port
      value: 7199
    - name: collection_interval
      value: 30
```

### Configuration Tips

* Log collection reads files on the local filesystem, so the collector must run on the same host as Cassandra. JMX metrics can be scraped remotely by setting Address and Port to a reachable JMX/RMI endpoint.
* The JMX metrics JAR and a Java runtime must be present on the collector host. If you store the JAR somewhere other than `/opt/opentelemetry-java-contrib-jmx-metrics.jar`, update the JMX Metrics Collection Jar Path.
* Set Start At to `beginning` to backfill existing log content on first run; leave it at `end` to only collect new entries.

### Troubleshooting

#### Connection refused on the JMX port

Symptoms: metrics do not appear and the collector logs a connection error to the JMX/RMI port.

Solutions:

1. Confirm Cassandra has remote JMX enabled (by default it binds to localhost only) and the JMX/RMI port is reachable from the collector.
2. Verify Address and Port match the node's JMX endpoint and that any firewall allows traffic to the port.

#### Metrics fail to start

Symptoms: the JMX receiver fails to launch or reports a missing JAR.

Solutions:

1. Confirm the JMX metrics JAR exists at the path set in JMX Metrics Collection Jar Path on the collector host.
2. Confirm a Java runtime is installed and on the collector host.

#### No logs collected

Symptoms: log collection is enabled but no log records arrive.

Solutions:

1. Verify the log file paths exist and that the collector has read access to them.
2. Confirm the collector is running on the same host as Cassandra, since logs are read from the local filesystem.

### Standalone Source

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Source
metadata:
  name: cassandra
spec:
  type: cassandra
  parameters:
    - name: telemetry_types
      value: ["Logs", "Metrics"]
    - name: address
      value: localhost
    - name: port
      value: 7199
    - name: jar_path
      value: /opt/opentelemetry-java-contrib-jmx-metrics.jar
    - name: collection_interval
      value: 60
    - name: enable_system_logs
      value: true
    - name: system_log_path
      value:
        - /var/log/cassandra/system.log
    - name: enable_debug_logs
      value: true
    - name: debug_log_path
      value:
        - /var/log/cassandra/debug.log
    - name: enable_gc_logs
      value: true
    - name: gc_log_path
      value:
        - /var/log/cassandra/gc.log
    - name: timezone
      value: UTC
    - name: start_at
      value: end
    - name: parse
      value: true
```

### Related Resources

* [Apache Cassandra monitoring documentation](https://cassandra.apache.org/doc/4.1/cassandra/operating/metrics.html)
* [OpenTelemetry JMX Receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/jmxreceiver)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bindplane.com/integrations/sources/cassandra.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
