Skip to content

[dynamic control] Add SourceKind as sources are a known list#2722

Merged
trask merged 2 commits intoopen-telemetry:mainfrom
jackshirazi:policy16
Mar 27, 2026
Merged

[dynamic control] Add SourceKind as sources are a known list#2722
trask merged 2 commits intoopen-telemetry:mainfrom
jackshirazi:policy16

Conversation

@jackshirazi
Copy link
Copy Markdown
Contributor

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

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

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 SourceKind enum 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.

@trask trask added this pull request to the merge queue Mar 26, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 26, 2026
@trask trask added this pull request to the merge queue Mar 27, 2026
Merged via the queue into open-telemetry:main with commit 1263b5b Mar 27, 2026
21 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