Fix the format of the fixed percentage sampler constant and ensure backward compatability#44656
Merged
rads-1996 merged 5 commits intoAzure:mainfrom Jan 15, 2026
Merged
Conversation
…ckward compatability
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the format of the fixed percentage sampler constant from microsoft.fixed.percentage (with dots) to microsoft.fixed_percentage (with underscores) to be consistent with other languages like the microsoft.rate_limited sampler format. The change maintains backward compatibility by accepting both formats.
Changes:
- Updated the constant value from
microsoft.fixed.percentagetomicrosoft.fixed_percentage - Added backward compatibility support to accept both formats
- Updated documentation and samples to reflect the new format
- Added a test case to verify backward compatibility works correctly
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 |
|---|---|
| sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_constants.py | Changed the FIXED_PERCENTAGE_SAMPLER constant value from "microsoft.fixed.percentage" to "microsoft.fixed_percentage" |
| sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_utils/configurations.py | Added backward compatibility check to accept both old and new formats, and added null safety checks for sampler_arg |
| sdk/monitor/azure-monitor-opentelemetry/README.md | Updated documentation to reference the new format "microsoft.fixed_percentage" |
| sdk/monitor/azure-monitor-opentelemetry/samples/tracing/sampling_configurations.py | Updated sample code comment to use the new format "microsoft.fixed_percentage" |
| sdk/monitor/azure-monitor-opentelemetry/tests/utils/test_configurations.py | Added test case to verify backward compatibility with the old format "microsoft.fixed.percentage" |
sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_utils/configurations.py
Outdated
Show resolved
Hide resolved
sdk/monitor/azure-monitor-opentelemetry/tests/utils/test_configurations.py
Show resolved
Hide resolved
4bb0db2 to
a347f05
Compare
hectorhdzg
approved these changes
Jan 15, 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
Fix the formatting for the fixed percentage sampler to be consistent with other languages.
All SDK Contribution checklist:
General Guidelines and Best Practices