Skip to content

Commit 77b3241

Browse files
committed
Remove direct reference to Prometheus.Label for vsphere
1 parent 354a812 commit 77b3241

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/vsphere_metrics.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ package vclib
1919
import (
2020
"time"
2121

22-
"github.com/prometheus/client_golang/prometheus"
23-
2422
"k8s.io/component-base/metrics"
2523
"k8s.io/component-base/metrics/legacyregistry"
2624
)
@@ -103,17 +101,17 @@ func RecordvSphereMetric(actionName string, requestTime time.Time, err error) {
103101

104102
func recordvSphereAPIMetric(actionName string, requestTime time.Time, err error) {
105103
if err != nil {
106-
vsphereAPIErrorMetric.With(prometheus.Labels{"request": actionName}).Inc()
104+
vsphereAPIErrorMetric.With(metrics.Labels{"request": actionName}).Inc()
107105
} else {
108-
vsphereAPIMetric.With(prometheus.Labels{"request": actionName}).Observe(calculateTimeTaken(requestTime))
106+
vsphereAPIMetric.With(metrics.Labels{"request": actionName}).Observe(calculateTimeTaken(requestTime))
109107
}
110108
}
111109

112110
func recordvSphereOperationMetric(actionName string, requestTime time.Time, err error) {
113111
if err != nil {
114-
vsphereOperationErrorMetric.With(prometheus.Labels{"operation": actionName}).Inc()
112+
vsphereOperationErrorMetric.With(metrics.Labels{"operation": actionName}).Inc()
115113
} else {
116-
vsphereOperationMetric.With(prometheus.Labels{"operation": actionName}).Observe(calculateTimeTaken(requestTime))
114+
vsphereOperationMetric.With(metrics.Labels{"operation": actionName}).Observe(calculateTimeTaken(requestTime))
117115
}
118116
}
119117

0 commit comments

Comments
 (0)