-
Notifications
You must be signed in to change notification settings - Fork 501
[SDK] Implements options for the ParentBasedSampler with default values #3553
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
[SDK] Implements options for the ParentBasedSampler with default values #3553
Conversation
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
62a71fa
to
f148f7a
Compare
f148f7a
to
e68eb81
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3553 +/- ##
==========================================
+ Coverage 90.00% 90.03% +0.03%
==========================================
Files 220 220
Lines 7056 7065 +9
==========================================
+ Hits 6350 6360 +10
+ Misses 706 705 -1
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks the the PR.
See some minor comments, looks good overall.
There was a problem hiding this 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 enhances the ParentBasedSampler to fully comply with the OpenTelemetry specification by implementing comprehensive sampling logic that distinguishes between local and remote parents and their sampling states. The previous simplified implementation has been replaced with a complete solution that supports five configurable delegate samplers with spec-defined defaults.
Key changes:
- Expanded ParentBasedSampler constructor to accept five delegate samplers with default values
- Updated sampling logic to handle local vs remote parent contexts appropriately
- Enhanced factory methods to support both simple and fully-configured sampler creation
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
sdk/include/opentelemetry/sdk/trace/samplers/parent.h |
Updated ParentBasedSampler class with new constructor accepting five delegate samplers and improved documentation |
sdk/src/trace/samplers/parent.cc |
Implemented new sampling logic that delegates based on parent context type and sampling state |
sdk/include/opentelemetry/sdk/trace/samplers/parent_factory.h |
Added overloaded factory method for creating fully-configured ParentBasedSampler |
sdk/src/trace/samplers/parent_factory.cc |
Implemented factory methods with default sampler instantiation |
sdk/test/trace/parent_sampler_test.cc |
Extended test coverage for new local/remote parent sampling scenarios |
CHANGELOG.md |
Added entry documenting the ParentBasedSampler enhancement |
Comments suppressed due to low confidence (1)
sdk/src/trace/samplers/parent.cc:79
- [nitpick] Extra blank line at end of file should be removed to maintain consistent formatting.
} // namespace trace
Fixes #3545
Changes
This PR updates the ParentBasedSampler to be fully compliant with the OpenTelemetry specification.
The previous implementation was a simplified version. This change introduces the complete logic, which distinguishes between local and remote parents, and whether they were sampled. The constructor now accepts five configurable delegate samplers with defaults as defined in the spec (
AlwaysOnSampler
andAlwaysOffSampler
).For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes