[OpenTelemetry] Add AlwaysRecordSampler - #7695
Conversation
Added `AlwaysRecordSampler` based on original proposal in open-telemetry#6732. Co-Authored-By: Mahad Janjua <134644284+majanjua-amzn@users.noreply.github.com>
Add PR number.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7695 +/- ##
==========================================
- Coverage 91.76% 91.72% -0.04%
==========================================
Files 336 337 +1
Lines 18302 18314 +12
==========================================
+ Hits 16794 16798 +4
- Misses 1508 1516 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Pull request overview
Adds the stable AlwaysRecordSampler decorator to the tracing SDK.
Changes:
- Converts
Dropdecisions toRecordOnlywhile preserving other results. - Adds unit tests, public API declarations, and a changelog entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/OpenTelemetry/Trace/Sampler/AlwaysRecordSampler.cs |
Implements the sampler decorator. |
test/OpenTelemetry.Tests/Trace/AlwaysRecordSamplerTests.cs |
Tests construction and all decision mappings. |
src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt |
Registers the stable public API. |
src/OpenTelemetry/CHANGELOG.md |
Documents the new sampler. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Pull request dashboard statusMerged · refreshed 2026-09-10 17:04 UTC Status above doesn't look right?
|
stevejgordon
left a comment
There was a problem hiding this comment.
General comment. Should we add this to the samplers list in the docs too?
- Update list of samplers. - Reword remarks. - Explicit case statement.
Changes
Add
AlwaysRecordSampler, which is now stable (open-telemetry/opentelemetry-specification#4934), based on original proposal in #6732.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes