Skip to content

Commit 8afac07

Browse files
committed
c
1 parent 89d702d commit 8afac07

File tree

1 file changed

+3
-2
lines changed
  • receiver/prometheusreceiver/targetallocator

1 file changed

+3
-2
lines changed

receiver/prometheusreceiver/targetallocator/manager.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func (m *Manager) Start(ctx context.Context, host component.Host, sm *scrape.Man
6767
return nil
6868
}
6969
m.settings.Logger.Info("Starting target allocator discovery")
70+
// immediately sync jobs, not waiting for the first tick
7071
savedHash, err := m.sync(ctx, uint64(0))
7172
if err != nil {
7273
m.settings.Logger.Error("Failed to sync target allocator", zap.Error(err))
@@ -155,8 +156,8 @@ func (m *Manager) setupTLSWatchers(ctx context.Context) error {
155156
return nil
156157
}
157158

158-
// sync requests jobs from targetAllocator and updates the underlying receiver.
159-
// A fresh HTTP client is created on each sync so that any changes to certificate files are picked up.
159+
// sync request jobs from targetAllocator and update underlying receiver, if the response does not match the provided compareHash.
160+
// baseDiscoveryCfg can be used to provide additional ScrapeConfigs which will be added to the retrieved jobs.
160161
func (m *Manager) sync(ctx context.Context, compareHash uint64) (uint64, error) {
161162
m.settings.Logger.Debug("Syncing target allocator jobs")
162163
m.settings.Logger.Debug("endpoint", zap.String("endpoint", m.cfg.Endpoint))

0 commit comments

Comments
 (0)