1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-06-14 23:45:20 +02:00

Add AlwaysParentSample sampler (#455)

* Add AlwaysParentSample

* Update sampler doc

Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>

* Address PR comments

Co-authored-by: Krzesimir Nowak <qdlacz@gmail.com>
Co-authored-by: Rahul Patel <rghetia@yahoo.com>
This commit is contained in:
Amr Hanafi
2020-02-03 10:22:52 -08:00
committed by GitHub
parent 32489ddae9
commit 6051c81493
2 changed files with 57 additions and 0 deletions

View File

@ -77,3 +77,11 @@ func NeverSample() Sampler {
return SamplingDecision{Sample: false}
}
}
// AlwaysParentSample returns a Sampler that samples a trace only
// if the parent span is sampled.
// This Sampler is a passthrough to the ProbabilitySampler with
// a fraction of value 0.
func AlwaysParentSample() Sampler {
return ProbabilitySampler(0)
}