0
# Metrics and Monitoring Options
1
2
The RocksDB State Backend provides comprehensive metrics integration that forwards RocksDB native metrics to Flink's metrics system. This enables detailed monitoring of performance, memory usage, and operational health.
3
4
## Core Imports
5
6
```java { .api }
7
import org.apache.flink.state.rocksdb.RocksDBNativeMetricOptions;
8
import org.apache.flink.state.rocksdb.RocksDBProperty;
9
import org.apache.flink.configuration.ConfigOption;
10
import org.apache.flink.configuration.ReadableConfig;
11
import org.apache.flink.configuration.Configuration;
12
import java.util.Set;
13
import java.util.Collection;
14
```
15
16
## RocksDBNativeMetricOptions Class
17
18
### Class Definition
19
20
```java { .api }
21
@PublicEvolving
22
public class RocksDBNativeMetricOptions {
23
// Configuration for enabling RocksDB native metrics forwarding to Flink's metrics reporter
24
}
25
```
26
27
### Factory Method
28
29
```java { .api }
30
public static RocksDBNativeMetricOptions fromConfig(ReadableConfig config)
31
```
32
Creates RocksDBNativeMetricOptions from configuration.
33
34
**Parameters:**
35
- `config` - Configuration containing metric settings
36
37
**Returns:** Configured RocksDBNativeMetricOptions instance
38
39
**Example:**
40
```java
41
Configuration config = new Configuration();
42
config.set(RocksDBNativeMetricOptions.MONITOR_BLOCK_CACHE_HIT, true);
43
config.set(RocksDBNativeMetricOptions.ESTIMATE_NUM_KEYS, true);
44
45
RocksDBNativeMetricOptions metricOptions = RocksDBNativeMetricOptions.fromConfig(config);
46
```
47
48
## Property-Based Metrics Configuration
49
50
### Memory Table Metrics
51
52
```java { .api }
53
public static final ConfigOption<Boolean> MONITOR_NUM_IMMUTABLE_MEM_TABLES
54
```
55
Monitors the number of immutable memtables that have not yet been flushed.
56
57
```java { .api }
58
public static final ConfigOption<Boolean> MONITOR_MEM_TABLE_FLUSH_PENDING
59
```
60
Monitors whether a memtable flush is pending.
61
62
```java { .api }
63
public static final ConfigOption<Boolean> MONITOR_CUR_SIZE_ACTIVE_MEM_TABLE
64
```
65
Monitors the approximate size of the active memtable in bytes.
66
67
```java { .api }
68
public static final ConfigOption<Boolean> MONITOR_CUR_SIZE_ALL_MEM_TABLE
69
```
70
Monitors the approximate size of all memtables in bytes.
71
72
```java { .api }
73
public static final ConfigOption<Boolean> MONITOR_SIZE_ALL_MEM_TABLES
74
```
75
Monitors the total size of all memtables in bytes.
76
77
```java { .api }
78
public static final ConfigOption<Boolean> MONITOR_NUM_ENTRIES_ACTIVE_MEM_TABLE
79
```
80
Monitors the total number of entries in the active memtable.
81
82
```java { .api }
83
public static final ConfigOption<Boolean> MONITOR_NUM_ENTRIES_IMM_MEM_TABLES
84
```
85
Monitors the total number of entries in the unflushed immutable memtables.
86
87
```java { .api }
88
public static final ConfigOption<Boolean> MONITOR_NUM_DELETES_ACTIVE_MEM_TABLE
89
```
90
Monitors the total number of delete entries in the active memtable.
91
92
```java { .api }
93
public static final ConfigOption<Boolean> MONITOR_NUM_DELETES_IMM_MEM_TABLE
94
```
95
Monitors the total number of delete entries in the unflushed immutable memtables.
96
97
### Compaction and Background Process Metrics
98
99
```java { .api }
100
public static final ConfigOption<Boolean> TRACK_COMPACTION_PENDING
101
```
102
Monitors whether at least one compaction is pending.
103
104
```java { .api }
105
public static final ConfigOption<Boolean> MONITOR_BACKGROUND_ERRORS
106
```
107
Monitors the number of background errors encountered.
108
109
```java { .api }
110
public static final ConfigOption<Boolean> MONITOR_NUM_RUNNING_COMPACTIONS
111
```
112
Monitors the number of currently running compactions.
113
114
```java { .api }
115
public static final ConfigOption<Boolean> MONITOR_NUM_RUNNING_FLUSHES
116
```
117
Monitors the number of currently running flushes.
118
119
```java { .api }
120
public static final ConfigOption<Boolean> ESTIMATE_PENDING_COMPACTION_BYTES
121
```
122
Estimates the total bytes of files pending compaction.
123
124
### Database Size and Key Metrics
125
126
```java { .api }
127
public static final ConfigOption<Boolean> ESTIMATE_NUM_KEYS
128
```
129
Estimates the number of keys in the RocksDB instance.
130
131
```java { .api }
132
public static final ConfigOption<Boolean> ESTIMATE_LIVE_DATA_SIZE
133
```
134
Estimates the size of live data in bytes.
135
136
```java { .api }
137
public static final ConfigOption<Boolean> MONITOR_TOTAL_SST_FILES_SIZE
138
```
139
Monitors the total size of all SST files in bytes.
140
141
```java { .api }
142
public static final ConfigOption<Boolean> MONITOR_LIVE_SST_FILES_SIZE
143
```
144
Monitors the total size of live SST files in bytes.
145
146
### Memory and Cache Metrics
147
148
```java { .api }
149
public static final ConfigOption<Boolean> ESTIMATE_TABLE_READERS_MEM
150
```
151
Estimates the memory used by table readers.
152
153
```java { .api }
154
public static final ConfigOption<Boolean> BLOCK_CACHE_CAPACITY
155
```
156
Monitors the block cache capacity.
157
158
```java { .api }
159
public static final ConfigOption<Boolean> BLOCK_CACHE_USAGE
160
```
161
Monitors the memory size used by the block cache.
162
163
```java { .api }
164
public static final ConfigOption<Boolean> BLOCK_CACHE_PINNED_USAGE
165
```
166
Monitors the memory size used by pinned blocks in the block cache.
167
168
### Snapshot and Version Metrics
169
170
```java { .api }
171
public static final ConfigOption<Boolean> MONITOR_NUM_SNAPSHOTS
172
```
173
Monitors the number of unreleased snapshots of the database.
174
175
```java { .api }
176
public static final ConfigOption<Boolean> MONITOR_NUM_LIVE_VERSIONS
177
```
178
Monitors the number of live versions (column family metadata).
179
180
### Write Performance Metrics
181
182
```java { .api }
183
public static final ConfigOption<Boolean> MONITOR_ACTUAL_DELAYED_WRITE_RATE
184
```
185
Monitors the current actual delayed write rate.
186
187
```java { .api }
188
public static final ConfigOption<Boolean> IS_WRITE_STOPPED
189
```
190
Monitors whether writes have been stopped.
191
192
### File Level Metrics
193
194
```java { .api }
195
public static final ConfigOption<Boolean> MONITOR_NUM_FILES_AT_LEVEL
196
```
197
Monitors the number of files at each level of the LSM tree.
198
199
### Column Family Configuration
200
201
```java { .api }
202
public static final ConfigOption<Boolean> COLUMN_FAMILY_AS_VARIABLE
203
```
204
Exposes the column family name as a variable in metric names.
205
206
## Statistics-Based Metrics Configuration
207
208
### Cache Performance Metrics
209
210
```java { .api }
211
public static final ConfigOption<Boolean> MONITOR_BLOCK_CACHE_HIT
212
```
213
Monitors the number of block cache hits.
214
215
```java { .api }
216
public static final ConfigOption<Boolean> MONITOR_BLOCK_CACHE_MISS
217
```
218
Monitors the number of block cache misses.
219
220
### Bloom Filter Metrics
221
222
```java { .api }
223
public static final ConfigOption<Boolean> MONITOR_BLOOM_FILTER_USEFUL
224
```
225
Monitors the number of times bloom filter was useful in avoiding reads.
226
227
```java { .api }
228
public static final ConfigOption<Boolean> MONITOR_BLOOM_FILTER_FULL_POSITIVE
229
```
230
Monitors the number of times bloom filter gave a positive result.
231
232
```java { .api }
233
public static final ConfigOption<Boolean> MONITOR_BLOOM_FILTER_FULL_TRUE_POSITIVE
234
```
235
Monitors the number of times bloom filter gave a true positive result.
236
237
### I/O Performance Metrics
238
239
```java { .api }
240
public static final ConfigOption<Boolean> MONITOR_BYTES_READ
241
```
242
Monitors the total number of bytes read.
243
244
```java { .api }
245
public static final ConfigOption<Boolean> MONITOR_ITER_BYTES_READ
246
```
247
Monitors the total number of bytes read by iterators.
248
249
```java { .api }
250
public static final ConfigOption<Boolean> MONITOR_BYTES_WRITTEN
251
```
252
Monitors the total number of bytes written.
253
254
```java { .api }
255
public static final ConfigOption<Boolean> MONITOR_COMPACTION_READ_BYTES
256
```
257
Monitors the total number of bytes read during compaction.
258
259
```java { .api }
260
public static final ConfigOption<Boolean> MONITOR_COMPACTION_WRITE_BYTES
261
```
262
Monitors the total number of bytes written during compaction.
263
264
### Performance Degradation Metrics
265
266
```java { .api }
267
public static final ConfigOption<Boolean> MONITOR_STALL_MICROS
268
```
269
Monitors the total time spent in write stalls in microseconds.
270
271
## Enable Methods for Property-Based Metrics
272
273
### Memory Table Enable Methods
274
275
```java { .api }
276
public void enableNumImmutableMemTable()
277
```
278
Enables monitoring of immutable memtable count.
279
280
```java { .api }
281
public void enableMemTableFlushPending()
282
```
283
Enables monitoring of pending memtable flushes.
284
285
```java { .api }
286
public RocksDBNativeMetricOptions enableCurSizeActiveMemTable()
287
```
288
Enables monitoring of active memtable size.
289
290
```java { .api }
291
public RocksDBNativeMetricOptions enableCurSizeAllMemTables()
292
```
293
Enables monitoring of all memtables size.
294
295
```java { .api }
296
public RocksDBNativeMetricOptions enableSizeAllMemTables()
297
```
298
Enables monitoring of total memtables size.
299
300
```java { .api }
301
public RocksDBNativeMetricOptions enableNumEntriesActiveMemTable()
302
```
303
Enables monitoring of active memtable entries.
304
305
```java { .api }
306
public RocksDBNativeMetricOptions enableNumEntriesImmMemTables()
307
```
308
Enables monitoring of immutable memtable entries.
309
310
```java { .api }
311
public RocksDBNativeMetricOptions enableNumDeletesActiveMemTable()
312
```
313
Enables monitoring of delete entries in active memtable.
314
315
```java { .api }
316
public RocksDBNativeMetricOptions enableNumDeletesImmMemTables()
317
```
318
Enables monitoring of delete entries in immutable memtables.
319
320
### Compaction Enable Methods
321
322
```java { .api }
323
public RocksDBNativeMetricOptions enableCompactionPending()
324
```
325
Enables monitoring of pending compactions.
326
327
```java { .api }
328
public RocksDBNativeMetricOptions enableBackgroundErrors()
329
```
330
Enables monitoring of background errors.
331
332
```java { .api }
333
public RocksDBNativeMetricOptions enableNumRunningCompactions()
334
```
335
Enables monitoring of running compactions.
336
337
```java { .api }
338
public RocksDBNativeMetricOptions enableNumRunningFlushes()
339
```
340
Enables monitoring of running flushes.
341
342
```java { .api }
343
public RocksDBNativeMetricOptions enableEstimatePendingCompactionBytes()
344
```
345
Enables estimation of pending compaction bytes.
346
347
### Database Metrics Enable Methods
348
349
```java { .api }
350
public RocksDBNativeMetricOptions enableEstimateNumKeys()
351
```
352
Enables estimation of key count.
353
354
```java { .api }
355
public RocksDBNativeMetricOptions enableEstimateTableReadersMem()
356
```
357
Enables estimation of table readers memory.
358
359
```java { .api }
360
public RocksDBNativeMetricOptions enableEstimateLiveDataSize()
361
```
362
Enables estimation of live data size.
363
364
```java { .api }
365
public RocksDBNativeMetricOptions enableTotalSstFilesSize()
366
```
367
Enables monitoring of total SST files size.
368
369
```java { .api }
370
public RocksDBNativeMetricOptions enableLiveSstFilesSize()
371
```
372
Enables monitoring of live SST files size.
373
374
### Cache Enable Methods
375
376
```java { .api }
377
public RocksDBNativeMetricOptions enableBlockCacheCapacity()
378
```
379
Enables monitoring of block cache capacity.
380
381
```java { .api }
382
public RocksDBNativeMetricOptions enableBlockCacheUsage()
383
```
384
Enables monitoring of block cache usage.
385
386
```java { .api }
387
public RocksDBNativeMetricOptions enableBlockCachePinnedUsage()
388
```
389
Enables monitoring of pinned block cache usage.
390
391
### Snapshot and Version Enable Methods
392
393
```java { .api }
394
public RocksDBNativeMetricOptions enableNumSnapshots()
395
```
396
Enables monitoring of unreleased snapshots.
397
398
```java { .api }
399
public RocksDBNativeMetricOptions enableNumLiveVersions()
400
```
401
Enables monitoring of live versions.
402
403
### Write Performance Enable Methods
404
405
```java { .api }
406
public RocksDBNativeMetricOptions enableActualDelayedWriteRate()
407
```
408
Enables monitoring of delayed write rate.
409
410
```java { .api }
411
public RocksDBNativeMetricOptions enableIsWriteStopped()
412
```
413
Enables monitoring of write stopped status.
414
415
### File Level Enable Methods
416
417
```java { .api }
418
public RocksDBNativeMetricOptions enableNumFilesAtLevel()
419
```
420
Enables monitoring of files per LSM tree level.
421
422
## Configuration Methods
423
424
### Column Family Configuration
425
426
```java { .api }
427
public void setColumnFamilyAsVariable(boolean columnFamilyAsVariable)
428
```
429
Sets whether to expose column family name as a variable in metric names.
430
431
**Parameters:**
432
- `columnFamilyAsVariable` - Whether to include column family in metric names
433
434
### Statistics Configuration
435
436
```java { .api }
437
public void enableNativeStatistics(ConfigOption<Boolean> nativeStatisticsOption)
438
```
439
Enables a native statistics metric.
440
441
**Parameters:**
442
- `nativeStatisticsOption` - The statistics option to enable
443
444
## Query Methods
445
446
### Status Methods
447
448
```java { .api }
449
public boolean isEnabled()
450
```
451
Checks if any metrics are enabled.
452
453
**Returns:** `true` if any metrics are configured, `false` otherwise
454
455
```java { .api }
456
public boolean isStatisticsEnabled()
457
```
458
Checks if statistics-based metrics are enabled.
459
460
**Returns:** `true` if statistics metrics are enabled, `false` otherwise
461
462
```java { .api }
463
public boolean isColumnFamilyAsVariable()
464
```
465
Checks if column family is exposed as a variable in metric names.
466
467
**Returns:** `true` if column family is used as variable, `false` otherwise
468
469
### Metrics Collection Methods
470
471
```java { .api }
472
public Set<RocksDBProperty> getProperties()
473
```
474
Gets the set of enabled property-based metrics.
475
476
**Returns:** Set of enabled RocksDBProperty instances
477
478
```java { .api }
479
public Collection<ConfigOption<Boolean>> getMonitorTickerTypes()
480
```
481
Gets the collection of enabled statistics-based metrics.
482
483
**Returns:** Collection of enabled statistics metric options
484
485
## RocksDBProperty Enum
486
487
### Property Enum Definition
488
489
```java { .api }
490
@Internal // Referenced in public APIs
491
public enum RocksDBProperty {
492
NumImmutableMemTable,
493
MemTableFlushPending,
494
CompactionPending,
495
BackgroundErrors,
496
CurSizeActiveMemTable,
497
CurSizeAllMemTables,
498
SizeAllMemTables,
499
NumEntriesActiveMemTable,
500
NumEntriesImmMemTables,
501
EstimateNumKeys,
502
EstimateTableReadersMem,
503
NumSnapshots,
504
EstimateLiveDataSize,
505
TotalSstFilesSize,
506
LiveSstFilesSize,
507
BlockCacheCapacity,
508
BlockCacheUsage,
509
BlockCachePinnedUsage,
510
NumFilesAtLevel0,
511
NumFilesAtLevel1,
512
NumFilesAtLevel2,
513
NumFilesAtLevel3,
514
NumFilesAtLevel4,
515
NumFilesAtLevel5,
516
NumFilesAtLevel6
517
// ... and more levels
518
}
519
```
520
521
### Property Methods
522
523
```java { .api }
524
public String getRocksDBProperty()
525
```
526
Gets the RocksDB property string for querying.
527
528
**Returns:** RocksDB property name string
529
530
```java { .api }
531
public long getNumericalPropertyValue(RocksDB rocksDB, ColumnFamilyHandle handle)
532
```
533
Gets the numerical value of this property from RocksDB.
534
535
**Parameters:**
536
- `rocksDB` - RocksDB instance to query
537
- `handle` - Column family handle
538
539
**Returns:** Numerical property value
540
541
```java { .api }
542
public String getConfigKey()
543
```
544
Gets the configuration key for this property.
545
546
**Returns:** Configuration key string
547
548
## Configuration Examples
549
550
### Basic Metrics Configuration
551
552
```java
553
Configuration config = new Configuration();
554
555
// Enable essential performance metrics
556
config.set(RocksDBNativeMetricOptions.MONITOR_BLOCK_CACHE_HIT, true);
557
config.set(RocksDBNativeMetricOptions.MONITOR_BLOCK_CACHE_MISS, true);
558
config.set(RocksDBNativeMetricOptions.ESTIMATE_NUM_KEYS, true);
559
config.set(RocksDBNativeMetricOptions.MONITOR_COMPACTION_READ_BYTES, true);
560
config.set(RocksDBNativeMetricOptions.MONITOR_COMPACTION_WRITE_BYTES, true);
561
562
// Create options from config
563
RocksDBNativeMetricOptions metricOptions = RocksDBNativeMetricOptions.fromConfig(config);
564
```
565
566
### Memory Monitoring Configuration
567
568
```java
569
Configuration config = new Configuration();
570
571
// Memory-related metrics
572
config.set(RocksDBNativeMetricOptions.MONITOR_CUR_SIZE_ACTIVE_MEM_TABLE, true);
573
config.set(RocksDBNativeMetricOptions.MONITOR_CUR_SIZE_ALL_MEM_TABLE, true);
574
config.set(RocksDBNativeMetricOptions.BLOCK_CACHE_USAGE, true);
575
config.set(RocksDBNativeMetricOptions.BLOCK_CACHE_CAPACITY, true);
576
config.set(RocksDBNativeMetricOptions.ESTIMATE_TABLE_READERS_MEM, true);
577
578
// Compaction and flush monitoring
579
config.set(RocksDBNativeMetricOptions.MONITOR_MEM_TABLE_FLUSH_PENDING, true);
580
config.set(RocksDBNativeMetricOptions.TRACK_COMPACTION_PENDING, true);
581
config.set(RocksDBNativeMetricOptions.MONITOR_NUM_RUNNING_COMPACTIONS, true);
582
583
RocksDBNativeMetricOptions memoryMetrics = RocksDBNativeMetricOptions.fromConfig(config);
584
```
585
586
### Comprehensive Monitoring Configuration
587
588
```java
589
public RocksDBNativeMetricOptions createComprehensiveMetrics() {
590
Configuration config = new Configuration();
591
592
// Performance metrics
593
config.set(RocksDBNativeMetricOptions.MONITOR_BLOCK_CACHE_HIT, true);
594
config.set(RocksDBNativeMetricOptions.MONITOR_BLOCK_CACHE_MISS, true);
595
config.set(RocksDBNativeMetricOptions.MONITOR_BLOOM_FILTER_USEFUL, true);
596
597
// Memory metrics
598
config.set(RocksDBNativeMetricOptions.BLOCK_CACHE_USAGE, true);
599
config.set(RocksDBNativeMetricOptions.MONITOR_CUR_SIZE_ALL_MEM_TABLE, true);
600
config.set(RocksDBNativeMetricOptions.ESTIMATE_TABLE_READERS_MEM, true);
601
602
// I/O metrics
603
config.set(RocksDBNativeMetricOptions.MONITOR_BYTES_READ, true);
604
config.set(RocksDBNativeMetricOptions.MONITOR_BYTES_WRITTEN, true);
605
config.set(RocksDBNativeMetricOptions.MONITOR_COMPACTION_READ_BYTES, true);
606
config.set(RocksDBNativeMetricOptions.MONITOR_COMPACTION_WRITE_BYTES, true);
607
608
// Database health metrics
609
config.set(RocksDBNativeMetricOptions.ESTIMATE_NUM_KEYS, true);
610
config.set(RocksDBNativeMetricOptions.ESTIMATE_LIVE_DATA_SIZE, true);
611
config.set(RocksDBNativeMetricOptions.MONITOR_BACKGROUND_ERRORS, true);
612
config.set(RocksDBNativeMetricOptions.IS_WRITE_STOPPED, true);
613
614
// Compaction metrics
615
config.set(RocksDBNativeMetricOptions.TRACK_COMPACTION_PENDING, true);
616
config.set(RocksDBNativeMetricOptions.MONITOR_NUM_RUNNING_COMPACTIONS, true);
617
config.set(RocksDBNativeMetricOptions.ESTIMATE_PENDING_COMPACTION_BYTES, true);
618
619
// Column family as variable for better metric organization
620
config.set(RocksDBNativeMetricOptions.COLUMN_FAMILY_AS_VARIABLE, true);
621
622
return RocksDBNativeMetricOptions.fromConfig(config);
623
}
624
```
625
626
### Programmatic Metrics Configuration
627
628
```java
629
public RocksDBNativeMetricOptions createProgrammaticMetrics() {
630
RocksDBNativeMetricOptions metrics = new RocksDBNativeMetricOptions();
631
632
// Enable using method calls
633
metrics.enableBlockCacheUsage();
634
metrics.enableBlockCacheCapacity();
635
metrics.enableEstimateNumKeys();
636
metrics.enableEstimateLiveDataSize();
637
metrics.enableCompactionPending();
638
metrics.enableBackgroundErrors();
639
metrics.setColumnFamilyAsVariable(true);
640
641
return metrics;
642
}
643
```
644
645
## Integration with Options Factory
646
647
```java
648
import org.apache.flink.state.rocksdb.RocksDBOptionsFactory;
649
650
public class MetricsEnabledOptionsFactory implements RocksDBOptionsFactory {
651
652
@Override
653
public RocksDBNativeMetricOptions createNativeMetricsOptions(
654
RocksDBNativeMetricOptions nativeMetricOptions) {
655
656
// Override default metrics with custom configuration
657
nativeMetricOptions.enableBlockCacheUsage();
658
nativeMetricOptions.enableEstimateNumKeys();
659
nativeMetricOptions.enableCompactionPending();
660
nativeMetricOptions.enableBackgroundErrors();
661
nativeMetricOptions.setColumnFamilyAsVariable(true);
662
663
return nativeMetricOptions;
664
}
665
666
// ... other factory methods
667
}
668
```
669
670
## Metrics Integration with Flink
671
672
### YAML Configuration
673
674
```yaml
675
# flink-conf.yaml
676
state.backend.rocksdb.metrics.block-cache-hit: true
677
state.backend.rocksdb.metrics.block-cache-miss: true
678
state.backend.rocksdb.metrics.estimate-num-keys: true
679
state.backend.rocksdb.metrics.compaction-read-bytes: true
680
state.backend.rocksdb.metrics.compaction-write-bytes: true
681
state.backend.rocksdb.metrics.column-family-as-variable: true
682
```
683
684
### Runtime Monitoring
685
686
The enabled metrics will be automatically forwarded to Flink's metrics system and can be accessed through:
687
688
- **Flink Web UI**: Metrics section showing RocksDB metrics per operator
689
- **Metrics Reporters**: JMX, Prometheus, InfluxDB, etc.
690
- **REST API**: Flink REST API for programmatic access
691
- **Logging**: Metrics can be logged periodically
692
693
### Metric Naming Convention
694
695
Metrics follow this naming pattern:
696
```
697
<job_name>.<operator_name>.rocksdb.[column_family.]<metric_name>
698
```
699
700
Example metric names:
701
- `my_job.my_operator.rocksdb.estimate-num-keys`
702
- `my_job.my_operator.rocksdb.default.block-cache-usage` (with column family)
703
- `my_job.my_operator.rocksdb.compaction-read-bytes`
704
705
## Performance Considerations
706
707
### Metrics Overhead
708
- Property-based metrics have minimal overhead (simple property reads)
709
- Statistics-based metrics require RocksDB statistics collection (slight overhead)
710
- Enable only necessary metrics for production to minimize impact
711
712
### Useful Metric Combinations
713
714
**Performance Monitoring:**
715
- Block cache hit/miss ratio
716
- Compaction read/write bytes
717
- Write stall duration
718
719
**Memory Monitoring:**
720
- Block cache usage vs capacity
721
- Memtable sizes
722
- Table readers memory
723
724
**Health Monitoring:**
725
- Background errors
726
- Write stopped status
727
- Pending compactions
728
729
**Capacity Planning:**
730
- Estimate number of keys
731
- Live data size
732
- Total SST file size