Skip to content
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

Merged
merged 2 commits into from
Jul 16, 2018

Conversation

jcchavezs
Copy link
Contributor

Closes #68

Ping @basvanbeek

@ghost ghost assigned jcchavezs Jul 10, 2018
@ghost ghost added the review label Jul 10, 2018
@coveralls
Copy link

coveralls commented Jul 10, 2018

Coverage Status

Coverage remained the same at 91.647% when pulling 9ab04bd on exposes_binary_samplers into 3b2a7d2 on master.

Copy link
Member

@basvanbeek basvanbeek left a 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
Copy link
Member

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.
Copy link
Member

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.

@basvanbeek basvanbeek merged commit 8a54c36 into master Jul 16, 2018
@ghost ghost removed the review label Jul 16, 2018
@basvanbeek
Copy link
Member

Thanks @jcchavezs!

@jcchavezs jcchavezs deleted the exposes_binary_samplers branch July 16, 2018 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants