Repository navigation
chore(sources): read http client targets on every interval tick - #27156
JinchengCao wants to merge 7 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
The fixed-target adapter preserves existing callers’ endpoint lists, and each request context receives the same target that supplies its URL. The completed static review identified no reportable defects.
🤖 Bits Code Review · Commit e8d0074
…ient-body-timeout
…eout' into JinchengCao-http-client-dynamic-targets
There was a problem hiding this comment.
More details
Static review supports that target URLs remain paired with their source-specific context as targets change between ticks, and that the timeout bounds response-body reads. Runtime behavior was not exercised.
🤖 Bits Code Review · Commit 446d904
Summary
call()insrc/sources/util/http_client.rsis the scrape loop shared by thehttp_clientandprometheus_scrapesources. It used to take a fixed list of URLs. It now takes a function that returns the targets for each interval tick. A target can also carry source-specific data, which the source's context builder receives along with the URL.With this change, Kubernetes Pod discovery (#26013) can reuse the shared loop with a target list that changes between ticks, instead of keeping its own copy of the request logic. Existing callers pass a fixed list through
fixed_targets()and behave as before.References
Vector configuration
NA
How did you test this PR?
Added
targets_are_read_on_every_tick: the targets change after the first tick, and each event must carry the data of the target it was scraped from. Existinghttp_clientandprometheus_scrapetests pass unchanged.Does this PR include user facing changes?
For a new deprecation announcement, follow the deprecation policy and add a
deprecation.d/notice instead.no-changeloglabel to this PR.