Skip to content

Commit 3951854

Browse files
jentingroboquat
authored andcommitted
[ws-manager] Add workspace class label to PVC backup duration metric
Signed-off-by: JenTing Hsiao <[email protected]>
1 parent a171e14 commit 3951854

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

components/ws-manager/pkg/manager/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func newMetrics(m *Manager) *metrics {
9191
Name: "volume_snapshot_seconds",
9292
Help: "time it took to snapshot volume",
9393
Buckets: prometheus.ExponentialBuckets(2, 2, 10),
94-
}, []string{"type"}),
94+
}, []string{"type", "class"}),
9595
volumeRestoreTimeHistVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{
9696
Namespace: metricsNamespace,
9797
Subsystem: metricsWorkspaceSubsystem,

components/ws-manager/pkg/manager/monitor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ func (m *Monitor) finalizeWorkspaceContent(ctx context.Context, wso *workspaceOb
10361036
return true, nil, err
10371037
}
10381038
readyVolumeSnapshot = true
1039-
hist, err := m.manager.metrics.volumeSnapshotTimeHistVec.GetMetricWithLabelValues(wsType)
1039+
hist, err := m.manager.metrics.volumeSnapshotTimeHistVec.GetMetricWithLabelValues(wsType, wso.Pod.Labels[workspaceClassLabel])
10401040
if err != nil {
10411041
log.WithError(err).WithField("type", wsType).Warn("cannot get volume snapshot time histogram metric")
10421042
} else {

0 commit comments

Comments
 (0)