Skip to content

[dynamic control] drop comparable policies according to priority for an update#2974

Merged
jaydeluca merged 1 commit into
open-telemetry:mainfrom
jackshirazi:policy-phase2-17
Jul 13, 2026
Merged

[dynamic control] drop comparable policies according to priority for an update#2974
jaydeluca merged 1 commit into
open-telemetry:mainfrom
jackshirazi:policy-phase2-17

Conversation

@jackshirazi

Copy link
Copy Markdown
Contributor

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

@jackshirazi
jackshirazi requested a review from a team as a code owner July 9, 2026 13:01
Copilot AI review requested due to automatic review settings July 9, 2026 13:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SourceKind priority during PolicyStore.updatePolicies.
  • Preserve SourceKind when generating DeletedTelemetryPolicy notifications.
  • 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.

@github-actions
github-actions Bot requested a review from LikeTheSalad July 9, 2026 13:21
@jaydeluca
jaydeluca added this pull request to the merge queue Jul 13, 2026
Merged via the queue into open-telemetry:main with commit c2d988f Jul 13, 2026
24 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