Skip to content

[dynamic control] refactor TYPE to POLICY_TYPE for clarity#2720

Merged
trask merged 1 commit intoopen-telemetry:mainfrom
jackshirazi:policy14
Mar 25, 2026
Merged

[dynamic control] refactor TYPE to POLICY_TYPE for clarity#2720
trask merged 1 commit intoopen-telemetry:mainfrom
jackshirazi:policy14

Conversation

@jackshirazi
Copy link
Copy Markdown
Contributor

No description provided.

@jackshirazi jackshirazi requested a review from a team as a code owner March 24, 2026 17:14
Copilot AI review requested due to automatic review settings March 24, 2026 17:14
@github-actions github-actions bot requested a review from LikeTheSalad March 24, 2026 17:14
@jackshirazi jackshirazi changed the title refactor TYPE to POLICY_TYPE for clarity [dynamic control] refactor TYPE to POLICY_TYPE for clarity Mar 24, 2026
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

This PR refactors the trace-sampling policy type constant name from TYPE to POLICY_TYPE to make its meaning clearer across the dynamic-control policy/trace-sampling implementation and tests.

Changes:

  • Renamed TraceSamplingRatePolicy.TYPE to TraceSamplingRatePolicy.POLICY_TYPE.
  • Updated production code (validator + implementer) to use the renamed constant.
  • Updated tests to reference the renamed constant instead of string literals / old constant.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingRatePolicy.java Renames the public policy type constant and updates the superclass constructor arg.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingValidator.java Uses POLICY_TYPE when reporting supported policy type.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingRatePolicyImplementer.java Uses POLICY_TYPE when filtering incoming policies.
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingValidatorTest.java Updates test constant to point at POLICY_TYPE.
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingRatePolicyImplementerTest.java Updates type-only policy construction to use POLICY_TYPE.
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProviderTest.java Replaces "trace-sampling" literal with POLICY_TYPE.

@trask trask added this pull request to the merge queue Mar 25, 2026
Merged via the queue into open-telemetry:main with commit 17ad15d Mar 25, 2026
24 of 25 checks passed
@jackshirazi jackshirazi deleted the policy14 branch April 1, 2026 13:17
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