-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Use opencensus's DefaultSampler instead of AlwaysSampler as default #830
Use opencensus's DefaultSampler instead of AlwaysSampler as default #830
Conversation
…efult in HTTPServerTrace and GRPCServerTrace
I'm conflicted about this one. I strongly disagree with AlwaysSample being a bad default as typically the first steps in distributed tracing for people is to see the propagation between and within services work properly, This needs everything to show up where as at a much later stage, moving to production means finding the right configuration (which is different for everyone) and enforcing it on production builds. The amount of time waisted by people new to tracing figuring out what is happening when it is simply because spans are dropped is awful. Unfortunately OpenCensus has set a default probability sampler of 1e4 instead of an AlwaysSample or rate limited sampler. Given the default for OpenCensus it will be the assumption of people having worked with OpenCensus before that we follow the default behavior. I'm tempted to accept this PR but would like a couple of others to chime in. |
I agree that using a low probability for sampling as a default repeats the lessons learned a few years ago with finagle's default low probability. It will certainly cause a support burden and likely a second order one (ex in zipkin channel not here). something more appropriate will feel like amazon's which is 1 per second with an overflow, or lacking that always sampler https://docs.aws.amazon.com/xray/latest/devguide/xray-console-sampling.html |
I think anything different than I am tempted to propose a more human solution which is dropping a log into stdout saying something like "no sampler defined, What about that? |
I think something more than 1 per second is probably good (especially for
the voracious refresh clickers), but agree always is a less confusing
default.
…On Thu, Jan 24, 2019 at 7:07 PM José Carlos Chávez ***@***.***> wrote:
I think anything different than AlwaysSample will lead to confusion to
starters (1 per sec is great but user might be wondering why this is
failing).
I am tempted to propose a more human solution which is dropping a log into
stdout saying something like no sampler defined, AlwaysSample is enabled
but this is not meant to be used in production.
What about that?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#830 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD613VjQq1HxyoEtZLPM19iI0AJoxa-ks5vGZP8gaJpZM4aQUe5>
.
|
I also agree that it might confuse starters if the default sampler is not However I think that setting Users can't apply a global sampler just by doing this: import "go.opencensus.io/trace"
sampler := trace.AlwaysSample() // or trace.ProbabilitySampler(1e-4)
trace.ApplyConfig(trace.Config{
DefaultSampler: sampler,
}) but need to pass a |
Yes I agree. Even though I'm very unhappy with the OpenCensus default sampler choice the current way we force explicit setting of sampler at the Go kit level if needing something else than AlwaysSample is undesirable. Merged... thanks for the PR and conversation @rueian |
The
GRPCServerTrace
andHTTPServerTrace
provided in thetracing/opencensus
package will usetrace.AlwaysSample()
to trace span by default.But I think using
trace.AlwaysSample()
as default is not a good idea, because it might cost a lot of money, especially when sending spans to cloud service providers, for example Stackdriver.This pull request remove the lines that setting
trace.AlwaysSample()
as default value ofcfg.Sampler
, and leave thecfg.Sampler
default to nil.And the
trace.StartSpanWithRemoteParent()
andtrace.StartSpan()
will use their default sampler ifcfg.Sampler
is nil.Users can change their default sampler by
trace.ApplyConfig()
first: