-
Notifications
You must be signed in to change notification settings - Fork 845
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
feat: add ParentOrElseSampler #1279
Conversation
Also renamed ALWAYS_SAMPLER and NEVER_SAMPLER to AlwaysOnSampler and AlwaysOffSampler respectively.
95272d4
to
de935d1
Compare
Codecov Report
@@ Coverage Diff @@
## master #1279 +/- ##
==========================================
+ Coverage 93.12% 93.16% +0.03%
==========================================
Files 133 136 +3
Lines 3841 3862 +21
Branches 785 788 +3
==========================================
+ Hits 3577 3598 +21
Misses 264 264
|
packages/opentelemetry-core/src/trace/sampler/ProbabilitySampler.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-core/src/trace/sampler/ParentOrElseSampler.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-core/src/trace/sampler/AlwaysOnSampler.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-core/src/trace/sampler/AlwaysOffSampler.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-core/src/trace/sampler/ProbabilitySampler.ts
Outdated
Show resolved
Hide resolved
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,
with regards to description I would prefer having separate unit tests for that only so it is easier to spot the spec requirement for it whenever something fails.
@obecny The sampler's description is depends on the parameters they were constructed, e.g. for ProbabilitySamplers their description can be |
It really doesn't matter. The unit tests are meant to test one thing so if some test fails you know exactly what happens. Knowing that if you create a unit test
whenever it fails you know exactly that there is a problem with description and you know where to look. But you created a unit test
so if it fails you have no idea why it failed whether it was sampling decision or something different in this case the description. |
etc. |
@obecny 👋 , tests updated, PTAL :) |
Which problem is this PR solving?
Short description of the changes
AlwaysOffSampler respectively.