discovery-manager comment update
@@ -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
