-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[monitor-opentelemetry] Add RateLimitedSampler #34868
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
[monitor-opentelemetry] Add RateLimitedSampler #34868
Conversation
API Change CheckAPIView identified API level changes in this PR and created the following API reviews @azure/monitor-opentelemetry-exporter |
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 PR adds support for a new RateLimitedSampler to better control sampling rates, inspired by the Java Application Insights sampler.
- Updated import references to use the new percentage-based sampler implementation.
- Added a new RateLimitedSampler class and accompanying tests along with updates to API documentation and changelog.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
sdk/monitor/monitor-opentelemetry-exporter/test/internal/sampling.spec.ts | Updated import for ApplicationInsightsSampler to reference the new percentageSampler implementation. |
sdk/monitor/monitor-opentelemetry-exporter/test/internal/rateLimitedSampler.spec.ts | Added comprehensive tests for the new RateLimitedSampler. |
sdk/monitor/monitor-opentelemetry-exporter/src/utils/metricUtils.ts | Adjusted import style to align with type-only imports and value imports for constants. |
sdk/monitor/monitor-opentelemetry-exporter/src/sampling/samplingUtils.ts | Introduced utility functions for sampling calculations. |
sdk/monitor/monitor-opentelemetry-exporter/src/sampling/rateLimitedSampler.ts | Implemented RateLimitedSampler with state management and sampling logic. |
sdk/monitor/monitor-opentelemetry-exporter/src/sampling/percentageSampler.ts | Updated import paths and removed redundant internal hash function. |
sdk/monitor/monitor-opentelemetry-exporter/src/index.ts | Updated exports to include the new RateLimitedSampler. |
sdk/monitor/monitor-opentelemetry-exporter/review/monitor-opentelemetry-exporter.api.md | Updated API documentation to include public RateLimitedSampler APIs. |
sdk/monitor/monitor-opentelemetry-exporter/CHANGELOG.md | Documented the addition of RateLimitedSampler under features added. |
sdk/monitor/monitor-opentelemetry-exporter/src/sampling/rateLimitedSampler.ts
Outdated
Show resolved
Hide resolved
…mitedSampler.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
sdk/monitor/monitor-opentelemetry-exporter/src/sampling/percentageSampler.ts
Outdated
Show resolved
Hide resolved
…ctorhdzg/azure-sdk-for-js into hectorhdzg/rateLimitedSampler
…ctorhdzg/azure-sdk-for-js into hectorhdzg/rateLimitedSampler
Packages impacted by this PR
@azure/monitor-opentelemetry-exporter
Adding support for RateLimitedSampler, inspired by Java Application Insights sampler
https://github.com/microsoft/ApplicationInsights-Java/blob/main/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/sampling/RateLimitedSamplingPercentage.java