Skip to content

[dynamic control] Move to using SourceWrapper, simplifying parsing#2708

Merged
jaydeluca merged 1 commit intoopen-telemetry:mainfrom
jackshirazi:policy12
Mar 23, 2026
Merged

[dynamic control] Move to using SourceWrapper, simplifying parsing#2708
jaydeluca merged 1 commit intoopen-telemetry:mainfrom
jackshirazi:policy12

Conversation

@jackshirazi
Copy link
Copy Markdown
Contributor

Description:

Continuing the transition to simpler validation and adding an abstract validator to include utility validation methods concrete subclasses can use

Existing Issue(s):

#2546

Testing:

Already present but will be simpler along with simpler validation

Documentation:

docs will be updated after migration is complete

Outstanding items:

several more PRs to come to migrate from json to jsonkeyvalue and refactor of providers to simplify validation, I'm trying to keep the PRs as small as possible which means some duplication in the meantime until complete

@jackshirazi jackshirazi requested a review from a team as a code owner March 20, 2026 18:28
Copilot AI review requested due to automatic review settings March 20, 2026 18:28
@github-actions github-actions Bot requested a review from LikeTheSalad March 20, 2026 18:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR continues the dynamic-control “Telemetry Policy” work by shifting LinePerPolicyFileProvider to parse input lines into SourceWrapper instances (via SourceFormat) and adding a new abstract validator base to centralize source-dispatch and common parsing helpers.

Changes:

  • Update LinePerPolicyFileProvider to parse each non-comment line using SourceFormat and validate via PolicyValidator#validate(SourceWrapper).
  • Add AbstractSourcePolicyValidator with shared JSON/key-value dispatch and primitive parsing helpers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProvider.java Switches line parsing/validation to SourceFormat + SourceWrapper flow and updates provider Javadoc.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/AbstractSourcePolicyValidator.java Introduces a base validator for dispatching by source format and shared parsing helpers.

@jaydeluca jaydeluca added this pull request to the merge queue Mar 23, 2026
Merged via the queue into open-telemetry:main with commit 73c7be1 Mar 23, 2026
24 of 25 checks passed
@jackshirazi jackshirazi deleted the policy12 branch April 1, 2026 13:17
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