Skip to content

[dynamic control] complete the jsonkeyvalue and simpler validation migration#2715

Merged
trask merged 2 commits intoopen-telemetry:mainfrom
jackshirazi:policy13
Mar 24, 2026
Merged

[dynamic control] complete the jsonkeyvalue and simpler validation migration#2715
trask merged 2 commits intoopen-telemetry:mainfrom
jackshirazi:policy13

Conversation

@jackshirazi
Copy link
Copy Markdown
Contributor

Description:

Completing the transition to simpler validation and jsonkeyvalue
source name. Validation now is a simpler validate(SourceWrapper). More files in this PR but the changes are simple to see JSON->JSONKEYVALUE, and simpler validation

Existing Issue(s):

#2546

Testing:

Included

Documentation:

updated

Outstanding items:

@jackshirazi jackshirazi requested a review from a team as a code owner March 23, 2026 12:54
Copilot AI review requested due to automatic review settings March 23, 2026 12:54
@github-actions github-actions bot requested a review from LikeTheSalad March 23, 2026 12:54
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

Completes the dynamic-control migration to the JSONKEYVALUE source format and the simplified PolicyValidator.validate(SourceWrapper) validation flow, updating trace-sampling validation and related tests accordingly.

Changes:

  • Removes legacy string/alias validation APIs in favor of validate(SourceWrapper) and shared dispatch via AbstractSourcePolicyValidator.
  • Renames/realigns JSON handling to SourceFormat.JSONKEYVALUE and updates parsers/wrappers accordingly.
  • Updates unit tests and file-provider parsing to use JSONKEYVALUE + KEYVALUE inputs.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingValidator.java Migrates trace-sampling validation to AbstractSourcePolicyValidator JSONKEYVALUE/KEYVALUE hooks.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/PolicyValidator.java Simplifies validator API to validate(SourceWrapper) only.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/AbstractSourcePolicyValidator.java Removes transitional JSON case and centralizes format dispatch + parsing helpers.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/source/SourceFormat.java Removes JSON format, keeps JSONKEYVALUE + KEYVALUE.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/source/JsonSourceWrapper.java Aligns wrapper format reporting and docs to JSONKEYVALUE.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProvider.java Updates line parsing to use JSONKEYVALUE and policy-type-based validator selection.
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingValidatorTest.java Updates validator tests to parse via SourceFormat and adds KEYVALUE coverage.
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/source/SourceFormatTest.java Updates SourceFormat tests for JSONKEYVALUE.
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProviderTest.java Updates file-provider tests to new JSONKEYVALUE/KEYVALUE inputs and validator API.

@trask trask added this pull request to the merge queue Mar 24, 2026
Merged via the queue into open-telemetry:main with commit fbac60e Mar 24, 2026
21 checks passed
@jackshirazi jackshirazi deleted the policy13 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