You've already forked opentelemetry-go
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:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user