This is an automated email from the ASF dual-hosted git repository.
ableegoldman pushed a commit to branch 2.7
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/2.7 by this push:
new 30ce0ea KAFKA-9924: Add docs for RocksDB properties-based metrics
(#9895)
30ce0ea is described below
commit 30ce0ea7b827a4552ad0415fbd33a7414963f51c
Author: Bruno Cadonna <[email protected]>
AuthorDate: Tue Jan 19 22:30:23 2021 +0100
KAFKA-9924: Add docs for RocksDB properties-based metrics (#9895)
Document the new properties-based metrics for RocksDB
Reviewers: Leah Thomas <[email protected]>, Anna Sophie Blee-Goldman
<[email protected]>
---
docs/ops.html | 147 ++++++++++++++++++++-
.../state/internals/metrics/RocksDBMetrics.java | 6 +-
2 files changed, 146 insertions(+), 7 deletions(-)
diff --git a/docs/ops.html b/docs/ops.html
index 2249ae2..05276e9 100644
--- a/docs/ops.html
+++ b/docs/ops.html
@@ -2013,10 +2013,11 @@ dropped-records-rate and dropped-records-total which
have a recording level of <
</table>
<h5 class="anchor-heading"><a id="kafka_streams_rocksdb_monitoring"
class="anchor-link"></a><a href="#kafka_streams_rocksdb_monitoring">RocksDB
Metrics</a></h5>
- All of the following metrics have a recording level of <code>debug</code>.
- The metrics are collected every minute from the RocksDB state stores.
- If a state store consists of multiple RocksDB instances as it is the case
for aggregations over time and session windows,
- each metric reports an aggregation over the RocksDB instances of the state
store.
+ RocksDB metrics are grouped into statistics-based metrics and
properties-based metrics.
+ The former are recorded from statistics that a RocksDB state store collects
whereas the latter are recorded from
+ properties that RocksDB exposes.
+ Statistics collected by RocksDB provide cumulative measurements over time,
e.g. bytes written to the state store.
+ Properties exposed by RocksDB provide current measurements, e.g., the amount
of memory currently used.
Note that the <code>store-scope</code> for built-in RocksDB state stores are
currently the following:
<ul>
<li><code>rocksdb-state</code> (for RocksDB backed key-value store)</li>
@@ -2024,6 +2025,14 @@ dropped-records-rate and dropped-records-total which
have a recording level of <
<li><code>rocksdb-session-state</code> (for RocksDB backed session
store)</li>
</ul>
+ <strong>RocksDB Statistics-based Metrics:</strong>
+ All of the following statistics-based metrics have a recording level of
<code>debug</code> because collecting
+ statistics in <a
href="https://github.com/facebook/rocksdb/wiki/Statistics#stats-level-and-performance-costs">RocksDB
+ may have an impact on performance</a>.
+ Statistics-based metrics are collected every minute from the RocksDB state
stores.
+ If a state store consists of multiple RocksDB instances, as is the case for
WindowStores and SessionStores,
+ each metric reports an aggregation over the RocksDB instances of the state
store.
+
<table class="data-table">
<tbody>
<tr>
@@ -2114,6 +2123,136 @@ dropped-records-rate and dropped-records-total which
have a recording level of <
</tbody>
</table>
+ <strong>RocksDB Properties-based Metrics:</strong>
+ All of the following properties-based metrics have a recording level of
<code>info</code> and are recorded when the
+ metrics are accessed.
+ If a state store consists of multiple RocksDB instances, as 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
+ <code>block-cache-*</code>. 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.
+
+ <table class="data-table">
+ <tbody>
+ <tr>
+ <th>Metric/Attribute name</th>
+ <th>Description</th>
+ <th>Mbean name</th>
+ </tr>
+ <tr>
+ <td>num-immutable-mem-table</td>
+ <td>The number of immutable memtables that have not yet been
flushed.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>cur-size-active-mem-table</td>
+ <td>The approximate size of the active memtable in bytes.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>cur-size-all-mem-tables</td>
+ <td>The approximate size of active and unflushed immutable memtables in
bytes.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>size-all-mem-tables</td>
+ <td>The approximate size of active, unflushed immutable, and pinned
immutable memtables in bytes.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>num-entries-active-mem-table</td>
+ <td>The number of entries in the active memtable.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>num-entries-imm-mem-tables</td>
+ <td>The number of entries in the unflushed immutable memtables.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>num-deletes-active-mem-table</td>
+ <td>The number of delete entries in the active memtable.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>num-deletes-imm-mem-tables</td>
+ <td>The number of delete entries in the unflushed immutable
memtables.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>mem-table-flush-pending</td>
+ <td>This metric reports 1 if a memtable flush is pending, otherwise it
reports 0.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>num-running-flushes</td>
+ <td>The number of currently running flushes.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>compaction-pending</td>
+ <td>This metric reports 1 if at least one compaction is pending,
otherwise it reports 0.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>num-running-compactions</td>
+ <td>The number of currently running compactions.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>estimate-pending-compaction-bytes</td>
+ <td>The estimated total number of bytes a compaction needs to rewrite on
disk to get all levels down to under
+ target size (only valid for level compaction).</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>total-sst-files-size</td>
+ <td>The total size in bytes of all SST files.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>live-sst-files-size</td>
+ <td>The total size in bytes of all SST files that belong to the latest
LSM tree.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>num-live-versions</td>
+ <td>Number of live versions of the LSM tree.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>block-cache-capacity</td>
+ <td>The capacity of the block cache in bytes.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>block-cache-usage</td>
+ <td>The memory size of the entries residing in block cache in bytes.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>block-cache-pinned-usage</td>
+ <td>The memory size for the entries being pinned in the block cache in
bytes.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>estimate-num-keys</td>
+ <td>The estimated number of keys in the active and unflushed immutable
memtables and storage.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>estimate-table-readers-mem</td>
+ <td>The estimated memory in bytes used for reading SST tables, excluding
memory used in block cache.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ <tr>
+ <td>background-errors</td>
+ <td>The total number of background errors.</td>
+
<td>kafka.streams:type=stream-state-metrics,thread-id=([-.\w]+),task-id=([-.\w]+),[store-scope]-id=([-.\w]+)</td>
+ </tr>
+ </tbody>
+ </table>
+
<h5 class="anchor-heading"><a id="kafka_streams_cache_monitoring"
class="anchor-link"></a><a href="#kafka_streams_cache_monitoring">Record Cache
Metrics</a></h5>
All of the following metrics have a recording level of <code>debug</code>:
diff --git
a/streams/src/main/java/org/apache/kafka/streams/state/internals/metrics/RocksDBMetrics.java
b/streams/src/main/java/org/apache/kafka/streams/state/internals/metrics/RocksDBMetrics.java
index 998304e..a30a891 100644
---
a/streams/src/main/java/org/apache/kafka/streams/state/internals/metrics/RocksDBMetrics.java
+++
b/streams/src/main/java/org/apache/kafka/streams/state/internals/metrics/RocksDBMetrics.java
@@ -131,7 +131,7 @@ public class RocksDBMetrics {
private static final String CURRENT_SIZE_OF_ACTIVE_MEMTABLE_DESCRIPTION =
"Approximate size of active memtable in bytes";
private static final String CURRENT_SIZE_OF_ALL_MEMTABLES_DESCRIPTION =
- "Approximate size of active and unflushed immutable memtable in bytes";
+ "Approximate size of active and unflushed immutable memtables in
bytes";
private static final String SIZE_OF_ALL_MEMTABLES_DESCRIPTION =
"Approximate size of active, unflushed immutable, and pinned immutable
memtables in bytes";
private static final String MEMTABLE_FLUSH_PENDING_DESCRIPTION =
@@ -145,14 +145,14 @@ public class RocksDBMetrics {
private static final String TOTAL_SST_FILE_SIZE_DESCRIPTION = "Total size
in bytes of all SST files";
private static final String LIVE_SST_FILES_SIZE_DESCRIPTION =
"Total size in bytes of all SST files that belong to the latest LSM
tree";
- private static final String NUMBER_OF_LIVE_VERSIONS_DESCRIPTION = "Number
of live versions";
+ private static final String NUMBER_OF_LIVE_VERSIONS_DESCRIPTION = "Number
of live versions of the LSM tree";
private static final String CAPACITY_OF_BLOCK_CACHE_DESCRIPTION =
"Capacity of the block cache in bytes";
private static final String USAGE_OF_BLOCK_CACHE_DESCRIPTION =
"Memory size of the entries residing in block cache in bytes";
private static final String PINNED_USAGE_OF_BLOCK_CACHE_DESCRIPTION =
"Memory size for the entries being pinned in the block cache in bytes";
private static final String ESTIMATED_NUMBER_OF_KEYS_DESCRIPTION =
- "Estimated number of total keys in the active and unflushed immutable
memtables and storage";
+ "Estimated number of keys in the active and unflushed immutable
memtables and storage";
private static final String ESTIMATED_MEMORY_OF_TABLE_READERS_DESCRIPTION =
"Estimated memory in bytes used for reading SST tables, excluding
memory used in block cache";
private static final String TOTAL_NUMBER_OF_BACKGROUND_ERRORS_DESCRIPTION
= "Total number of background errors";