From 77b3241df80cea3c144def97d0152c8970a32b5a Mon Sep 17 00:00:00 2001 From: RainbowMango Date: Fri, 27 Sep 2019 11:11:26 +0800 Subject: [PATCH] Remove direct reference to Prometheus.Label for vsphere --- .../vsphere/vclib/vsphere_metrics.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/vsphere_metrics.go b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/vsphere_metrics.go index 5baafc4ff0e..4b25a811078 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/vsphere_metrics.go +++ b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/vsphere_metrics.go @@ -19,8 +19,6 @@ package vclib import ( "time" - "github.com/prometheus/client_golang/prometheus" - "k8s.io/component-base/metrics" "k8s.io/component-base/metrics/legacyregistry" ) @@ -103,17 +101,17 @@ func RecordvSphereMetric(actionName string, requestTime time.Time, err error) { func recordvSphereAPIMetric(actionName string, requestTime time.Time, err error) { if err != nil { - vsphereAPIErrorMetric.With(prometheus.Labels{"request": actionName}).Inc() + vsphereAPIErrorMetric.With(metrics.Labels{"request": actionName}).Inc() } else { - vsphereAPIMetric.With(prometheus.Labels{"request": actionName}).Observe(calculateTimeTaken(requestTime)) + vsphereAPIMetric.With(metrics.Labels{"request": actionName}).Observe(calculateTimeTaken(requestTime)) } } func recordvSphereOperationMetric(actionName string, requestTime time.Time, err error) { if err != nil { - vsphereOperationErrorMetric.With(prometheus.Labels{"operation": actionName}).Inc() + vsphereOperationErrorMetric.With(metrics.Labels{"operation": actionName}).Inc() } else { - vsphereOperationMetric.With(prometheus.Labels{"operation": actionName}).Observe(calculateTimeTaken(requestTime)) + vsphereOperationMetric.With(metrics.Labels{"operation": actionName}).Observe(calculateTimeTaken(requestTime)) } }