<a id="kafka-streams-metrics"></a>

# Kafka Streams Metrics in Confluent Platform

Kafka Streams *metrics* are runtime measurements that a Kafka Streams application
exposes through Java Management Extensions (JMX), organized in a four-level
hierarchy that covers client, stream thread, task, processor node, state
store, RocksDB, and record cache activity. You can also configure Kafka Streams
applications to report these metrics through pluggable reporters such as
Confluent Metrics Reporter.

This hierarchy has the following levels:

1. At the top level, there are client-level metrics for each running Kafka Streams
   client.
2. Each client has *stream threads* with their own metrics.
3. Each stream thread has *tasks* with their own metrics.
4. Each task has a number of *processor nodes* with their own metrics. Also,
   each task has a number of *state stores* and *record caches*, all of which
   have their own metrics.

The following metrics are available:

- [Client metrics](#kafka-streams-metrics-client)
- [Thread metrics](#kafka-streams-metrics-thread)
- [Task metrics](#kafka-streams-metrics-task)
- [Processor node metrics](#kafka-streams-metrics-processor-node)
- [State store metrics](#kafka-streams-metrics-state-store)
- [RocksDB metrics](#kafka-streams-metrics-rocksdb)
- [Record cache metrics](#kafka-streams-metrics-record-cache)

For more information, see
[Monitor Kafka Streams Applications](monitoring.md#streams-monitoring).

<a id="kafka-streams-metrics-client"></a>

## Client metrics

<!-- Metrics documentation: https://kafka.apache.org/documentation/#kafka_streams_client_monitoring -->

All of the following metrics have a recording level of `info`.

<a id="kafka-streams-metrics-client-alive-stream-threads"></a>

### alive-stream-threads

- MBean name: `kafka.streams:type=stream-metrics,client-id=([-.\w]+)`

The current number of alive stream threads that are running or participating in rebalance.

<a id="kafka-streams-metrics-client-application-id"></a>

### application-id

- MBean name: `kafka.streams:type=stream-metrics,client-id=([-.\w]+)`

The application ID of the Kafka Streams client.

<a id="kafka-streams-metrics-client-client-state"></a>

### client-state

- MBean name: `kafka.streams:type=stream-metrics,client-id=([-.\w]+),process-id=([-.\w]+)`

The state of the Kafka Streams client as a number, which is the `ordinal()` of
the corresponding enum.

<a id="kafka-streams-metrics-client-commit-id"></a>

### commit-id

- MBean name: `kafka.streams:type=stream-metrics,client-id=([-.\w]+)`

The version control commit ID of the Kafka Streams client.

<a id="kafka-streams-metrics-client-failed-stream-threads"></a>

### failed-stream-threads

- MBean name: `kafka.streams:type=stream-metrics,client-id=([-.\w]+)`

The number of failed stream threads since the Kafka Streams client started.

<a id="kafka-streams-metrics-client-recording-level"></a>

### recording-level

- MBean name: `kafka.streams:type=stream-metrics,client-id=([-.\w]+),process-id=([-.\w]+)`

The metric recording level, represented as a number. Possible values are:

- 0 = INFO
- 1 = DEBUG
- 2 = TRACE

<a id="kafka-streams-metrics-client-state"></a>

### state

- MBean name: `kafka.streams:type=stream-metrics,client-id=([-.\w]+)`

The state of the Kafka Streams client, represented as a string.

<a id="kafka-streams-metrics-client-topology-description"></a>

### topology-description

- MBean name: `kafka.streams:type=stream-metrics,client-id=([-.\w]+)`

The description of the topology executed in the Kafka Streams client.

<a id="kafka-streams-metrics-client-version"></a>

### version

- MBean name: `kafka.streams:type=stream-metrics,client-id=([-.\w]+)`

The version of the Kafka Streams client.

<a id="kafka-streams-metrics-thread"></a>

## Thread metrics

<!-- Metrics documentation: https://kafka.apache.org/documentation/#kafka_streams_thread_monitoring -->

All of the following metrics have a recording level of `info`.

<a id="kafka-streams-metrics-thread-blocked-time-ns-total"></a>

### blocked-time-ns-total

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The total time the Kafka Streams thread has been blocked on Kafka brokers since it
was started, in nanoseconds (ns).

You can sample this metric periodically and use the difference between
samples to measure the time blocked during an interval. This is useful for
debugging Kafka Streams application performance, because it gives the proportion
of time the application was blocked on Kafka, versus being blocked on
processing messages.

<a id="kafka-streams-metrics-thread-commit-latency-avg"></a>

### commit-latency-avg

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The average execution time for committing across all running tasks of the
current thread, in milliseconds (ms).

<a id="kafka-streams-metrics-thread-commit-latency-max"></a>

### commit-latency-max

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The maximum execution time for committing across all running tasks of the
current thread, in milliseconds (ms).

<a id="kafka-streams-metrics-thread-commit-rate"></a>

### commit-rate

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The average number of commits per second across all running tasks of the
current thread.

<a id="kafka-streams-metrics-thread-commit-ratio"></a>

### commit-ratio

- MBean name: `kafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)`

The fraction of time the thread has spent on committing all tasks.

<a id="kafka-streams-metrics-thread-commit-total"></a>

### commit-total

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The total number of commit calls across all running tasks of the current
thread.

<a id="kafka-streams-metrics-thread-poll-latency-avg"></a>

### poll-latency-avg

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The average execution time for consumer polling across all running tasks of the
current thread, in milliseconds (ms).

<a id="kafka-streams-metrics-thread-poll-latency-max"></a>

### poll-latency-max

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The maximum execution time for consumer polling across all running tasks of the
current thread, in milliseconds (ms).

<a id="kafka-streams-metrics-thread-poll-rate"></a>

### poll-rate

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The average number of consumer poll calls per second across all running tasks
of the current thread.

<a id="kafka-streams-metrics-thread-poll-ratio"></a>

### poll-ratio

- MBean name: `kafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)`

The fraction of time the thread has spent on polling records from consumer.

<a id="kafka-streams-metrics-thread-poll-records-avg"></a>

### poll-records-avg

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The average number of records polled from consumer within an iteration.

<a id="kafka-streams-metrics-thread-poll-records-max"></a>

### poll-records-max

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The maximum number of records polled from consumer within an iteration.

<a id="kafka-streams-metrics-thread-poll-total"></a>

### poll-total

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The total number of consumer poll calls across all tasks.

<a id="kafka-streams-metrics-thread-process-latency-avg"></a>

### process-latency-avg

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The average execution time for processing across all running tasks of the
current thread, in milliseconds (ms).

<a id="kafka-streams-metrics-thread-process-latency-max"></a>

### process-latency-max

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The maximum execution time for processing across all running tasks of the
current thread, in milliseconds (ms).

<a id="kafka-streams-metrics-thread-process-rate"></a>

### process-rate

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The average number of processed records per second across all running tasks of
the current thread.

<a id="kafka-streams-metrics-thread-process-ratio"></a>

### process-ratio

- MBean name: `kafka.streams:type=stream-thread-metrics,client-id=([-.\w]+)`

The fraction of time the thread has spent on processing active tasks.

<a id="kafka-streams-metrics-thread-process-records-avg"></a>

### process-records-avg

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The average number of records processed within an iteration, computed as the
total count of processed records over the total number of iterations.

<a id="kafka-streams-metrics-thread-process-records-max"></a>

### process-records-max

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The maximum number of records processed within an iteration.

<a id="kafka-streams-metrics-thread-process-total"></a>

### process-total

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The total number of processed records across all tasks.

<a id="kafka-streams-metrics-thread-punctuate-latency-avg"></a>

### punctuate-latency-avg

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The average execution time for punctuating across all running tasks of the
current thread, in milliseconds (ms).

<a id="kafka-streams-metrics-thread-punctuate-latency-max"></a>

### punctuate-latency-max

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The maximum execution time for punctuating across all running tasks of the
current thread, in milliseconds (ms).

<a id="kafka-streams-metrics-thread-punctuate-rate"></a>

### punctuate-rate

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The average number of punctuate calls per second across all running tasks of
the current thread.

<a id="kafka-streams-metrics-thread-punctuate-ratio"></a>

### punctuate-ratio

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The fraction of time the thread spends performing punctuating actions on
active tasks.

<a id="kafka-streams-metrics-thread-punctuate-total"></a>

### punctuate-total

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The total number of punctuate calls across all tasks.

<a id="kafka-streams-metrics-thread-state"></a>

### state

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The state of the thread, represented as a string.

<a id="kafka-streams-metrics-thread-task-closed-rate"></a>

### task-closed-rate

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The average number of tasks closed per second.

<a id="kafka-streams-metrics-thread-task-closed-total"></a>

### task-closed-total

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The total number of tasks closed.

<a id="kafka-streams-metrics-thread-task-created-rate"></a>

### task-created-rate

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The average number of newly-created tasks per second.

<a id="kafka-streams-metrics-thread-task-created-total"></a>

### task-created-total

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The total number of newly-created tasks.

<a id="kafka-streams-metrics-thread-start-time"></a>

### thread-start-time

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+)`

The epoch time when the Kafka Streams thread was started, which is useful for
computing the processing ratio during the first interval after the thread
starts.

<a id="kafka-streams-metrics-thread-thread-state"></a>

### thread-state

- MBean name: `kafka.streams:type=stream-thread-metrics,thread-id=([-.\w]+),process-id=([-.\w]+)`

The state of the thread as a number, which is the `ordinal()` of the
corresponding enum.

<a id="kafka-streams-metrics-task"></a>

## Task metrics

<!-- Metrics documentation: https://kafka.apache.org/documentation/#kafka_streams_task_monitoring -->

All of the following metrics have a recording level of `debug`, except for the
`dropped-records-*` and `active-process-ratio` metrics, which have a
recording level of `info`.

All latency metrics are reported in nanoseconds (ns).

<a id="kafka-streams-metrics-task-active-buffer-count"></a>

### active-buffer-count

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The count of buffered records that are polled from consumer and not yet
processed for the current active task.

<a id="kafka-streams-metrics-task-active-process-ratio"></a>

### active-process-ratio

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The fraction of time the thread spent on processing this active task among
all assigned active tasks.

<a id="kafka-streams-metrics-task-cache-size-bytes-total"></a>

### cache-size-bytes-total

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The cache size in bytes accumulated by the current task.

<a id="kafka-streams-metrics-task-dropped-records-rate"></a>

### dropped-records-rate

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The average number of records dropped per second within the current task.

<a id="kafka-streams-metrics-task-dropped-records-total"></a>

### dropped-records-total

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The total number of records dropped within the current task.

<a id="kafka-streams-metrics-task-enforced-processing-rate"></a>

### enforced-processing-rate

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The average number of enforced processings per second for the current task.

<a id="kafka-streams-metrics-task-enforced-processing-total"></a>

### enforced-processing-total

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The total number of enforced processings for the current task.

<a id="kafka-streams-metrics-task-input-buffer-bytes-total"></a>

### input-buffer-bytes-total

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The total number of bytes accumulated by the current task.

<a id="kafka-streams-metrics-task-process-latency-avg"></a>

### process-latency-avg

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The average execution time for processing, in nanoseconds (ns).

<a id="kafka-streams-metrics-task-process-latency-max"></a>

### process-latency-max

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The maximum execution time for processing, in nanoseconds (ns).

<a id="kafka-streams-metrics-task-process-rate"></a>

### process-rate

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The average number of processed records per second across all source processor
nodes of the current task.

<a id="kafka-streams-metrics-task-process-total"></a>

### process-total

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The total number of processed records across all source processor nodes of the
current task.

<a id="kafka-streams-metrics-task-punctuate-latency-avg"></a>

### punctuate-latency-avg

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The average amount of time taken to execute periodic tasks per call to
`punctuate()`, in nanoseconds (ns).

<a id="kafka-streams-metrics-task-punctuate-latency-max"></a>

### punctuate-latency-max

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The maximum amount of time taken for any single call to `punctuate()` to complete,
in nanoseconds (ns).

<a id="kafka-streams-metrics-task-punctuate-rate"></a>

### punctuate-rate

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The average number of calls to `punctuate()` per second.

<a id="kafka-streams-metrics-task-punctuate-total"></a>

### punctuate-total

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The total number of times the `punctuate()` method was called to trigger
periodic actions during task processing.

<a id="kafka-streams-metrics-task-record-lateness-avg"></a>

### record-lateness-avg

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The average observed lateness ([stream time](/platform/current/streams/concepts.html#time) - record timestamp)
for the current task, in milliseconds (ms). For more information on out-of-order records, see
[Out-of-order handling](/platform/current/streams/concepts.html#out-of-order-handling).

<a id="kafka-streams-metrics-task-record-lateness-max"></a>

### record-lateness-max

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The maximum observed lateness ([stream time](/platform/current/streams/concepts.html#time) - record timestamp)
for the current task, in milliseconds (ms). For more information on out-of-order records, see
[Out-of-order handling](/platform/current/streams/concepts.html#out-of-order-handling).

<a id="kafka-streams-metrics-task-record-rate"></a>

### record-rate

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The average number of records restored per second.

<a id="kafka-streams-metrics-task-record-total"></a>

### record-total

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The total number of records restored.

<a id="kafka-streams-metrics-task-update-rate"></a>

### update-rate

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The average number of records updated per second.

<a id="kafka-streams-metrics-task-update-total"></a>

### update-total

- MBean name: `kafka.streams:type=stream-task-metrics,thread-id=([-.\w]+),task-id=([-.\w]+)`

The total number of records updated.

<a id="kafka-streams-metrics-processor-node"></a>

## Processor node metrics

<!-- Metrics documentation: https://kafka.apache.org/documentation/#kafka_streams_node_monitoring -->

The following metrics are available only on certain types of nodes.

- The `emit-final-*` metrics are available only for windowed aggregations
  nodes.
- The `process-rate` and `process-total` metrics are available only for
  source processor nodes.
- The `suppression-emit-rate` and `suppression-emit-total` metrics are
  available only for suppression operation nodes.
- The `record-e2e-latency-*` metrics are available only for source processor
  nodes and terminal nodes, which are nodes without successor nodes.

All of the metrics have a recording level of `debug`, except for the
`record-e2e-latency-*` metrics, which have a recording level of `info`.

<a id="kafka-streams-metrics-processor-node-bytes-consumed-total"></a>

### bytes-consumed-total

- MBean name: `kafka.streams:type=stream-topic-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+),topic=([-.\w]+)`

The total number of bytes consumed by a source processor node.

<a id="kafka-streams-metrics-processor-node-bytes-produced-total"></a>

### bytes-produced-total

- MBean name: `kafka.streams:type=stream-topic-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+),topic=([-.\w]+)`

  The total number of bytes produced by a sink processor node.

<a id="kafka-streams-metrics-processor-node-emit-final-latency-avg"></a>

### emit-final-latency-avg

- MBean name: `kafka.streams:type=stream-processor-node-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+)`

The avg latency to emit final records when a record could be emitted, in milliseconds (ms).

<a id="kafka-streams-metrics-processor-node-emit-final-latency-max"></a>

### emit-final-latency-max

- MBean name: `kafka.streams:type=stream-processor-node-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+)`

The max latency to emit final records when a record could be emitted, in milliseconds (ms).

<a id="kafka-streams-metrics-processor-node-emit-final-records-rate"></a>

### emit-final-records-rate

- MBean name: `kafka.streams:type=stream-processor-node-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+)`

The rate of records emitted per second when records could be emitted.

<a id="kafka-streams-metrics-processor-node-emit-final-records-total"></a>

### emit-final-records-total

- MBean name: `kafka.streams:type=stream-processor-node-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+)`

The total number of records emitted.

<a id="kafka-streams-metrics-processor-node-idempotent-update-skip-rate"></a>

### Idempotent-update-skip-rate

- MBean name: `kafka.streams:type=stream-topic-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+),topic=([-.\w]+)`

The average number of skipped idempotent updates per second.

<a id="kafka-streams-metrics-processor-node-idempotent-update-skip-total"></a>

### Idempotent-update-skip-total

- MBean name: `kafka.streams:type=stream-topic-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+),topic=([-.\w]+)`

The total number of skipped idempotent updates.

<a id="kafka-streams-metrics-processor-node-process-rate"></a>

### process-rate

- MBean name: `kafka.streams:type=stream-processor-node-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+)`

The average number of records processed per second by a source node.

<a id="kafka-streams-metrics-processor-node-process-total"></a>

### process-total

- MBean name: `kafka.streams:type=stream-processor-node-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+)`

The total number of records processed by a source node.

<a id="kafka-streams-metrics-processor-node-record-e2e-latency-avg"></a>

### record-e2e-latency-avg

- MBean name: `kafka.streams:type=stream-processor-node-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+)`

The average end-to-end latency of a record in milliseconds (ms), measured by
comparing the record timestamp with the system time when it has been fully
processed by the node.

<a id="kafka-streams-metrics-processor-node-record-e2e-latency-max"></a>

### record-e2e-latency-max

- MBean name: `kafka.streams:type=stream-processor-node-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+)`

The maximum end-to-end latency of a record in milliseconds (ms), measured by
comparing the record timestamp with the system time when it has been fully
processed by the node.

<a id="kafka-streams-metrics-processor-node-record-e2e-latency-min"></a>

### record-e2e-latency-min

- MBean name: `kafka.streams:type=stream-processor-node-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+)`

The minimum end-to-end latency of a record in milliseconds (ms), measured by
comparing the record timestamp with the system time when it has been fully
processed by the node.

<a id="kafka-streams-metrics-processor-node-records-consumed-total"></a>

### records-consumed-total

- MBean name: `kafka.streams:type=stream-topic-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+),topic=([-.\w]+)`

The total number of records consumed by a source processor node.

<a id="kafka-streams-metrics-processor-node-records-produced-total"></a>

### records-produced-total

- MBean name: `kafka.streams:type=stream-topic-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+),topic=([-.\w]+)`

The total number of records produced by a sink processor node.

<a id="kafka-streams-metrics-processor-node-suppression-emit-rate"></a>

### suppression-emit-rate

- MBean name: `kafka.streams:type=stream-processor-node-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+)`

The rate of records emitted per second that have been emitted downstream from
suppression operation nodes. Compare with the `process-rate` metric to determine how many updates are being suppressed.

<a id="kafka-streams-metrics-processor-node-suppression-emit-total"></a>

### suppression-emit-total

- MBean name: `kafka.streams:type=stream-processor-node-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),processor-node-id=([-.\w]+)`

The total number of records that have been emitted downstream from suppression operation nodes.
Compare with the `process-total` metric to determine how many updates are being suppressed.

<a id="kafka-streams-metrics-state-store"></a>

## State store metrics

<!-- Metrics documentation: https://kafka.apache.org/documentation/#kafka_streams_store_monitoring -->

All of the following metrics have a recording level of `debug`, except for the
`record-e2e-latency-*` metrics, which have a recording level of `trace`, and
`num-open-iterators`, which has a recording level of `info`. The
`store-scope` value is specified in `StoreSupplier#metricsScope()` for your
customized state stores. For built-in state stores, currently Kafka Streams
supports the following metrics:

* `in-memory-state`
* `in-memory-lru-state`
* `in-memory-window-state`
* `in-memory-suppression`: for suppression buffers
* `rocksdb-state`: for RocksDB backed key-value store
* `rocksdb-window-state`: for RocksDB backed window store
* `rocksdb-session-state`: for RocksDB backed session store

Metrics `suppression-buffer-size-avg`, `suppression-buffer-size-max`,
`suppression-buffer-count-avg`, and `suppression-buffer-count-max` are
available only for suppression buffers. All other metrics are not available for
suppression buffers.

All latency metrics are reported in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-all-latency-avg"></a>

### all-latency-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average execution time for the all operation, from iterator create to
close, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-all-latency-max"></a>

### all-latency-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum execution time for the all operation, from iterator create to
close, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-all-rate"></a>

### all-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average all operation rate per second for the current store.

<!-- all-total -->
<!-- -------- -->
<!-- - MBean name: ``kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`` -->
<!-- The total number of all operations for the current store. -->

<a id="kafka-streams-metrics-state-store-delete-latency-avg"></a>

### delete-latency-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average execution time of delete operations, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-delete-latency-max"></a>

### delete-latency-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum execution time of a delete operation, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-delete-rate"></a>

### delete-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of delete operations per second for the current store.

<!-- delete-total -->
<!-- ------------ -->
<!-- - MBean name: ``kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`` -->
<!-- The total number of delete operations for the current store. -->

<a id="kafka-streams-metrics-state-store-flush-latency-avg"></a>

### flush-latency-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average execution time for flush operations in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-flush-latency-max"></a>

### flush-latency-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum execution time for flush operations in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-flush-rate"></a>

### flush-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of flush operations per second for the current store.

<!-- flush-total -->
<!-- ----------- -->
<!-- - MBean name: ``kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`` -->
<!-- The total number of flush operations for the current store. -->

<a id="kafka-streams-metrics-state-store-get-latency-avg"></a>

### get-latency-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average execution time of get operations, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-get-latency-max"></a>

### get-latency-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum execution time of a get operation, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-get-rate"></a>

### get-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of get operations per second for the current store.

<!-- get-total -->
<!-- -------- -->
<!-- - MBean name: ``kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`` -->
<!-- The total number of get operations for the current store. -->

<a id="kafka-streams-metrics-state-store-iterator-duration-avg"></a>

### iterator-duration-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average time spent between creating and closing an iterator, in nanoseconds.

<a id="kafka-streams-metrics-state-store-iterator-duration-max"></a>

### iterator-duration-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum time spent between creating and closing an iterator, in nanoseconds.

<a id="kafka-streams-metrics-state-store-num-open-iterators"></a>

### num-open-iterators

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The current number of iterators on the store that have been created but not
yet closed.

<a id="kafka-streams-metrics-state-store-oldest-iterator-open-since-ms"></a>

### oldest-iterator-open-since-ms

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The UNIX timestamp since the oldest still-open iterator was created, in
milliseconds.

<a id="kafka-streams-metrics-state-store-prefix-scan-latency-avg"></a>

### prefix-scan-latency-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average execution time for the prefix-scan operation, from iterator create
to close, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-prefix-scan-latency-max"></a>

### prefix-scan-latency-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum execution time for the prefix-scan operation, from iterator create
to close, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-prefix-scan-rate"></a>

### prefix-scan-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of prefix scan operations per second for the current store.

<a id="kafka-streams-metrics-state-store-put-all-latency-avg"></a>

### put-all-latency-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average execution time of put-all operations, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-put-all-latency-max"></a>

### put-all-latency-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum execution time of a put-all operation, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-put-all-rate"></a>

### put-all-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of put-all operations per second for the current store.

<!-- put-all-total -->
<!-- ------------- -->
<!-- - MBean name: ``kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`` -->
<!-- The total number of put-all operations for the current store. -->

<a id="kafka-streams-metrics-state-store-put-if-absent-latency-avg"></a>

### put-if-absent-latency-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average execution time of a put-if-absent operation, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-put-if-absent-latency-max"></a>

### put-if-absent-latency-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum execution time of a put-if-absent operation, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-put-if-absent-rate"></a>

### put-if-absent-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of put-if-absent operations per second for the current store.

<a id="kafka-streams-metrics-state-store-put-if-absent-total"></a>

### put-if-absent-total

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The total number of put-if-absent operations for the current store.

<a id="kafka-streams-metrics-state-store-put-latency-avg"></a>

### put-latency-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average execution time of a put operation, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-put-latency-max"></a>

### put-latency-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum execution time of a put operation, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-put-rate"></a>

### put-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of put operations per second for the current store.

<!-- put-total -->
<!-- --------- -->
<!-- - MBean name: ``kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`` -->
<!-- The total number of put operations for the current store. -->

<a id="kafka-streams-metrics-state-store-range-latency-avg"></a>

### range-latency-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average execution time for the range operation, from iterator create to close, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-range-latency-max"></a>

### range-latency-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum execution time for the range operation, from iterator create to close, in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-range-rate"></a>

### range-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of range operations per second for the current store.

<!-- range-total -->
<!-- ----------- -->
<!-- - MBean name: ``kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`` -->
<!-- The total number of range operations for the current store. -->

<a id="kafka-streams-metrics-state-store-record-e2e-latency-avg"></a>

### record-e2e-latency-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average end-to-end latency of a record, in nanoseconds (ns), measured by
comparing its timestamp with the system time when fully processed by the store.

<a id="kafka-streams-metrics-state-store-record-e2e-latency-min"></a>

### record-e2e-latency-min

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The minimum end-to-end latency of a record, in nanoseconds (ns), measured by
comparing its timestamp with the system time when fully processed by the store.

<a id="kafka-streams-metrics-state-store-record-e2e-latency-max"></a>

### record-e2e-latency-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum end-to-end latency of a record, in nanoseconds (ns), measured by
comparing its timestamp with the system time when fully processed by the store.

<a id="kafka-streams-metrics-state-store-restore-latency-avg"></a>

### restore-latency-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average execution time for restore operations in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-restore-latency-max"></a>

### restore-latency-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum execution time for restore operations in nanoseconds (ns).

<a id="kafka-streams-metrics-state-store-restore-rate"></a>

### restore-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of restore operations per second for the current store.

<!-- restore-total -->
<!-- ------------- -->
<!-- - MBean name: ``kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`` -->
<!-- The total number of restore operations for the current store. -->

<a id="kafka-streams-metrics-state-store-suppression-buffer-count-avg"></a>

### suppression-buffer-count-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),in-memory-suppression-id=([-.\w]+)`

The average number of records buffered over the sampling window. This metric
may be useful for choosing a value for `BufferConfig.maxRecords(...)`.

<a id="kafka-streams-metrics-state-store-suppression-buffer-count-max"></a>

### suppression-buffer-count-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),in-memory-suppression-id=([-.\w]+)`

The maximum number of records buffered over the sampling window. This metric
may be useful for choosing a value for `BufferConfig.maxRecords(...)`.

<a id="kafka-streams-metrics-state-store-suppression-buffer-size-avg"></a>

### suppression-buffer-size-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),in-memory-suppression-id=([-.\w]+)`

The average total size of the buffered data over the sampling window, in
bytes. This metric may be useful for choosing a value for
`BufferConfig.maxBytes(...)`.

<a id="kafka-streams-metrics-state-store-suppression-buffer-size-max"></a>

### suppression-buffer-size-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),in-memory-suppression-id=([-.\w]+)`

The maximum total size of the buffered data over the sampling window, in
bytes. This metric may be useful for choosing a value for
`BufferConfig.maxBytes(...)`.

<a id="kafka-streams-metrics-state-store-83-changes"></a>

#### State store metrics changes in Confluent Platform 8.3

The following state store metrics are new in Confluent Platform 8.3 (Kafka Streams 4.3):

- `commit-rate`: The average number of commit operations per second.
  Replaces the deprecated `flush-rate` metric.
- `commit-latency-avg`: The average execution time for commit operations in
  nanoseconds. Replaces the deprecated `flush-latency-avg` metric.
- `commit-latency-max`: The maximum execution time for commit operations in
  nanoseconds. Replaces the deprecated `flush-latency-max` metric.
- `num-keys`: The number of keys in an in-memory state store. This metric
  provides an exact count, unlike `estimate-num-keys` for RocksDB stores
  which provides an approximation. Available only for non-persistent
  (in-memory) state stores. The MBean is registered under the store-type tag
  that matches the in-memory variant:

  | Store variant             | MBean `store-type` tag   |
  |---------------------------|--------------------------|
  | In-memory key-value store | `in-memory`              |
  | In-memory window store    | `in-memory-window`       |
  | In-memory session store   | `in-memory-session`      |

  Example MBean name for an in-memory window store:
  `kafka.streams:type=stream-state-metrics,thread-id=<thread-id>,task-id=<task-id>,in-memory-window-state-id=<store-name>`.

The `flush-rate`, `flush-latency-avg`, and `flush-latency-max` metrics
are deprecated. Use the corresponding `commit-*` metrics instead.

For more information, see
[KIP-1035](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1035%3A+StateStore+Managed+Changelog+Offsets)
and
[KIP-1250](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1250%3A+Add+metric+to+track+size+of+in-memory+state+stores).

<a id="kafka-streams-metrics-rocksdb"></a>

## RocksDB metrics

<!-- Metrics documentation: https://kafka.apache.org/documentation/#kafka_streams_rocksdb_monitoring -->

RocksDB metrics are grouped into statistics-based metrics and properties-based
metrics.

- Statistics-based metrics are recorded from statistics that a RocksDB state
  store collects. Statistics collected by RocksDB provide cumulative
  measurements over time, for example, bytes written to the state store.
- Properties-based metrics are recorded from properties that RocksDB exposes.
  Properties exposed by RocksDB provide current measurements, for example,
  the amount of memory currently used.

The built-in RocksDB state stores have these values for `store-scope`:

* `rocksdb-state`: for RocksDB-backed key-value stores
* `rocksdb-window-state`: for RocksDB-backed window stores
* `rocksdb-session-state`: for RocksDB-backed session stores

**RocksDB Statistics-based Metrics:** All of the following metrics have a
recording level of `debug`, because collecting statistics in
[RocksDB may have an impact on performance](https://github.com/facebook/rocksdb/wiki/Statistics#stats-level-and-performance-costs).

Statistics-based metrics are collected every minute from the RocksDB state
stores.

If a state store consists of multiple RocksDB instances, which is the case for
WindowStores and SessionStores, each metric reports an aggregation over the
RocksDB instances of the state store.

<a id="kafka-streams-metrics-rocksdb-block-cache-data-hit-ratio"></a>

### block-cache-data-hit-ratio

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The ratio of block cache hits for data blocks, relative to all lookups for data
blocks to the block cache.

<a id="kafka-streams-metrics-rocksdb-block-cache-index-hit-ratio"></a>

### block-cache-index-hit-ratio

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The ratio of block cache hits for index blocks, relative to all lookups for
index blocks to the block cache.

<a id="kafka-streams-metrics-rocksdb-block-cache-filter-hit-ratio"></a>

### block-cache-filter-hit-ratio

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The ratio of block cache hits for filter blocks, relative to all lookups for
filter blocks to the block cache.

<a id="kafka-streams-metrics-rocksdb-bytes-written-rate"></a>

### bytes-written-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of bytes written per second to the RocksDB state store.

<a id="kafka-streams-metrics-rocksdb-bytes-written-total"></a>

### bytes-written-total

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The total number of bytes written to the RocksDB state store.

<a id="kafka-streams-metrics-rocksdb-bytes-read-rate"></a>

### bytes-read-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of bytes read per second from the RocksDB state store.

<a id="kafka-streams-metrics-rocksdb-bytes-read-total"></a>

### bytes-read-total

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The total number of bytes read from the RocksDB state store.

<a id="kafka-streams-metrics-rocksdb-bytes-read-compaction-rate"></a>

### bytes-read-compaction-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of bytes read per second during compaction.

<a id="kafka-streams-metrics-rocksdb-bytes-written-compaction-rate"></a>

### bytes-written-compaction-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of bytes written per second during compaction.

<a id="kafka-streams-metrics-rocksdb-compaction-time-avg"></a>

### compaction-time-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average duration of disk compactions, in milliseconds (ms).

<a id="kafka-streams-metrics-rocksdb-compaction-time-min"></a>

### compaction-time-min

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The minimum duration of disk compactions, in milliseconds (ms).

<a id="kafka-streams-metrics-rocksdb-compaction-time-max"></a>

### compaction-time-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum duration of disk compactions, in milliseconds (ms).

<a id="kafka-streams-metrics-rocksdb-memtable-bytes-flushed-rate"></a>

### memtable-bytes-flushed-rate

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average number of bytes flushed per second from the memtable to disk.

<a id="kafka-streams-metrics-rocksdb-memtable-bytes-flushed-total"></a>

### memtable-bytes-flushed-total

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The total number of bytes flushed from the memtable to disk.

<a id="kafka-streams-metrics-rocksdb-memtable-hit-ratio"></a>

### memtable-hit-ratio

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The ratio of memtable hits, relative to all lookups to the memtable.

<a id="kafka-streams-metrics-rocksdb-memtable-flush-time-avg"></a>

### memtable-flush-time-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average duration of memtable flushes to disk, in milliseconds (ms).

<a id="kafka-streams-metrics-rocksdb-memtable-flush-time-min"></a>

### memtable-flush-time-min

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The minimum duration of memtable flushes to disk, in milliseconds (ms).

<a id="kafka-streams-metrics-rocksdb-memtable-flush-time-max"></a>

### memtable-flush-time-max

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The maximum duration of memtable flushes to disk, in milliseconds (ms).

<a id="kafka-streams-metrics-rocksdb-number-open-files"></a>

### number-open-files

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The number of current open files. This metric returns constant -1, because the
RocksDB counter NO_FILE_CLOSES was removed in RocksDB version 9.7.3.

<a id="kafka-streams-metrics-rocksdb-number-file-errors-total"></a>

### number-file-errors-total

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The total number of file errors that occurred.

<a id="kafka-streams-metrics-rocksdb-write-stall-duration-avg"></a>

### write-stall-duration-avg

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The average duration of write stalls, in milliseconds (ms).

<a id="kafka-streams-metrics-rocksdb-write-stall-duration-total"></a>

### write-stall-duration-total

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The total duration of write stalls, in milliseconds (ms).

**RocksDB Properties-based Metrics:** All of the following properties-based
metrics have a recording level of `info` and are recorded when the metrics
are accessed.

If a state store consists of multiple RocksDB instances, which is the case for
WindowStores and SessionStores, each metric reports the sum over all the RocksDB
instances of the state store, except for the block cache metrics, named
`block-cache-*`. The block cache metrics report the sum over all RocksDB
instances if each instance uses its own block cache, and they report the
recorded value from only one instance if a single block cache is shared among
all instances.

<a id="kafka-streams-metrics-rocksdb-background-errors"></a>

### background-errors

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The total number of background errors.

<a id="kafka-streams-metrics-rocksdb-block-cache-capacity"></a>

### block-cache-capacity

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The capacity of the block cache, in bytes.

<a id="kafka-streams-metrics-rocksdb-block-cache-pinned-usage"></a>

### block-cache-pinned-usage

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The memory size for the entries being pinned in the block cache, in bytes.

<a id="kafka-streams-metrics-rocksdb-block-cache-usage"></a>

### block-cache-usage

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The memory size of the entries residing in block cache, in bytes.

<a id="kafka-streams-metrics-rocksdb-compaction-pending"></a>

### compaction-pending

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

This metric reports `1` if at least one compaction is pending, otherwise it
reports `0`.

<a id="kafka-streams-metrics-rocksdb-cur-size-active-mem-table"></a>

### cur-size-active-mem-table

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The approximate size of the active memtable, in bytes.

<a id="kafka-streams-metrics-rocksdb-cur-size-all-mem-tables"></a>

### cur-size-all-mem-tables

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The approximate size of active and unflushed immutable memtables, in bytes.

<a id="kafka-streams-metrics-rocksdb-estimate-num-keys"></a>

### estimate-num-keys

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The estimated number of keys in the active and unflushed immutable memtables
and storage.

<a id="kafka-streams-metrics-rocksdb-estimate-pending-compaction-bytes"></a>

### estimate-pending-compaction-bytes

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The estimated total number of bytes a compaction needs to rewrite on disk to
get all levels down to under target size. Valid only for level compaction.

<a id="kafka-streams-metrics-rocksdb-estimate-table-readers-mem"></a>

### estimate-table-readers-mem

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The estimated memory, in bytes, used for reading Sorted Sequence Tables (SSTs),
excluding memory used in block cache.

<a id="kafka-streams-metrics-rocksdb-live-sst-files-size"></a>

### live-sst-files-size

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The total size in bytes of all Sorted Sequence Table (SST) files that belong to
the latest log-structured merge (LSM) tree.

<a id="kafka-streams-metrics-rocksdb-mem-table-flush-pending"></a>

### mem-table-flush-pending

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

This metric reports `1` if a memtable flush is pending, otherwise it reports
`0`.

<a id="kafka-streams-metrics-rocksdb-num-deletes-active-mem-table"></a>

### num-deletes-active-mem-table

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The number of delete entries in the active memtable.

<a id="kafka-streams-metrics-rocksdb-num-deletes-imm-mem-tables"></a>

### num-deletes-imm-mem-tables

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The number of delete entries in the unflushed immutable memtables.

<a id="kafka-streams-metrics-rocksdb-num-entries-active-mem-table"></a>

### num-entries-active-mem-table

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The number of entries in the active memtable.

<a id="kafka-streams-metrics-rocksdb-num-entries-imm-mem-tables"></a>

### num-entries-imm-mem-tables

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The number of entries in the unflushed immutable memtables.

<a id="kafka-streams-metrics-rocksdb-num-immutable-mem-table"></a>

### num-immutable-mem-table

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The number of immutable memtables that have not yet been flushed.

<a id="kafka-streams-metrics-rocksdb-num-live-versions"></a>

### num-live-versions

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

Number of live versions of the log-structured merge (LSM) tree.

<a id="kafka-streams-metrics-rocksdb-num-running-compactions"></a>

### num-running-compactions

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The number of currently running compactions.

<a id="kafka-streams-metrics-rocksdb-num-running-flushes"></a>

### num-running-flushes

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The number of currently running flushes.

<a id="kafka-streams-metrics-rocksdb-size-all-mem-tables"></a>

### size-all-mem-tables

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The approximate size of active, unflushed immutable, and pinned immutable
memtables, in bytes.

<a id="kafka-streams-metrics-rocksdb-total-sst-files-size"></a>

### total-sst-files-size

- MBean name: `kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)`

The total size in bytes of all Sorted Sequence Table (SST) files.

<a id="kafka-streams-metrics-record-cache"></a>

## Record cache metrics

<!-- Metrics documentation: https://kafka.apache.org/documentation/#kafka_streams_cache_monitoring -->

All of the following metrics have a recording level of `debug`.

<a id="kafka-streams-metrics-record-cache-hit-ratio-avg"></a>

### hit-ratio-avg

- MBean name: `kafka.streams:type=stream-record-cache-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),record-cache-id=([-.\w]+)`

The average cache hit ratio, defined as the ratio of cache read hits over the
total cache read requests.

<a id="kafka-streams-metrics-record-cache-hit-ratio-max"></a>

### hit-ratio-max

- MBean name: `kafka.streams:type=stream-record-cache-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),record-cache-id=([-.\w]+)`

The maximum cache hit ratio, defined as the ratio of cache read hits over the
total cache read requests.

<a id="kafka-streams-metrics-record-cache-hit-ratio-min"></a>

### hit-ratio-min

- MBean name: `kafka.streams:type=stream-record-cache-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),record-cache-id=([-.\w]+)`

The minimum cache hit ratio, defined as the ratio of cache read hits over the
total cache read requests.

## Related content

- [Monitor Kafka Streams Applications](monitoring.md#streams-monitoring)

#### NOTE
This website includes content developed at the [Apache Software Foundation](https://www.apache.org/)
under the terms of the [Apache License v2](https://www.apache.org/licenses/LICENSE-2.0.html).
