
[[newts-monitor]]
= Newts Monitoring
:description: Metrics OpenNMS collects to monitor Newts on a Cassandra node: memtables data, latency, pending operations, disk space usage, and more.

This section describes the metrics that {page-component-title} collects to monitor the Newts keyspace from `org.apache.cassandra.metrics.Keyspace` on a Cassandra node.

JMX must be enabled on the Cassandra nodes and made accessible from {page-component-title} to collect these metrics (
see https://docs.datastax.com/en/cassandra/3.0/cassandra/configuration/secureJmxAuthentication.html[Enabling JMX Authentication and Authorization] in the Cassandra documentation).

The data collection process is bound to the agent IP interface whose service name is `JMX-Cassandra-Newts`.
The JMXCollector retrieves MBean entities from the Cassandra node.

== All memtables data size

[caption=]
.Collected data size metrics for all memtables
[cols="1,2"]
|===
| Name  | Description

| AllMemtablesLiveDataSize
| Total amount of live data stored in the memtables (2i and pending flush memtables included) that reside off heap, excluding any data structure overhead.

| AllMemtablesOffHeapDataSize
| Total amount of data stored in the memtables (2i and pending flush memtables included) that reside off heap.

| AllMemtablesOnHeapDataSize
| Total amount of data stored in the memtables (2i and pending flush memtables included) that reside on heap.
|===

== Memtable switch count

[caption=]
.Collected memtable switch count metric
[options="autowidth"]
|===
| Name  | Description

| MemtableSwitchCount
| Number of times flush has resulted in the memtable being switched out.
|===

== Memtable columns count

[caption=]
.Collected metric for number of memtable columns
[options="autowidth"]
|===
| Name  | Description

| MemtableColumnsCount
| Total number of columns present in the memtable.
|===

== Memtable data size

[caption=]
.Collected memtable data size metrics
[cols="1,2"]
|===
| Name  | Description

| MemtableLiveDataSize
| Total amount of live data stored in the memtable, excluding any data structure overhead.

| MemtableOffHeapDataSize
| Total amount of data stored in the memtable that resides off heap, including column-related overhead and partitions overwritten.

| MemtableOnHeapDataSize
| Total amount of data stored in the memtable that resides on-heap, including column-related overhead and partitions overwritten.
|===

== Read and write latency

[caption=]
.Collected read and write latency metrics
[options="autowidth"]
|===
| Name  | Description

| ReadTotalLatency
| Local read metrics

| WriteTotalLatency
| Local write metrics
|===

== Range latency

[caption=]
.Collected rage latency metric
[options="autowidth"]
|===
| Name  | Description

| RangeLatency 99th Percentile
| Local range slice metrics 99th percentile
|===

== Latency

[caption=]
.Collected latency metrics
[options="autowidth"]
|===
| Name  | Description

| CasCommitTotalLatency
| Time spent on Casandra commits since process start.

| CasPrepareTotalLatency
| Time spent on Casandra prepare events since process start.

| CasProposeTotalLatency
| Time spent on Casandra propose events since process start.
|===

== Bloom filter disk space

[caption=]
.Collected bloom filter disk space metric
[options="autowidth"]
|===
| Name  | Description

| BloomFilterDiskSpaceUsed
| Disk space that the bloom filter uses.
|===

== Bloom filter off-heap memory

[caption=]
.Collected bloom filter off-heap memory metric
[options="autowidth"]
|===
| Name  | Description

| BloomFilterOffHeapMemoryUsed
| Off-heap memory that the bloom filter uses.
|===

== Newts memory usage

[caption=]
.Collected Newts memory usage metrics
[options="autowidth"]
|===
| Name  | Description

| CompressionMetadataOffHeapMemoryUsed
| Off-heap memory that the compression metadata uses.

| IndexSummaryOffHeapMemoryUsed
| Off-heap memory that the index summary uses.
|===

== Pending operations

[caption=]
.Collected metrics for pending operations
[options="autowidth"]
|===
| Name  | Description

| PendingCompactions
| Estimated number of pending compactions for this column family.

| PendingFlushes
| Estimated number of pending flushes for this column family.
|===

== Disk space usage

[caption=]
.Collected disk space usage metrics
[options="autowidth"]
|===
| Name  | Description

| TotalDiskSpaceUsed
| Total disk space that the SSTables belonging to this column family use, including obsolete ones waiting to be garbage collected.

| LiveDiskSpaceUsed
| Disk space used by SSTables belonging to this column family.
|===
