feat(rocksdb): add WAL size tracking metric and Grafana dashboard (#21295)

Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
joshieDo
2026-01-23 19:59:10 +00:00
committed by GitHub
parent ab418642b4
commit 3648483512
7 changed files with 139 additions and 6 deletions

View File

@@ -828,7 +828,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(reth_rocksdb_table_size{$instance_label=\"$instance\"}) or vector(0)",
"expr": "(sum(reth_rocksdb_table_size{$instance_label=\"$instance\"}) or vector(0)) + (sum(reth_rocksdb_wal_size{$instance_label=\"$instance\"}) or vector(0))",
"hide": false,
"instant": false,
"legendFormat": "RocksDB",
@@ -841,7 +841,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(reth_db_table_size{$instance_label=\"$instance\"}) + sum(reth_db_freelist{$instance_label=\"$instance\"} * reth_db_page_size{$instance_label=\"$instance\"}) + sum(reth_static_files_segment_size{$instance_label=\"$instance\"}) + (sum(reth_rocksdb_table_size{$instance_label=\"$instance\"}) or vector(0))",
"expr": "sum(reth_db_table_size{$instance_label=\"$instance\"}) + sum(reth_db_freelist{$instance_label=\"$instance\"} * reth_db_page_size{$instance_label=\"$instance\"}) + sum(reth_static_files_segment_size{$instance_label=\"$instance\"}) + (sum(reth_rocksdb_table_size{$instance_label=\"$instance\"}) or vector(0)) + (sum(reth_rocksdb_wal_size{$instance_label=\"$instance\"}) or vector(0))",
"hide": false,
"instant": false,
"legendFormat": "Total",
@@ -6771,6 +6771,17 @@
"legendFormat": "{{table}}",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "reth_rocksdb_wal_size{$instance_label=\"$instance\"}",
"legendFormat": "WAL",
"range": true,
"refId": "B"
}
],
"title": "RocksDB Tables Size",
@@ -7091,7 +7102,7 @@
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum by (job) ( reth_rocksdb_table_size{$instance_label=\"$instance\"} )",
"expr": "sum by (job) ( reth_rocksdb_table_size{$instance_label=\"$instance\"} ) + (sum by (job) ( reth_rocksdb_wal_size{$instance_label=\"$instance\"} ) or vector(0))",
"legendFormat": "__auto",
"range": true,
"refId": "A"
@@ -12441,6 +12452,18 @@
"legendFormat": "__auto",
"range": true,
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "label_replace(reth_rocksdb_wal_size{$instance_label=\"$instance\"}, \"table\", \"WAL\", \"\", \"\")",
"format": "table",
"legendFormat": "__auto",
"range": true,
"refId": "C"
}
],
"transformations": [
@@ -12464,6 +12487,12 @@
],
"operation": "aggregate"
},
"Value #C": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"table": {
"aggregations": [],
"operation": "groupby"
@@ -12489,7 +12518,8 @@
"renameByName": {
"table": "Table",
"Value #A (lastNotNull)": "SST Size",
"Value #B (lastNotNull)": "Memtable Size"
"Value #B (lastNotNull)": "Memtable Size",
"Value #C (lastNotNull)": "WAL Size"
}
}
}