fix: only the latest scraper being run (#23813)
* fix: only the latest scraper being run This is due to the Golang for-loop variable problem. * chore: improve code readabilitypull/23836/head
parent
81e2ec617d
commit
e61485a847
|
@ -121,11 +121,11 @@ func (s *Scheduler) doGather() {
|
|||
s.log.Error("Cannot list targets", zap.Error(err))
|
||||
return
|
||||
}
|
||||
for _, target := range targets {
|
||||
for i := range targets {
|
||||
select {
|
||||
case s.scrapeRequest <- &target:
|
||||
case s.scrapeRequest <- &targets[i]:
|
||||
default:
|
||||
s.log.Warn("Skipping scrape due to scraper backlog", zap.String("target", target.Name))
|
||||
s.log.Warn("Skipping scrape due to scraper backlog", zap.String("target", targets[i].Name))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue