Skip to content

Commit 29f23e6

Browse files
authored
Merge pull request kubernetes#83220 from RainbowMango/pr_remove_direct_reference_to_label
Remove direct reference to label
2 parents 0a6a465 + c0c1d8e commit 29f23e6

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

pkg/scheduler/metrics/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ go_library(
1313
"//pkg/controller/volume/scheduling/metrics:go_default_library",
1414
"//staging/src/k8s.io/component-base/metrics:go_default_library",
1515
"//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library",
16-
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
1716
],
1817
)
1918

pkg/scheduler/metrics/metrics.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import (
2020
"sync"
2121
"time"
2222

23-
"github.com/prometheus/client_golang/prometheus"
24-
2523
"k8s.io/component-base/metrics"
2624
"k8s.io/component-base/metrics/legacyregistry"
2725
volumeschedulingmetrics "k8s.io/kubernetes/pkg/controller/volume/scheduling/metrics"
@@ -60,11 +58,11 @@ var (
6058
StabilityLevel: metrics.ALPHA,
6159
}, []string{"result"})
6260
// PodScheduleSuccesses counts how many pods were scheduled.
63-
PodScheduleSuccesses = scheduleAttempts.With(prometheus.Labels{"result": "scheduled"})
61+
PodScheduleSuccesses = scheduleAttempts.With(metrics.Labels{"result": "scheduled"})
6462
// PodScheduleFailures counts how many pods could not be scheduled.
65-
PodScheduleFailures = scheduleAttempts.With(prometheus.Labels{"result": "unschedulable"})
63+
PodScheduleFailures = scheduleAttempts.With(metrics.Labels{"result": "unschedulable"})
6664
// PodScheduleErrors counts how many pods could not be scheduled due to a scheduler error.
67-
PodScheduleErrors = scheduleAttempts.With(prometheus.Labels{"result": "error"})
65+
PodScheduleErrors = scheduleAttempts.With(metrics.Labels{"result": "error"})
6866
SchedulingLatency = metrics.NewSummaryVec(
6967
&metrics.SummaryOpts{
7068
Subsystem: SchedulerSubsystem,
@@ -257,17 +255,17 @@ func Register() {
257255

258256
// ActivePods returns the pending pods metrics with the label active
259257
func ActivePods() metrics.GaugeMetric {
260-
return pendingPods.With(prometheus.Labels{"queue": "active"})
258+
return pendingPods.With(metrics.Labels{"queue": "active"})
261259
}
262260

263261
// BackoffPods returns the pending pods metrics with the label backoff
264262
func BackoffPods() metrics.GaugeMetric {
265-
return pendingPods.With(prometheus.Labels{"queue": "backoff"})
263+
return pendingPods.With(metrics.Labels{"queue": "backoff"})
266264
}
267265

268266
// UnschedulablePods returns the pending pods metrics with the label unschedulable
269267
func UnschedulablePods() metrics.GaugeMetric {
270-
return pendingPods.With(prometheus.Labels{"queue": "unschedulable"})
268+
return pendingPods.With(metrics.Labels{"queue": "unschedulable"})
271269
}
272270

273271
// Reset resets metrics

0 commit comments

Comments
 (0)