mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #83220 from RainbowMango/pr_remove_direct_reference_to_label
Remove direct reference to label
This commit is contained in:
commit
29f23e6647
@ -13,7 +13,6 @@ go_library(
|
|||||||
"//pkg/controller/volume/scheduling/metrics:go_default_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:go_default_library",
|
||||||
"//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library",
|
"//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library",
|
||||||
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,8 +20,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
|
||||||
|
|
||||||
"k8s.io/component-base/metrics"
|
"k8s.io/component-base/metrics"
|
||||||
"k8s.io/component-base/metrics/legacyregistry"
|
"k8s.io/component-base/metrics/legacyregistry"
|
||||||
volumeschedulingmetrics "k8s.io/kubernetes/pkg/controller/volume/scheduling/metrics"
|
volumeschedulingmetrics "k8s.io/kubernetes/pkg/controller/volume/scheduling/metrics"
|
||||||
@ -60,11 +58,11 @@ var (
|
|||||||
StabilityLevel: metrics.ALPHA,
|
StabilityLevel: metrics.ALPHA,
|
||||||
}, []string{"result"})
|
}, []string{"result"})
|
||||||
// PodScheduleSuccesses counts how many pods were scheduled.
|
// 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 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 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(
|
SchedulingLatency = metrics.NewSummaryVec(
|
||||||
&metrics.SummaryOpts{
|
&metrics.SummaryOpts{
|
||||||
Subsystem: SchedulerSubsystem,
|
Subsystem: SchedulerSubsystem,
|
||||||
@ -257,17 +255,17 @@ func Register() {
|
|||||||
|
|
||||||
// ActivePods returns the pending pods metrics with the label active
|
// ActivePods returns the pending pods metrics with the label active
|
||||||
func ActivePods() metrics.GaugeMetric {
|
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
|
// BackoffPods returns the pending pods metrics with the label backoff
|
||||||
func BackoffPods() metrics.GaugeMetric {
|
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
|
// UnschedulablePods returns the pending pods metrics with the label unschedulable
|
||||||
func UnschedulablePods() metrics.GaugeMetric {
|
func UnschedulablePods() metrics.GaugeMetric {
|
||||||
return pendingPods.With(prometheus.Labels{"queue": "unschedulable"})
|
return pendingPods.With(metrics.Labels{"queue": "unschedulable"})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset resets metrics
|
// Reset resets metrics
|
||||||
|
Loading…
Reference in New Issue
Block a user