kubernetes/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go

type Sampler

type SamplingParameters

type SamplingDecision

const Drop

const RecordOnly

const RecordAndSample

type SamplingResult

type traceIDRatioSampler

func (ts traceIDRatioSampler) ShouldSample(p SamplingParameters) SamplingResult {}

func (ts traceIDRatioSampler) Description() string {}

// TraceIDRatioBased samples a given fraction of traces. Fractions >= 1 will
// always sample. Fractions < 0 are treated as zero. To respect the
// parent trace's `SampledFlag`, the `TraceIDRatioBased` sampler should be used
// as a delegate of a `Parent` sampler.
//
//nolint:revive // revive complains about stutter of `trace.TraceIDRatioBased`
func TraceIDRatioBased(fraction float64) Sampler {}

type alwaysOnSampler

func (as alwaysOnSampler) ShouldSample(p SamplingParameters) SamplingResult {}

func (as alwaysOnSampler) Description() string {}

// AlwaysSample returns a Sampler that samples every trace.
// Be careful about using this sampler in a production application with
// significant traffic: a new trace will be started and exported for every
// request.
func AlwaysSample() Sampler {}

type alwaysOffSampler

func (as alwaysOffSampler) ShouldSample(p SamplingParameters) SamplingResult {}

func (as alwaysOffSampler) Description() string {}

// NeverSample returns a Sampler that samples no traces.
func NeverSample() Sampler {}

// ParentBased returns a sampler decorator which behaves differently,
// based on the parent of the span. If the span has no parent,
// the decorated sampler is used to make sampling decision. If the span has
// a parent, depending on whether the parent is remote and whether it
// is sampled, one of the following samplers will apply:
//   - remoteParentSampled(Sampler) (default: AlwaysOn)
//   - remoteParentNotSampled(Sampler) (default: AlwaysOff)
//   - localParentSampled(Sampler) (default: AlwaysOn)
//   - localParentNotSampled(Sampler) (default: AlwaysOff)
func ParentBased(root Sampler, samplers ...ParentBasedSamplerOption) Sampler {}

type parentBased

func configureSamplersForParentBased(samplers []ParentBasedSamplerOption) samplerConfig {}

type samplerConfig

type ParentBasedSamplerOption

// WithRemoteParentSampled sets the sampler for the case of sampled remote parent.
func WithRemoteParentSampled(s Sampler) ParentBasedSamplerOption {}

type remoteParentSampledOption

func (o remoteParentSampledOption) apply(config samplerConfig) samplerConfig {}

// WithRemoteParentNotSampled sets the sampler for the case of remote parent
// which is not sampled.
func WithRemoteParentNotSampled(s Sampler) ParentBasedSamplerOption {}

type remoteParentNotSampledOption

func (o remoteParentNotSampledOption) apply(config samplerConfig) samplerConfig {}

// WithLocalParentSampled sets the sampler for the case of sampled local parent.
func WithLocalParentSampled(s Sampler) ParentBasedSamplerOption {}

type localParentSampledOption

func (o localParentSampledOption) apply(config samplerConfig) samplerConfig {}

// WithLocalParentNotSampled sets the sampler for the case of local parent
// which is not sampled.
func WithLocalParentNotSampled(s Sampler) ParentBasedSamplerOption {}

type localParentNotSampledOption

func (o localParentNotSampledOption) apply(config samplerConfig) samplerConfig {}

func (pb parentBased) ShouldSample(p SamplingParameters) SamplingResult {}

func (pb parentBased) Description() string {}