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:
Cijo Thomas 2020-09-04 12:14:13 -07:00 committed by GitHub
parent 4993ec61ed
commit cb0c161a89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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);