ParentBasedSampler fix checking if root or not (#1237)
* AspNet Instrumentation docs
* Revert "AspNet Instrumentation docs"
This reverts commit 4cbb620533.
* Modify ParentBasedSampler to determine if root based on parentcontext being default
* traceid
This commit is contained in:
parent
4993ec61ed
commit
cb0c161a89
|
|
@ -41,8 +41,7 @@ namespace OpenTelemetry.Trace
|
||||||
public override SamplingResult ShouldSample(in SamplingParameters samplingParameters)
|
public override SamplingResult ShouldSample(in SamplingParameters samplingParameters)
|
||||||
{
|
{
|
||||||
var parentContext = samplingParameters.ParentContext;
|
var parentContext = samplingParameters.ParentContext;
|
||||||
if (/* TODO: TraceId is always provided due to AutoGenerateRootContextTraceId. That is being removed in RC1 and this can be put back.
|
if (parentContext.TraceId == default)
|
||||||
parentContext.TraceId == default ||*/ parentContext.SpanId == default)
|
|
||||||
{
|
{
|
||||||
// If no parent, use the delegate to determine sampling.
|
// If no parent, use the delegate to determine sampling.
|
||||||
return this.delegateSampler.ShouldSample(samplingParameters);
|
return this.delegateSampler.ShouldSample(samplingParameters);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue