Repository navigation
[Monitor] Preserve rate-limited sampler local child span decisions - #49569
Merged
Radhika Gupta (rads-1996) merged 6 commits intoOct 26, 2026
Merged
Radhika Gupta (rads-1996) merged 6 commits into
Radhika Gupta (rads-1996) merged 6 commits into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 7 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Thank you for your contribution Slai.life (@huong8373tt-beep)! We will review the pull request and get back to you soon. |
Slai.life (huong8373tt-beep)
force-pushed
the
fix/rate-limited-sampler-parent-spans
branch
from
October 15, 2026 21:29
990578c to
3a95749
Compare
Slai.life (huong8373tt-beep)
force-pushed
the
fix/rate-limited-sampler-parent-spans
branch
from
October 15, 2026 21:31
3a95749 to
e4adc29
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix covers both reported failure paths with regression tests and no identified blockers; tests were not independently rerun.
No open issues 🎉
What changed in this PR
Fixes #49541 by preserving local parent sampling decisions in Azure Monitor’s rate-limited sampler, preventing incomplete traces and unnecessary rate-limit consumption.
Changes:
- Resolves implicit parents and inherits local parent sampling flags and rates.
- Adds regression coverage and release-note metadata.
| File | Description |
|---|---|
| sdk/monitor/azure-monitor-opentelemetry-exporter/tests/trace/test_rate_limited_sampling.py | Tests parent inheritance and limiter usage. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_utils.py | Preserves local parent decisions, including 100% sampling. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_rate_limited_sampling.py | Checks implicit parent context before rate limiting. |
| .chronus/changes/azure-monitor-opentelemetry-exporter-rate-limited-child-sampling-2026-10-15.md | Records the sampling fix. |
Review effort: Balanced
Radhika Gupta (rads-1996)
approved these changes
Oct 19, 2026
Jackson Weber (JacksonWeber)
approved these changes
Oct 19, 2026
Radhika Gupta (rads-1996)
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #49541.
Radhika Gupta (@rads-1996) I completed this draft before I noticed the issue had been assigned to you. If you are already implementing it or prefer a different approach, please feel free to close this PR; I am sharing the tested implementation and regression coverage in case it is useful.
RateLimitedSamplernow resolves the implicit current context before evaluating a parent and follows the sampled trace flag of a valid local parent. A sampled local parent is no longer sent through the rate limiter again; its_MS.sampleRateis inherited when present, while a missing attribute is treated as the existing 100% sampling case. A non-sampled local parent drops its child based ontrace_flags.sampled, rather thanSpan.is_recording().The regression coverage verifies:
TracerProviderparent/child creation consumes the rate limiter only once;is_recording();_MS.sampleRatekeep children as the 100% case.Validation
pytest tests/trace/test_rate_limited_sampling.py -q— 23 passed, 9 subtests passedpytest tests/ -q— 1085 passed, 10 skipped, 195 subtests passedgit diff --checkSlai Agent Runtime assisted with investigation, implementation, and tests. The account owner reviewed and authorized this contribution.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines