[dynamic control] Add SourceKind as sources are a known list#2722
Merged
trask merged 2 commits intoopen-telemetry:mainfrom Mar 27, 2026
Merged
[dynamic control] Add SourceKind as sources are a known list#2722trask 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
Adds a SourceKind enum to represent the known set of dynamic-control policy configuration sources (file / OpAMP / HTTP / custom), aligning with the OTEP’s notion of explicit sources and enabling consistent handling as the feature set evolves.
Changes:
- Introduce
SourceKindenum with stable lowercase config values and a parsing helper (fromConfigValue). - Add unit tests covering config value stability, case-insensitive parsing, whitespace trimming, and unknown/null handling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/source/SourceKind.java | Adds SourceKind enum + config value normalization/parsing API. |
| dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/source/SourceKindTest.java | Adds tests validating SourceKind config value and parsing behavior. |
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/source/SourceKind.java
Show resolved
Hide resolved
...mic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/source/SourceKindTest.java
Outdated
Show resolved
Hide resolved
LikeTheSalad
approved these changes
Mar 26, 2026
trask
approved these changes
Mar 26, 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:
SourceKind enum added, the OTEP mentions explicit sources, and though this could widen, it will still likely be an enum. Making it an enum allows consistent handling of different sources
Existing Issue(s):
#2546
Testing:
Added
Documentation:
Added
Outstanding items:
The SourceKind is not yet applied. The next PR will start applying it, this PR is kept smaller for easier review