From 4cc175e8d82d0474bdf39b6ee50d50572e802b90 Mon Sep 17 00:00:00 2001 From: RainbowMango Date: Fri, 27 Sep 2019 10:16:31 +0800 Subject: [PATCH 1/2] Remove direct reference to prometheus.Label for scheduler --- pkg/scheduler/metrics/metrics.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/scheduler/metrics/metrics.go b/pkg/scheduler/metrics/metrics.go index b1903553b67..cd056ce0c16 100644 --- a/pkg/scheduler/metrics/metrics.go +++ b/pkg/scheduler/metrics/metrics.go @@ -20,8 +20,6 @@ import ( "sync" "time" - "github.com/prometheus/client_golang/prometheus" - "k8s.io/component-base/metrics" "k8s.io/component-base/metrics/legacyregistry" volumeschedulingmetrics "k8s.io/kubernetes/pkg/controller/volume/scheduling/metrics" @@ -60,11 +58,11 @@ var ( StabilityLevel: metrics.ALPHA, }, []string{"result"}) // PodScheduleSuccesses counts how many pods were scheduled. - PodScheduleSuccesses = scheduleAttempts.With(prometheus.Labels{"result": "scheduled"}) + PodScheduleSuccesses = scheduleAttempts.With(metrics.Labels{"result": "scheduled"}) // PodScheduleFailures counts how many pods could not be scheduled. - PodScheduleFailures = scheduleAttempts.With(prometheus.Labels{"result": "unschedulable"}) + PodScheduleFailures = scheduleAttempts.With(metrics.Labels{"result": "unschedulable"}) // PodScheduleErrors counts how many pods could not be scheduled due to a scheduler error. - PodScheduleErrors = scheduleAttempts.With(prometheus.Labels{"result": "error"}) + PodScheduleErrors = scheduleAttempts.With(metrics.Labels{"result": "error"}) SchedulingLatency = metrics.NewSummaryVec( &metrics.SummaryOpts{ Subsystem: SchedulerSubsystem, @@ -257,17 +255,17 @@ func Register() { // ActivePods returns the pending pods metrics with the label active func ActivePods() metrics.GaugeMetric { - return pendingPods.With(prometheus.Labels{"queue": "active"}) + return pendingPods.With(metrics.Labels{"queue": "active"}) } // BackoffPods returns the pending pods metrics with the label backoff func BackoffPods() metrics.GaugeMetric { - return pendingPods.With(prometheus.Labels{"queue": "backoff"}) + return pendingPods.With(metrics.Labels{"queue": "backoff"}) } // UnschedulablePods returns the pending pods metrics with the label unschedulable func UnschedulablePods() metrics.GaugeMetric { - return pendingPods.With(prometheus.Labels{"queue": "unschedulable"}) + return pendingPods.With(metrics.Labels{"queue": "unschedulable"}) } // Reset resets metrics From c0c1d8e985169d5ca974c46891188f4b0392cdbb Mon Sep 17 00:00:00 2001 From: RainbowMango Date: Fri, 27 Sep 2019 10:18:31 +0800 Subject: [PATCH 2/2] Update bazel by hack/update-bazel.sh --- pkg/scheduler/metrics/BUILD | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/scheduler/metrics/BUILD b/pkg/scheduler/metrics/BUILD index 6054ea4a7aa..7cd56dda5b3 100644 --- a/pkg/scheduler/metrics/BUILD +++ b/pkg/scheduler/metrics/BUILD @@ -13,7 +13,6 @@ go_library( "//pkg/controller/volume/scheduling/metrics:go_default_library", "//staging/src/k8s.io/component-base/metrics:go_default_library", "//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library", - "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", ], )