-
Notifications
You must be signed in to change notification settings - Fork 116
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
[#68] Exposes alwaysSample and NeverSample to easier usage. #70
Conversation
eec0de0
to
7d6e269
Compare
7d6e269
to
b9504cf
Compare
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.
Just some remarks on the comments for the now exported Samplers. For the rest LGTM.
sample.go
Outdated
@@ -12,14 +12,17 @@ import ( | |||
// traceID. | |||
type Sampler func(id uint64) bool | |||
|
|||
func neverSample(_ uint64) bool { return false } | |||
// NeverSample samples no traces |
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.
NeverSample will always return false. If used by a service it will not allow the service to start traces but will still allow the service to participate in traces started upstream.
sample.go
Outdated
|
||
func alwaysSample(_ uint64) bool { return true } | ||
// AlwaysSample samples all traces, it is appropriate for easy prototyping but not | ||
// meant to be used in production. |
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.
AlwaysSample will always return true. If used by a service it will always start traces if no upstream trace has been propagated. If an incoming upstream trace is not sampled the service will adhere to this and only propagate the context.
Thanks @jcchavezs! |
Closes #68
Ping @basvanbeek