[dynamic control] drop comparable policies according to priority for an update#2974
Merged
Merged
Conversation
25 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Implements spec-required source-priority resolution (OpAMP > HTTP > File) when multiple policies with the same (type, id) are present in a single update, and extends test coverage to validate this behavior.
Changes:
- Normalize duplicate policies by
SourceKindpriority duringPolicyStore.updatePolicies. - Preserve
SourceKindwhen generatingDeletedTelemetryPolicynotifications. - Add unit tests covering source-priority duplicate resolution.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/PolicyStore.java | Resolves duplicate (type,id) policies using SourceKind priority and propagates source kind into deleted-policy notifications. |
| dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/PolicyStoreTest.java | Adds tests ensuring duplicates are resolved according to OpAMP/HTTP/File priority. |
LikeTheSalad
approved these changes
Jul 9, 2026
jaydeluca
approved these changes
Jul 13, 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 PR implements the dropping of policies when they are the same type and ID but different sources in the same update
Existing Issue(s):
#2868
Testing:
added
Documentation:
n/a
Outstanding items:
Still to implement
Also #2868