Skip to content

Support Rate Limiting Trace Sampling #114880

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

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented Apr 21, 2025

Fixes #112205

@Copilot Copilot AI review requested due to automatic review settings April 21, 2025 22:45
@ghost ghost added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Apr 21, 2025
Copy link
Contributor

@Copilot 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 introduces rate limiting trace sampling support to control the volume of sampling events based on a maximum operations per second limit.

  • Added a new RateLimiter class to enforce operation count per second.
  • Extended the diagnostic sampling logic in DsesSamplerBuilder and DsesFilterAndTransform to support rate limiting.
  • Introduced TestRateLimitingSampler in the test suite to validate the new behavior.

Reviewed Changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.

File Description
DiagnosticSourceEventSourceBridgeTests.cs Added new tests for rate limiting sampler behavior.
RateLimiter.cs New implementation of a rate limiting mechanism.
DsesSamplerBuilder.cs Added a method to create a parent rate limiting sampler.
DsesFilterAndTransform.cs Updated filter parsing to support the new rate limiting syntax.
Files not reviewed (2)
  • src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj: Language not supported
  • src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj: Language not supported

@tarekgh tarekgh added area-System.Diagnostics.Activity and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Apr 21, 2025
@tarekgh tarekgh added this to the 10.0.0 milestone Apr 21, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-diagnostics-activity
See info in area-owners.md if you want to be subscribed.

@tarekgh
Copy link
Member Author

tarekgh commented Apr 21, 2025

@tarekgh tarekgh merged commit f5b3520 into dotnet:main Apr 22, 2025
85 of 88 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.Diagnostics.Activity out of proc Rate-limited Sampling
2 participants