diff --git a/discovery/manager.go b/discovery/manager.go index 1bc952fee2..a8d556a75d 100644 --- a/discovery/manager.go +++ b/discovery/manager.go @@ -74,7 +74,8 @@ type Manager struct { logger log.Logger actionCh chan func(context.Context) discoverCancel []context.CancelFunc - // We use map[string]*targetgroup.Group to handle Discoverers that send only updates instead of all targets on every update. + // Some Discoverers(eg. k8s) send only the updates for a given target group + // so we use map[tg.Source]*targetgroup.Group to know which group to update. targets map[poolKey]map[string]*targetgroup.Group // The sync channels sends the updates in map[targetSetName] where targetSetName is the job value from the scrape config. syncCh chan map[string][]*targetgroup.Group