[dynamic control] refactor TYPE to POLICY_TYPE for clarity#2720
Merged
trask merged 1 commit intoopen-telemetry:mainfrom Mar 25, 2026
Merged
[dynamic control] refactor TYPE to POLICY_TYPE for clarity#2720trask merged 1 commit intoopen-telemetry:mainfrom
trask merged 1 commit intoopen-telemetry:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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.TYPEtoTraceSamplingRatePolicy.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. |
...main/java/io/opentelemetry/contrib/dynamic/policy/tracesampling/TraceSamplingRatePolicy.java
Show resolved
Hide resolved
LikeTheSalad
approved these changes
Mar 25, 2026
trask
approved these changes
Mar 25, 2026
Merged
via the queue into
open-telemetry:main
with commit Mar 25, 2026
17ad15d
24 of 25 checks passed
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.
No description provided.