-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Change default sampler to Rate Limited Sampler #44925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
cd13b7e to
c136263
Compare
There was a problem hiding this 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 pull request changes the default sampling behavior for the Azure Monitor OpenTelemetry distribution from ApplicationInsightsSampler with 100% sampling to RateLimitedSampler with 5.0 traces per second. This is a significant behavioral change aimed at reducing telemetry volume and costs for high-traffic applications.
Changes:
- Changed default sampler from ApplicationInsightsSampler (100% sampling) to RateLimitedSampler (5 traces/second)
- Updated configuration logic to prioritize RateLimitedSampler when no explicit sampler is configured
- Updated tests to reflect the new default value of 5.0 traces per second
- Updated documentation and samples to reflect the new default behavior
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_configure.py | Swapped priority order in sampler selection - now checks sampling_ratio first, then defaults to traces_per_second with RateLimitedSampler |
| sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_utils/configurations.py | Updated default sampling configuration to use 5.0 traces per second for RateLimitedSampler instead of 1.0 for ApplicationInsightsSampler |
| sdk/monitor/azure-monitor-opentelemetry/tests/utils/test_configurations.py | Updated test assertions to expect traces_per_second=5.0 as the default instead of sampling_ratio=1.0 |
| sdk/monitor/azure-monitor-opentelemetry/samples/tracing/sampling_configurations.py | Updated sample documentation to reflect new default sampler and added code examples (with syntax errors) |
| sdk/monitor/azure-monitor-opentelemetry/README.md | Updated documentation to describe the new default sampler and added reference link (with typo) |
| sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md | Added entry describing the behavioral change (incorrectly categorized as feature instead of breaking change) |
sdk/monitor/azure-monitor-opentelemetry/samples/tracing/sampling_configurations.py
Show resolved
Hide resolved
sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_utils/configurations.py
Show resolved
Hide resolved
sdk/monitor/azure-monitor-opentelemetry/samples/tracing/sampling_configurations.py
Outdated
Show resolved
Hide resolved
sdk/monitor/azure-monitor-opentelemetry/samples/tracing/sampling_configurations.py
Show resolved
Hide resolved
JacksonWeber
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1429faf to
342b0b8
Compare
Description
Default Sampler:
Rate Limited SamplerDefault Argument:
5.0 traces per secondAll SDK Contribution checklist:
General Guidelines and Best Practices