From 78fd979eb2810572a290b2a28702d32080a458e2 Mon Sep 17 00:00:00 2001 From: Bastian Date: Fri, 20 May 2022 08:55:40 +0200 Subject: [PATCH] fix(opencensus): rename to takeParentDecision --- framework/opencensus/sampler.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/opencensus/sampler.go b/framework/opencensus/sampler.go index adb32c8a1..f10c3168a 100644 --- a/framework/opencensus/sampler.go +++ b/framework/opencensus/sampler.go @@ -12,9 +12,9 @@ import ( // // If the whitelist is empty it is treated as allowed, otherwise checked first. // If the blacklist is set it will disable sampling again. -// If takeParentDecision is set we allow the decision to be taken from incoming tracing, +// If ignoreParentDecision is set we allow the decision to be taken from incoming tracing, // otherwise we enforce our decision -func URLPrefixSampler(allowed, blocked []string, allowParentTrace bool) func(*http.Request) trace.StartOptions { +func URLPrefixSampler(allowed, blocked []string, ignoreParentDecision bool) func(*http.Request) trace.StartOptions { return func(request *http.Request) trace.StartOptions { path := request.URL.Path @@ -33,7 +33,7 @@ func URLPrefixSampler(allowed, blocked []string, allowParentTrace bool) func(*ht if !sample { return trace.StartOptions{ Sampler: func(p trace.SamplingParameters) trace.SamplingDecision { - return trace.SamplingDecision{Sample: !allowParentTrace && p.ParentContext.IsSampled()} + return trace.SamplingDecision{Sample: !ignoreParentDecision && p.ParentContext.IsSampled()} }, } } @@ -49,7 +49,7 @@ func URLPrefixSampler(allowed, blocked []string, allowParentTrace bool) func(*ht // we sample, or the parent sampled return trace.StartOptions{ Sampler: func(p trace.SamplingParameters) trace.SamplingDecision { - return trace.SamplingDecision{Sample: (!allowParentTrace && p.ParentContext.IsSampled()) || sample} + return trace.SamplingDecision{Sample: (!ignoreParentDecision && p.ParentContext.IsSampled()) || sample} }, } }