Opentelemetry-specification: Revisit Default Sampler and Interaction With TraceFlags

Created on 23 Jul 2020  路  2Comments  路  Source: open-telemetry/opentelemetry-specification

Should the Default Sampler be changed from AlwaysOn to ParentOrElse(AlwaysOn)?

The spec suggests that AlwaysOn is the default - currently this is not truly enforced consistently across languages:
In Go (this might be a bug), the span's parent is always followed unless a different sampler is specified:

https://github.com/open-telemetry/opentelemetry-go/blob/master/sdk/trace/span.go#L394

One thing that I think adds some confusion (at least for me) here is the interaction between the sampler and the Span context's TraceFlags. The spec suggests that TraceFlags should be passed down from parent to child here, but by always sampling by default this may not actually happen in practice.

sampling sdk p2 required-for-ga trace

Most helpful comment

Thanks for separating out this issue. +1 to changing default to ParentOrElse(AlwaysOn), it seems the least surprising. With all nodes using the default, they'll be effectively AlwaysOn but changing the sampling can be done at one node, the frontend, without worrying about incomplete traces.

All 2 comments

Thanks for separating out this issue. +1 to changing default to ParentOrElse(AlwaysOn), it seems the least surprising. With all nodes using the default, they'll be effectively AlwaysOn but changing the sampling can be done at one node, the frontend, without worrying about incomplete traces.

Discussed at the Spec Sig where there was general agreement that this is a good idea (changing the default sampler from AlwaysOn to ParentOrElse(AlwaysOn)). Will push up a PR to change this in the spec.

Was this page helpful?
0 / 5 - 0 ratings