Skip to content

Commit edbaaae

Browse files
sagor999roboquat
authored andcommitted
[ws-manager] remove unneeded metric
1 parent 72c01b0 commit edbaaae

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ type metrics struct {
4848
totalStartsCounterVec *prometheus.CounterVec
4949
totalStartsFailureCounterVec *prometheus.CounterVec
5050
totalStopsCounterVec *prometheus.CounterVec
51-
totalStopsFailureCounterVec *prometheus.CounterVec
5251
totalBackupCounterVec *prometheus.CounterVec
5352
totalBackupFailureCounterVec *prometheus.CounterVec
5453
totalRestoreCounterVec *prometheus.CounterVec
@@ -122,12 +121,6 @@ func newMetrics(m *Manager) *metrics {
122121
Name: "workspace_stops_total",
123122
Help: "total number of workspaces stopped",
124123
}, []string{"reason", "type", "class"}),
125-
totalStopsFailureCounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{
126-
Namespace: metricsNamespace,
127-
Subsystem: metricsWorkspaceSubsystem,
128-
Name: "workspace_stops_failure_total",
129-
Help: "total number of workspaces failed to stop",
130-
}, []string{"type", "class"}),
131124
totalBackupCounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{
132125
Namespace: metricsNamespace,
133126
Subsystem: metricsWorkspaceSubsystem,
@@ -229,7 +222,6 @@ func (m *metrics) Register(reg prometheus.Registerer) error {
229222
m.totalStartsCounterVec,
230223
m.totalStartsFailureCounterVec,
231224
m.totalStopsCounterVec,
232-
m.totalStopsFailureCounterVec,
233225
m.totalBackupCounterVec,
234226
m.totalBackupFailureCounterVec,
235227
m.totalRestoreCounterVec,
@@ -328,14 +320,6 @@ func (m *metrics) OnChange(status *api.WorkspaceStatus) {
328320
}
329321
counter.Inc()
330322

331-
if reason == "failed" {
332-
counter, err = m.totalStopsFailureCounterVec.GetMetricWithLabelValues(tpe, status.Spec.Class)
333-
if err != nil {
334-
log.WithError(err).WithField("type", tpe).Warn("cannot get counter for workspace stop failure metric")
335-
return
336-
}
337-
counter.Inc()
338-
}
339323
removeFromState = true
340324
}
341325
}

0 commit comments

Comments
 (0)