[dynamic control] Add SourceKind to TelemetryPolicy#2972
Merged
Conversation
25 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a SourceKind attribute to the dynamic-control TelemetryPolicy model so policies can later be prioritized/deduplicated by their originating source (OpAMP > HTTP > file) per spec requirements.
Changes:
- Added
TelemetryPolicy#getSourceKind()(defaulting toSourceKind.CUSTOMfor now). - Plumbed
SourceKindthroughTraceSamplingRatePolicyandDeletedTelemetryPolicyvia new fields/constructors and overrides. - Updated
DeletedTelemetryPolicy#toString()to includesourceKind.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingRatePolicy.java | Stores and exposes SourceKind for trace-sampling policies via new constructor/override. |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/TelemetryPolicy.java | Introduces getSourceKind() on the policy interface (default implementation for transition). |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/DeletedTelemetryPolicy.java | Stores/exposes SourceKind for deletion markers and includes it in toString(). |
LikeTheSalad
approved these changes
Jul 8, 2026
jaydeluca
approved these changes
Jul 9, 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:
The spec requires opamp > http > file priority of policies so if mergeable policies are received by more than one source in an update, the highest priority policy is retained and the others dropped. This adds source to the policies, but unused and untested for now - the "Still to implement" section shows next steps, tests are added when source starts being used
Existing Issue(s):
#2868
Testing:
not yet
Documentation:
n/a
Outstanding items:
Still to implement
Also #2868