Skip to content

[dynamic control] remove policy equals/hashcode as they are no longer needed#2968

Merged
jaydeluca merged 2 commits into
open-telemetry:mainfrom
jackshirazi:policy-phase2-13
Jul 8, 2026
Merged

[dynamic control] remove policy equals/hashcode as they are no longer needed#2968
jaydeluca merged 2 commits into
open-telemetry:mainfrom
jackshirazi:policy-phase2-13

Conversation

@jackshirazi

Copy link
Copy Markdown
Contributor

Description:

#2960 changed how policies are compared, following which they no longer need to adapt equals/hashcode, so those method overrides are being dropped

Existing Issue(s):

#2868

Testing:

added

Documentation:

n/a

Outstanding items:

#2868

@jackshirazi
jackshirazi requested a review from a team as a code owner July 7, 2026 22:44
Copilot AI review requested due to automatic review settings July 7, 2026 22:44
@github-actions
github-actions Bot requested a review from LikeTheSalad July 7, 2026 22:44

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

Removes now-unneeded value-based equals/hashCode overrides from dynamic-control telemetry policy implementations after the policy store comparison model changed (per #2960), and updates documentation/tests accordingly.

Changes:

  • Dropped equals/hashCode overrides from TraceSamplingRatePolicy and DeletedTelemetryPolicy.
  • Removed tests and test-helper overrides that asserted value-based Java equality.
  • Updated TelemetryPolicy documentation and a comment in probability normalization to reflect the new comparison behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingRatePolicy.java Removes equality/hash behavior and adjusts normalization comment wording.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/DeletedTelemetryPolicy.java Removes equality/hash behavior for deleted policy marker instances.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/TelemetryPolicy.java Updates interface docs to emphasize store identity is not based on Java object equality.
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingRatePolicyTest.java Removes equality/hash tests and keeps probability normalization coverage.
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/DeletedTelemetryPolicyTest.java Removes equality/hash tests for deleted policies.
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProviderTest.java Removes unnecessary equality/hash overrides from a test policy helper.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@jaydeluca
jaydeluca added this pull request to the merge queue Jul 8, 2026
Merged via the queue into open-telemetry:main with commit 2c0fd5a Jul 8, 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