Skip to content

Commit 5c4a24e

Browse files
craig[bot]annrpom
andcommitted
Merge #144397
144397: kvserver: add metrics for remote table size, count r=annrpom a=annrpom This patch adds two metrics for remote table stats: - `storage.sstable.remote.bytes` - `storage.sstable.remote.count` Epic: none Fixes: #143850 Release note: None Co-authored-by: Annie Pompa <[email protected]>
2 parents 5d7028c + 61cb5fc commit 5c4a24e

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

docs/generated/metrics/metrics.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,8 @@
810810
<tr><td>STORAGE</td><td>storage.sstable.compression.snappy.count</td><td>Count of SSTables that have been compressed with the snappy compression algorithm.</td><td>SSTables</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
811811
<tr><td>STORAGE</td><td>storage.sstable.compression.unknown.count</td><td>Count of SSTables that have an unknown compression algorithm.</td><td>SSTables</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
812812
<tr><td>STORAGE</td><td>storage.sstable.compression.zstd.count</td><td>Count of SSTables that have been compressed with the zstd compression algorithm.</td><td>SSTables</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
813+
<tr><td>STORAGE</td><td>storage.sstable.remote.bytes</td><td>Bytes in SSTables that are stored off-disk (remotely) in object storage.</td><td>Bytes</td><td>GAUGE</td><td>BYTES</td><td>AVG</td><td>NONE</td></tr>
814+
<tr><td>STORAGE</td><td>storage.sstable.remote.count</td><td>Count of SSTables that are stored off-disk (remotely) in object storage.</td><td>SSTables</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
813815
<tr><td>STORAGE</td><td>storage.sstable.zombie.bytes</td><td>Bytes in SSTables that have been logically deleted, but can&#39;t yet be physically deleted because an open iterator may be reading them.</td><td>Bytes</td><td>GAUGE</td><td>BYTES</td><td>AVG</td><td>NONE</td></tr>
814816
<tr><td>STORAGE</td><td>storage.wal.bytes_in</td><td>The number of logical bytes the storage engine has written to the WAL</td><td>Events</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
815817
<tr><td>STORAGE</td><td>storage.wal.bytes_written</td><td>The number of bytes the storage engine has written to the WAL</td><td>Events</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>

pkg/kv/kvserver/metrics.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,20 @@ bytes preserved during flushes and compactions over the lifetime of the process.
10281028
Measurement: "Bytes",
10291029
Unit: metric.Unit_BYTES,
10301030
}
1031+
metaSSTableRemoteBytes = metric.Metadata{
1032+
Name: "storage.sstable.remote.bytes",
1033+
Help: "Bytes in SSTables that are stored off-disk (remotely) " +
1034+
"in object storage.",
1035+
Measurement: "Bytes",
1036+
Unit: metric.Unit_BYTES,
1037+
}
1038+
metaSSTableRemoteCount = metric.Metadata{
1039+
Name: "storage.sstable.remote.count",
1040+
Help: "Count of SSTables that are stored off-disk (remotely) " +
1041+
"in object storage.",
1042+
Measurement: "SSTables",
1043+
Unit: metric.Unit_COUNT,
1044+
}
10311045
metaSSTableCompressionSnappy = metric.Metadata{
10321046
Name: "storage.sstable.compression.snappy.count",
10331047
Help: "Count of SSTables that have been compressed with the snappy " +
@@ -2775,6 +2789,8 @@ type StoreMetrics struct {
27752789
BatchCommitWALRotWaitDuration *metric.Counter
27762790
BatchCommitCommitWaitDuration *metric.Counter
27772791
SSTableZombieBytes *metric.Gauge
2792+
SSTableRemoteBytes *metric.Gauge
2793+
SSTableRemoteCount *metric.Gauge
27782794
SSTableCompressionSnappy *metric.Gauge
27792795
SSTableCompressionZstd *metric.Gauge
27802796
SSTableCompressionUnknown *metric.Gauge
@@ -3499,6 +3515,8 @@ func newStoreMetrics(histogramWindow time.Duration) *StoreMetrics {
34993515
BatchCommitWALRotWaitDuration: metric.NewCounter(metaBatchCommitWALRotDuration),
35003516
BatchCommitCommitWaitDuration: metric.NewCounter(metaBatchCommitCommitWaitDuration),
35013517
SSTableZombieBytes: metric.NewGauge(metaSSTableZombieBytes),
3518+
SSTableRemoteBytes: metric.NewGauge(metaSSTableRemoteBytes),
3519+
SSTableRemoteCount: metric.NewGauge(metaSSTableRemoteCount),
35023520
SSTableCompressionSnappy: metric.NewGauge(metaSSTableCompressionSnappy),
35033521
SSTableCompressionZstd: metric.NewGauge(metaSSTableCompressionZstd),
35043522
SSTableCompressionUnknown: metric.NewGauge(metaSSTableCompressionUnknown),
@@ -3958,6 +3976,9 @@ func (sm *StoreMetrics) updateEngineMetrics(m storage.Metrics) {
39583976
sm.BatchCommitWALRotWaitDuration.Update(int64(m.BatchCommitStats.WALRotationDuration))
39593977
sm.BatchCommitCommitWaitDuration.Update(int64(m.BatchCommitStats.CommitWaitDuration))
39603978
sm.SSTableZombieBytes.Update(int64(m.Table.ZombieSize))
3979+
count, size := m.RemoteTablesTotal()
3980+
sm.SSTableRemoteBytes.Update(int64(size))
3981+
sm.SSTableRemoteCount.Update(int64(count))
39613982
sm.SSTableCompressionSnappy.Update(m.Table.CompressedCountSnappy)
39623983
sm.SSTableCompressionZstd.Update(m.Table.CompressedCountZstd)
39633984
sm.SSTableCompressionUnknown.Update(m.Table.CompressedCountUnknown)

0 commit comments

Comments
 (0)