[dynamic control] Add change checking for file & http sources#2975
Merged
Conversation
25 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a shared polling utility to the dynamic-control policy package to detect changes in file and HTTP policy sources and trigger callbacks when changes are observed.
Changes:
- Introduces
PolicyProviderPollerwith shared scheduler lifecycle, file change detection (mtime/size), and HTTP change detection (ETag/Last-Modified/body hash). - Adds unit tests covering scheduler sharing, file change callbacks, URL change callbacks, and input validation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/PolicyProviderPoller.java | New shared poller implementation for file/HTTP sources, including scheduler lifecycle and change detection logic. |
| dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/PolicyProviderPollerTest.java | New tests validating change detection behavior and shared scheduler behavior. |
LikeTheSalad
approved these changes
Jul 10, 2026
LikeTheSalad
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Just a minor comment.
jaydeluca
reviewed
Jul 13, 2026
jaydeluca
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
The three defined sources are
opamp,httpandfile. The opamp client used has it's own polling mechanism (for opamp/http, none needed for a opamp/websocket), but http and file need repeated checks for changes. This PR adds a common polling mechanism for those two sources to check for changes and callback to the provider if the source has changedExisting Issue(s):
#2868
Testing:
Added
Documentation:
Added
Outstanding items:
Also #2868