From 0730d6eb74a2a6e268260a800f5de90958d0253a Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Sun, 22 Mar 2020 16:23:44 -0700 Subject: [PATCH] remove deprecated methods from the MetricProvider interface Signed-off-by: Tariq Ibrahim --- discovery/kubernetes/client_metrics.go | 22 ---------------------- discovery/kubernetes/endpoints_test.go | 3 ++- discovery/kubernetes/ingress_test.go | 3 ++- discovery/kubernetes/kubernetes_test.go | 5 +++-- discovery/kubernetes/node_test.go | 3 ++- discovery/kubernetes/pod_test.go | 3 ++- discovery/kubernetes/service_test.go | 3 ++- 7 files changed, 13 insertions(+), 29 deletions(-) diff --git a/discovery/kubernetes/client_metrics.go b/discovery/kubernetes/client_metrics.go index cf4921dc0..a60ff48f2 100644 --- a/discovery/kubernetes/client_metrics.go +++ b/discovery/kubernetes/client_metrics.go @@ -18,7 +18,6 @@ import ( "time" "github.com/prometheus/client_golang/prometheus" - "k8s.io/client-go/tools/metrics" "k8s.io/client-go/util/workqueue" ) @@ -160,24 +159,3 @@ func (clientGoWorkqueueMetricsProvider) NewRetriesMetric(name string) workqueue. // Retries are not used so the metric is omitted. return noopMetric{} } -func (clientGoWorkqueueMetricsProvider) NewDeprecatedDepthMetric(name string) workqueue.GaugeMetric { - return noopMetric{} -} -func (clientGoWorkqueueMetricsProvider) NewDeprecatedAddsMetric(name string) workqueue.CounterMetric { - return noopMetric{} -} -func (clientGoWorkqueueMetricsProvider) NewDeprecatedLatencyMetric(name string) workqueue.SummaryMetric { - return noopMetric{} -} -func (f *clientGoWorkqueueMetricsProvider) NewDeprecatedWorkDurationMetric(name string) workqueue.SummaryMetric { - return noopMetric{} -} -func (f *clientGoWorkqueueMetricsProvider) NewDeprecatedUnfinishedWorkSecondsMetric(name string) workqueue.SettableGaugeMetric { - return noopMetric{} -} -func (f *clientGoWorkqueueMetricsProvider) NewDeprecatedLongestRunningProcessorMicrosecondsMetric(name string) workqueue.SettableGaugeMetric { - return noopMetric{} -} -func (clientGoWorkqueueMetricsProvider) NewDeprecatedRetriesMetric(name string) workqueue.CounterMetric { - return noopMetric{} -} diff --git a/discovery/kubernetes/endpoints_test.go b/discovery/kubernetes/endpoints_test.go index 7dced34a5..bc6250dc0 100644 --- a/discovery/kubernetes/endpoints_test.go +++ b/discovery/kubernetes/endpoints_test.go @@ -17,11 +17,12 @@ import ( "testing" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/discovery/targetgroup" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + + "github.com/prometheus/prometheus/discovery/targetgroup" ) func makeEndpoints() *v1.Endpoints { diff --git a/discovery/kubernetes/ingress_test.go b/discovery/kubernetes/ingress_test.go index ffe3bffc3..4159545a8 100644 --- a/discovery/kubernetes/ingress_test.go +++ b/discovery/kubernetes/ingress_test.go @@ -18,9 +18,10 @@ import ( "testing" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/discovery/targetgroup" "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/prometheus/prometheus/discovery/targetgroup" ) type TLSMode int diff --git a/discovery/kubernetes/kubernetes_test.go b/discovery/kubernetes/kubernetes_test.go index 7466bdef1..803002e06 100644 --- a/discovery/kubernetes/kubernetes_test.go +++ b/discovery/kubernetes/kubernetes_test.go @@ -20,12 +20,13 @@ import ( "time" "github.com/go-kit/kit/log" - "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/prometheus/prometheus/util/testutil" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/tools/cache" + + "github.com/prometheus/prometheus/discovery/targetgroup" + "github.com/prometheus/prometheus/util/testutil" ) // makeDiscovery creates a kubernetes.Discovery instance for testing. diff --git a/discovery/kubernetes/node_test.go b/discovery/kubernetes/node_test.go index da92eefce..402b901a5 100644 --- a/discovery/kubernetes/node_test.go +++ b/discovery/kubernetes/node_test.go @@ -18,9 +18,10 @@ import ( "testing" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/discovery/targetgroup" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/prometheus/prometheus/discovery/targetgroup" ) func makeNode(name, address string, labels map[string]string, annotations map[string]string) *v1.Node { diff --git a/discovery/kubernetes/pod_test.go b/discovery/kubernetes/pod_test.go index 25952de4e..f5aaac60f 100644 --- a/discovery/kubernetes/pod_test.go +++ b/discovery/kubernetes/pod_test.go @@ -18,10 +18,11 @@ import ( "testing" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/discovery/targetgroup" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + + "github.com/prometheus/prometheus/discovery/targetgroup" ) func makeOptionalBool(v bool) *bool { diff --git a/discovery/kubernetes/service_test.go b/discovery/kubernetes/service_test.go index c43a188d0..7011aa24d 100644 --- a/discovery/kubernetes/service_test.go +++ b/discovery/kubernetes/service_test.go @@ -18,9 +18,10 @@ import ( "testing" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/discovery/targetgroup" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/prometheus/prometheus/discovery/targetgroup" ) func makeMultiPortService() *v1.Service {