-
Notifications
You must be signed in to change notification settings - Fork 444
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
Always Off Sampler #125
Always Off Sampler #125
Conversation
I signed it |
Codecov Report
@@ Coverage Diff @@
## master #125 +/- ##
==========================================
+ Coverage 93.29% 93.37% +0.07%
==========================================
Files 66 69 +3
Lines 1656 1676 +20
==========================================
+ Hits 1545 1565 +20
Misses 111 111
|
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.
Looks good. No comments from me.
*/ | ||
SamplingResult ShouldSample( | ||
const SpanContext *parent_context, | ||
trace_api::TraceId trace_id, |
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.
There is potential optimization to this, by avoiding the trace_id creation (random number generation) at all. Probably worth creating an issue for tracking.
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.
Alright, I'll bring this up to Johannes later today.
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.
I don't see how we could easily avoid that. The trace_id
is created only once for every trace anyway. And even if an always-off sampler is active, we might still need the trace id for an outgoing context.
Also, the spec requires the trace id to be passed to a sampler.
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.
*/ | ||
SamplingResult ShouldSample( | ||
const SpanContext *parent_context, | ||
trace_api::TraceId trace_id, |
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.
I don't see how we could easily avoid that. The trace_id
is created only once for every trace anyway. And even if an always-off sampler is active, we might still need the trace id for an outgoing context.
Also, the spec requires the trace id to be passed to a sampler.
62e5c21
to
61c95a9
Compare
I've made all the requested changes and moved the sampler to |
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.
Looks good and ready to merge (@reyang).
Thanks!
Implements AlwayOffSampler based on the sampler interface in #118.