mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Fix pending_pods, schedule_attempts_total was not recorded
because metric initializations are too early. This causes actual metric
instance become no-op.
modification made in thie commit to make sure actual metric instance won't be no-op metrics:
- re-initialize scheduler/metrics.PodSchedule{Successes, Failure, Errors} after metric creation
- scheduler/metrics.Register() should be called before initializing SchedulingQueue,
This commit is contained in:
@@ -291,6 +291,8 @@ func New(client clientset.Interface,
|
||||
nodeInfoSnapshot: snapshot,
|
||||
}
|
||||
|
||||
metrics.Register()
|
||||
|
||||
var sched *Scheduler
|
||||
source := options.schedulerAlgorithmSource
|
||||
switch {
|
||||
@@ -322,7 +324,6 @@ func New(client clientset.Interface,
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported algorithm source: %v", source)
|
||||
}
|
||||
metrics.Register()
|
||||
// Additional tweaks to the config produced by the configurator.
|
||||
sched.Recorder = recorder
|
||||
sched.DisablePreemption = options.disablePreemption
|
||||
|
||||
Reference in New Issue
Block a user