Skip to content

Commit 4cc175e

Browse files
committed
Remove direct reference to prometheus.Label for scheduler
1 parent 354a812 commit 4cc175e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

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)