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

SDK default samplers are underspecified #492

Closed
arminru opened this issue Feb 27, 2020 · 0 comments · Fixed by #609
Closed

SDK default samplers are underspecified #492

arminru opened this issue Feb 27, 2020 · 0 comments · Fixed by #609
Labels
area:sampling Related to trace sampling area:sdk Related to the SDK
Milestone

Comments

@arminru
Copy link
Member

arminru commented Feb 27, 2020

The spec lists a few default samplers but only mentions their names without specifying their behavior.

The ALWAYS_ON sampler, for example, does not specify if it only applies to root spans and must otherwise honor (i.e., replicate) the SampledFlag in the parent SpanContext's TraceFlags, or always return true, regardless of that flag.
Same goes with ALWAYS_OFF.

Java's AlwaysOnSampler, for example, always returns true:
https://github.com/open-telemetry/opentelemetry-java/blob/master/sdk/src/main/java/io/opentelemetry/sdk/trace/Samplers.java#L95

JS' ALWAYS_SAMPLER, for example, returns the parent's SampledFlag, if any, and only defaults to true if there is no parent:
https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-core/src/trace/sampler/ProbabilitySampler.ts#L29 (ALWAYS_SAMPLER = new ProbabilitySampler(1))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:sampling Related to trace sampling area:sdk Related to the SDK
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants