Skip to content

Preserve the Jaeger rate limiter balance on rate changes - #9094

Open
yangjj-iso wants to merge 3 commits into
open-telemetry:mainfrom
yangjj-iso:feat/2465-preserve-jaeger-rate-state
Open

yangjj-iso wants to merge 3 commits into
open-telemetry:mainfrom
yangjj-iso:feat/2465-preserve-jaeger-rate-state

Conversation

@yangjj-iso

@yangjj-iso yangjj-iso commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2465. #8946 already retains the sampler when polling returns an unchanged strategy.

A rate change within the rate-limiting strategy now preserves the available credits, capped by the new capacity, and subsequent refills use the new rate. Strategy changes still construct their own sampler. Sampling and reconfiguration are serialized within the Jaeger rate-limiting sampler so a concurrent sample cannot spend the same credits twice during transfer.

The focused Jaeger sampler tests and sdk:common rate limiter tests passed on JDK 25. The clock-controlled test spends the original budget, changes the rate, and checks the transferred credits and later refill. Spotless was applied.

Codex assisted with implementation and verification.

Follow-up verification: a second clock-controlled test decreases the rate and checks that retained credits are capped at the new capacity, then verifies subsequent refill. The Jaeger sampler suite had 27 passing tests and 3 Docker-dependent skips. All 367 sdk:common tests and Spotless checks for both modules passed on JDK 25.

At 1d3cbb9c, a clock-controlled regression covers changing the rate to zero and enabling it again. Sampling stays off during the zero-rate interval and resumes after the newly configured rate earns its first credit. Local verification passed 28 Jaeger sampler tests and 367 sdk:common tests on JDK 25. Three Jaeger tests that require Docker were skipped.

Apply rate changes to the existing rate-limiting sampler and transfer only its available credits, capped at the new capacity.
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-12-04 12:18 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with the author? Comment /dashboard route:author to route it back.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.51%. Comparing base (e91fe6d) to head (1d3cbb9).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9094      +/-   ##
============================================
- Coverage     90.54%   90.51%   -0.03%     
- Complexity    11254    11268      +14     
============================================
  Files          1040     1040              
  Lines         30703    30766      +63     
  Branches       4015     4031      +16     
============================================
+ Hits          27799    27848      +49     
- Misses         1928     1934       +6     
- Partials        976      984       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: redyyang <3202137046@qq.com>
@yangjj-iso
yangjj-iso marked this pull request as ready for review December 4, 2026 11:29
@yangjj-iso
yangjj-iso requested a review from a team as a code owner December 4, 2026 11:29
Signed-off-by: redyyang <3202137046@qq.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jaeger remote sampler should not reinitialize Sampler when configuration hasn't changed

1 participant