add metrics to record number of pending pods in different queues

This commit is contained in:
Wei Huang
2019-03-18 23:43:43 -07:00
parent 62f5fd4c6c
commit 7afbd68730
6 changed files with 233 additions and 9 deletions

View File

@@ -192,6 +192,16 @@ var (
Help: "Total preemption attempts in the cluster till now",
})
pendingPods = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Subsystem: SchedulerSubsystem,
Name: "pending_pods_total",
Help: "Number of pending pods, by the queue type. 'active' means number of pods in activeQ; 'backoff' means number of pods in backoffQ; 'unschedulable' means number of pods in unschedulableQ.",
}, []string{"queue"})
ActivePods = pendingPods.With(prometheus.Labels{"queue": "active"})
BackoffPods = pendingPods.With(prometheus.Labels{"queue": "backoff"})
UnschedulablePods = pendingPods.With(prometheus.Labels{"queue": "unschedulable"})
metricsList = []prometheus.Collector{
scheduleAttempts,
SchedulingLatency,
@@ -210,6 +220,7 @@ var (
DeprecatedSchedulingAlgorithmPremptionEvaluationDuration,
PreemptionVictims,
PreemptionAttempts,
pendingPods,
}
)