Skip to content

Commit 6f17390

Browse files
committed
metrics: add backup_exported_diff_size_bytes
Add a gauge that reports the total size in bytes of the diff data uploaded so far within a single MantleBackup. The value is the sum of all uploaded diff parts, labeled by PVC, namespace, MantleBackup, and sync mode. Signed-off-by: Kohya Shiozaki <kouyan120706@gmail.com>
1 parent 38b5019 commit 6f17390

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

internal/controller/metrics/metrics.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ import (
88
const namespace = "mantle"
99

1010
var (
11+
BackupExportedDiffSizeBytes = prometheus.NewGaugeVec(
12+
prometheus.GaugeOpts{
13+
Namespace: namespace,
14+
Name: "backup_exported_diff_size_bytes",
15+
Help: "Total bytes of diff data uploaded during backup.",
16+
},
17+
[]string{"persistentvolumeclaim", "resource_namespace", "mantlebackup", "sync_mode"},
18+
)
19+
1120
BackupConfigInfo = prometheus.NewGaugeVec(
1221
prometheus.GaugeOpts{
1322
Namespace: namespace,
@@ -29,6 +38,7 @@ var (
2938
)
3039

3140
func init() {
41+
runtimemetrics.Registry.MustRegister(BackupExportedDiffSizeBytes)
3242
runtimemetrics.Registry.MustRegister(BackupConfigInfo)
3343
runtimemetrics.Registry.MustRegister(BackupDurationSeconds)
3444
}

0 commit comments

Comments
 (0)