Skip to content

[dynamic control] Add change checking for file & http sources#2975

Merged
jaydeluca merged 4 commits into
open-telemetry:mainfrom
jackshirazi:policy-phase2-18
Jul 14, 2026
Merged

[dynamic control] Add change checking for file & http sources#2975
jaydeluca merged 4 commits into
open-telemetry:mainfrom
jackshirazi:policy-phase2-18

Conversation

@jackshirazi

Copy link
Copy Markdown
Contributor

Description:

The three defined sources are opamp, http and file. 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 changed

Existing Issue(s):

#2868

Testing:

Added

Documentation:

Added

Outstanding items:

Also #2868

Copilot AI review requested due to automatic review settings July 9, 2026 16:11
@jackshirazi
jackshirazi requested a review from a team as a code owner July 9, 2026 16:11
@github-actions
github-actions Bot requested a review from LikeTheSalad July 9, 2026 16:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PolicyProviderPoller with 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 LikeTheSalad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just a minor comment.

@jaydeluca
jaydeluca added this pull request to the merge queue Jul 14, 2026
Merged via the queue into open-telemetry:main with commit 5875f45 Jul 14, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants