Monitor the Apache Kafka® integration

Use the following commands and JMX operations to monitor the Kafka integration on a running node. For setup instructions, see Integrate Apache Kafka® with Hyper-Converged Database (HCD).

Index status

Check index status using nodetool:

nodetool describecluster | grep INDEX_STATUS

Check HCD logs for Kafka integration messages:

grep -i "kafka" /var/log/cassandra/system.log

Key log prefixes:

  • KafkaReplicator: Index lifecycle events.

  • ReplicatorMutatorInterceptor: Mutation interception.

  • InProcessReplicatorService: Replication pipeline.

  • ContentSummary: Detailed write operation tracking.

Monitor with JMX

Use JConsole, VisualVM, or any JMX monitoring tool to connect to HCD and view the metrics under:

org.apache.cassandra.metrics:type=Table,* (filter by name starting with Kafka)

Kafka metrics

The Kafka integration exposes metrics using JMX for index lifecycle, replication performance, and storage state.

All metrics use the JMX path org.apache.cassandra.metrics:type=Table,keyspace=<ks>,scope=<table>,name=<metric>.

When you query metrics using the Prometheus-compatible endpoint provided by the HCD Management API agent, the agent rewrites metric names to lowercase with underscores and prefixes them with org_apache_cassandra_metrics_table_kafka_. For example, KafkaMutations becomes org_apache_cassandra_metrics_table_kafka_mutations.

Index lifecycle metrics

The index lifecycle counters, which are monotonic totals:

Metric Description

KafkaIndexerInitialBuilds

Total initial builds started.

KafkaIndexerInitialBuildSuccesses

Successful initial builds.

KafkaIndexerInitialBuildFailures

Failed initial builds.

KafkaIndexerRebuilds

Total rebuilds started.

KafkaIndexerRebuildSuccesses

Successful rebuilds.

KafkaIndexerRebuildFailures

Failed rebuilds.

KafkaIndexerInvalidations

Index drops and invalidations.

KafkaIndexerRowsIndexed

Total rows indexed.

KafkaIndexerRowsSkippedNonPrimary

Rows skipped because this node is not the primary replica.

KafkaIndexerRemoteRowsIndexed

Rows indexed from a remote datacenter.

KafkaIndexerRemoteRowsSkippedNonPrimary

Remote rows skipped because this node is not the primary replica.

KafkaIndexerBatchesSubmitted

Total batches submitted.

KafkaIndexerBatchItemsTotal

Total items across all batches.

KafkaIndexerErrors

Indexer operation errors.

KafkaIndexerPrimaryReplicaCheckErrors

Primary replica check errors.

The index lifecycle histograms, which show distributions:

Metric Description

KafkaIndexerInitialBuildDurationMillis

Initial build duration distribution.

KafkaIndexerRebuildDurationMillis

Rebuild duration distribution.

KafkaIndexerBatchSize

Batch size distribution (rows per batch).

The index lifecycle gauges, which show current state:

Metric Description

KafkaIndexerCurrentStatus

Current index status: 0 = UNKNOWN, 1 = BUILD_STARTED, 2 = BUILD_SUCCEEDED, 3 = BUILD_FAILED, 4 = DROPPED.

KafkaIndexerIsBuilding

Whether a build is in progress (0 = false, 1 = true).

KafkaIndexerLastBuildTimestamp

Timestamp of last build completion (milliseconds since epoch).

KafkaIndexerLastErrorTimestamp

Timestamp of last error (milliseconds since epoch).

The index lifecycle rate meters:

Metric Description

KafkaIndexerRowsIndexedRate

Rate of rows indexed (per second).

KafkaIndexerBatchesSubmittedRate

Rate of batches submitted (per second).

KafkaIndexerErrorsRate

Rate of errors (per second).

Replication performance metrics

The replication performance counters, which are monotonic totals:

Metric Description

KafkaMutations

Total mutations processed.

KafkaMutationFailures

Failed mutations.

KafkaBackpressureErrors

Mutations rejected due to storage backpressure.

KafkaLateMutations

Out-of-order (late) mutations received.

KafkaMutationsRecoveredFromLoggedBatch

Mutations recovered from a logged batch.

The replication performance histograms:

Metric Description

KafkaMutationLatencyMicros

Coordinator write latency distribution (microseconds).

The replication performance gauges, which show current state:

Metric Description

KafkaInFlightMutations

Currently coordinating mutations.

KafkaPendingOperations

Operations pending in storage.

KafkaAllowedMutations

Available storage capacity.

Pending mutations storage metrics

The storage counters, which are monotonic totals:

Metric Description

KafkaStorageMutationsStarted

Total mutation STARTs accepted and appended to the commit log.

KafkaStorageMutationsCompleted

Total mutation COMPLETEs appended (pending entries cleared).

KafkaStorageMutationsRejectedFull

Total mutations rejected because the store was full (sum of all rejection reasons).

KafkaStorageMutationsRejectedDiskFull

Mutations rejected due to per-table or shared disk budget exhaustion (subset of KafkaStorageMutationsRejectedFull).

KafkaStorageFlushes

Memtable spills to data segments.

KafkaStorageWalSegmentsRolled

Commit-log segment rolls (new cl-*.log files opened).

KafkaStorageWalForces

Group-commit fsyncs issued (fdatasync calls on the commit log).

KafkaStorageCheckpoints

Checkpoints completed (log compacted and truncated).

KafkaStorageMutationsRecovered

Mutations replayed from the commit log at store open.

The storage histograms and gauges:

Metric Description

KafkaStorageRecordsPerFlush (histogram)

Distribution of records spilled per memtable flush.

KafkaStoragePendingCount

Current number of pending mutations in the store.

KafkaStorageMemtableBytes

Approximate bytes of in-memtable payloads currently held in heap.

KafkaStorageDiskBytes

Bytes currently held on disk (commit logs and data segments).

Deduplication pipeline metrics

When deduplicationEnabled=true, the replicator exports metrics for the background EventsConsumerWorker and for the two Kafka sinks. The primary sink writes to the intermediate events topic, and the worker destination sink writes to the destination topic.

The events consumer worker metrics:

Metric Type Description

KafkaConsumerRecordsProcessed

Counter

Total primary-key events processed from the events topic and sent to the destination topic.

KafkaConsumerRecordsDeduplicated

Counter

Total redundant records dropped by within-batch primary-key deduplication.

KafkaConsumerRecordsErrors

Counter

Total errors encountered during per-primary-key processing and retries.

KafkaConsumerBatchesProcessed

Counter

Total Kafka batches processed and committed.

KafkaConsumerBatchesFailed

Counter

Total Kafka batches that failed during processing or commit.

KafkaConsumerAssignmentChanges

Counter

Total partition assignment changes (assign, revoke, and close).

KafkaConsumerAssignedPartitions

Gauge

Current number of events topic partitions assigned to this worker.

KafkaConsumerPendingKeys

Gauge

Number of unique primary keys currently being processed in the worker pool.

KafkaConsumerBatchSize

Histogram

Distribution of unique primary keys per committed batch.

KafkaConsumerCassandraReadLatencyMicros

Histogram

Latency distribution of LOCAL_QUORUM row reads (microseconds).

KafkaConsumerKafkaWriteLatencyMicros

Histogram

Latency distribution of destination Kafka writes (microseconds).

The sink metrics use the prefix Sink for the destination-topic sink or EventTopicSink for the events-topic sink. For example, SinkOperationsSubmitted and EventTopicSinkOperationsSubmitted.

The sink metrics:

Metric Type Description

<Prefix>OperationsSubmitted

Counter

Total operations submitted to the sink.

<Prefix>OperationsSucceeded

Counter

Total operations acknowledged by Kafka.

<Prefix>OperationsFailed

Counter

Total operations that failed to publish to Kafka.

<Prefix>WriteOperations

Counter

Total row insert and update messages produced (non-null value).

<Prefix>DeleteOperations

Counter

Total tombstone messages produced (null value).

<Prefix>WriteLatencyMicros

Histogram

Latency distribution of Kafka producer acknowledgments (microseconds).

Inspect and manage MBeans with nodetool sjk

Use the JMX beans that the replicator exports to investigate the internal status of the replicator, query pending mutations, and perform administrative operations. You can use nodetool sjk to query and manage these MBeans directly from the command line:

BEAN='com.datastax.replicator.index:type=PendingMutationsStorage,keyspace=KEYSPACE,table=TABLE'

# Get the number of pending mutations
nodetool sjk mx -mg -b "$BEAN" -f PendingCount

# Read the pending-mutations cap
nodetool sjk mx -mg -b "$BEAN" -f MaxPendingCount

# Change the pending-mutations cap at runtime (does not persist across restarts)
nodetool sjk mx -ms -b "$BEAN" -f MaxPendingCount -v 200000

# List pending operations (LSN + primary key)
nodetool sjk mx -mc -b "$BEAN" -op listPendingMutations

# Acknowledge a single LSN
nodetool sjk mx -mc -b "$BEAN" -op acknowledge -a 7:42

# Acknowledge multiple LSNs (repeat -a for each element)
nodetool sjk mx -mc -b "$BEAN" -op acknowledge -a 7:42 -a 7:43 -a 8:0

# Acknowledge all pending mutations (clear all pending items)
nodetool sjk mx -mc -b "$BEAN" -op acknowledgeAll

# Force a checkpoint
nodetool sjk mx -mc -b "$BEAN" -op checkpoint

# Describe the MBean (attributes and operations)
nodetool sjk mx -mi -b "$BEAN"

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2026 | Privacy policy | Terms of use |  Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: Contact IBM