From 96a930c9bf3b52f05676cfc0410f15bd7ecfb447 Mon Sep 17 00:00:00 2001 From: RainbowMango Date: Sun, 29 Sep 2019 10:06:59 +0800 Subject: [PATCH 1/2] Remove direct reference to Prometheus. --- .../src/k8s.io/legacy-cloud-providers/aws/aws_metrics.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/staging/src/k8s.io/legacy-cloud-providers/aws/aws_metrics.go b/staging/src/k8s.io/legacy-cloud-providers/aws/aws_metrics.go index 90153ec35ce..6d6789edbd7 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/aws/aws_metrics.go +++ b/staging/src/k8s.io/legacy-cloud-providers/aws/aws_metrics.go @@ -21,8 +21,6 @@ package aws import ( "sync" - "github.com/prometheus/client_golang/prometheus" - "k8s.io/component-base/metrics" "k8s.io/component-base/metrics/legacyregistry" ) @@ -55,14 +53,14 @@ var ( func recordAWSMetric(actionName string, timeTaken float64, err error) { if err != nil { - awsAPIErrorMetric.With(prometheus.Labels{"request": actionName}).Inc() + awsAPIErrorMetric.With(metrics.Labels{"request": actionName}).Inc() } else { - awsAPIMetric.With(prometheus.Labels{"request": actionName}).Observe(timeTaken) + awsAPIMetric.With(metrics.Labels{"request": actionName}).Observe(timeTaken) } } func recordAWSThrottlesMetric(operation string) { - awsAPIThrottlesMetric.With(prometheus.Labels{"operation_name": operation}).Inc() + awsAPIThrottlesMetric.With(metrics.Labels{"operation_name": operation}).Inc() } var registerOnce sync.Once From 0bccce8f62376572e3beaca9b0d6c1de921b0aa1 Mon Sep 17 00:00:00 2001 From: RainbowMango Date: Sun, 29 Sep 2019 10:09:51 +0800 Subject: [PATCH 2/2] Update bazel and vendor by hack/update-bazel.sh and hack/update-vendor.sh --- staging/src/k8s.io/legacy-cloud-providers/aws/BUILD | 1 - staging/src/k8s.io/legacy-cloud-providers/go.mod | 1 - 2 files changed, 2 deletions(-) diff --git a/staging/src/k8s.io/legacy-cloud-providers/aws/BUILD b/staging/src/k8s.io/legacy-cloud-providers/aws/BUILD index 1d7542aaf41..0a4b5b69107 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/aws/BUILD +++ b/staging/src/k8s.io/legacy-cloud-providers/aws/BUILD @@ -66,7 +66,6 @@ go_library( "//vendor/github.com/aws/aws-sdk-go/service/elbv2:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/kms:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/sts:go_default_library", - "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", "//vendor/gopkg.in/gcfg.v1:go_default_library", "//vendor/k8s.io/klog:go_default_library", ], diff --git a/staging/src/k8s.io/legacy-cloud-providers/go.mod b/staging/src/k8s.io/legacy-cloud-providers/go.mod index 800986635e4..5a72ad9bd95 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/go.mod +++ b/staging/src/k8s.io/legacy-cloud-providers/go.mod @@ -16,7 +16,6 @@ require ( github.com/dnaeon/go-vcr v1.0.1 // indirect github.com/gophercloud/gophercloud v0.1.0 github.com/mitchellh/mapstructure v1.1.2 - github.com/prometheus/client_golang v0.9.4 github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c github.com/satori/go.uuid v1.2.0 // indirect github.com/stretchr/testify v1.3.0