Skip to content

[OpenTelemetry.Extensions] Trace RateLimitingSampler reject non-positive values#4127

Merged
Kielek merged 2 commits into
open-telemetry:mainfrom
ysolomchenko:RateLimitingSampler-allows-non-positive-rate-leading-to-divide-by-zero
Apr 16, 2026
Merged

[OpenTelemetry.Extensions] Trace RateLimitingSampler reject non-positive values#4127
Kielek merged 2 commits into
open-telemetry:mainfrom
ysolomchenko:RateLimitingSampler-allows-non-positive-rate-leading-to-divide-by-zero

Conversation

@ysolomchenko

Copy link
Copy Markdown
Contributor

Fixes # N/A
Design discussion issue # N/A

Found by Codex analysis

Changes

RateLimitingSampler reject non-positive maxTracesPerSecond values instead of creating an invalid internal rate limiter state.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@github-actions github-actions Bot added the comp:extensions Things related to OpenTelemetry.Extensions label Apr 16, 2026
@ysolomchenko
ysolomchenko marked this pull request as ready for review April 16, 2026 08:45
@ysolomchenko
ysolomchenko requested a review from a team as a code owner April 16, 2026 08:45
@codecov

codecov Bot commented Apr 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.83%. Comparing base (25a64cf) to head (2d1b487).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4127   +/-   ##
=======================================
  Coverage   72.83%   72.83%           
=======================================
  Files         461      461           
  Lines       18215    18217    +2     
=======================================
+ Hits        13267    13269    +2     
  Misses       4948     4948           
Flag Coverage Δ
unittests-Extensions 90.74% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nTelemetry.Extensions/Trace/RateLimitingSampler.cs 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Kielek
Kielek added this pull request to the merge queue Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:extensions Things related to OpenTelemetry.Extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants