-
Notifications
You must be signed in to change notification settings - Fork 823
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
Respect sampled bit in probability sampler #798
Conversation
/cc @Flarna |
I think we should respect the trace flag not only in the true case. Maybe move this check to the tracer and call the sampler only for root spans? |
I don't want to move the logic to the tracer because you could theoretically want to implement a sampler that does not respect trace flags (perhaps you want to use some tracestate entry instead). I revised the logic, PTAL. |
Looks good. I agree that keeping it out of tracer is the better choice. The checks in processors seem to be redundant as unsampled spans are not forwarded to processors anyway. |
@Flarna I removed the /cc @mayurkale22 WDYT about this decision? |
Codecov Report
@@ Coverage Diff @@
## master #798 +/- ##
=========================================
Coverage ? 92.74%
=========================================
Files ? 242
Lines ? 10801
Branches ? 1060
=========================================
Hits ? 10017
Misses ? 784
Partials ? 0
|
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.
Overall lgtm, added a few comments
packages/opentelemetry-core/src/trace/sampler/ProbabilitySampler.ts
Outdated
Show resolved
Hide resolved
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.
lgtm except one thing with undefined
checking,
Fixes #787