[dynamic control] complete the jsonkeyvalue and simpler validation migration#2715
Merged
trask merged 2 commits intoopen-telemetry:mainfrom Mar 24, 2026
Merged
[dynamic control] complete the jsonkeyvalue and simpler validation migration#2715trask merged 2 commits intoopen-telemetry:mainfrom
trask merged 2 commits intoopen-telemetry:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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 viaAbstractSourcePolicyValidator. - Renames/realigns JSON handling to
SourceFormat.JSONKEYVALUEand 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. |
...rol/src/test/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProviderTest.java
Show resolved
Hide resolved
...t/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingValidatorTest.java
Show resolved
Hide resolved
...control/src/main/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProvider.java
Outdated
Show resolved
Hide resolved
...-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/source/JsonSourceWrapper.java
Outdated
Show resolved
Hide resolved
LikeTheSalad
approved these changes
Mar 24, 2026
trask
approved these changes
Mar 24, 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:
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: