Problem
In internal/observers/scheduler/observer.go, the PrometheusScraper is created in New() but never actually started in Run().
// New() creates it:
promScraper := NewPrometheusScraper(promConfig)
obs.promScraper = promScraper
// But Run() only starts eventsWatcher:
func (o *SchedulerObserver) Run(ctx context.Context) error {
if o.eventsWatcher != nil {
o.eventsWatcher.Run(ctx) // ✓ used
}
// promScraper.Run() never called ✗
<-ctx.Done()
return nil
}
Impact
- If
eventsWatcher is nil (no K8s client), the scheduler observer does nothing useful
- Prometheus metrics from kube-scheduler are never scraped
- The
promScraper field is dead code
Suggested Fix
Either:
- Start
promScraper in Run() alongside eventsWatcher
- Remove
promScraper if it's not needed
Found By
Copilot code review on PR #577
Problem
In
internal/observers/scheduler/observer.go, thePrometheusScraperis created inNew()but never actually started inRun().Impact
eventsWatcheris nil (no K8s client), the scheduler observer does nothing usefulpromScraperfield is dead codeSuggested Fix
Either:
promScraperinRun()alongsideeventsWatcherpromScraperif it's not neededFound By
Copilot code review on PR #577