Class ParentBasedSampler
Defined in File parent.h
Inheritance Relationships
Base Type
public opentelemetry::sdk::trace::Sampler
(Class Sampler)
Class Documentation
-
class opentelemetry::sdk::trace::ParentBasedSampler : public opentelemetry::sdk::trace::Sampler
The ParentBased sampler is a composite sampler. ParentBased(delegateSampler) either respects the parent span’s sampling decision or delegates to delegateSampler for root spans.
Public Functions
-
virtual SamplingResult ShouldSample(const trace_api::SpanContext &parent_context, trace_api::TraceId trace_id, nostd::string_view name, trace_api::SpanKind span_kind, const opentelemetry::common::KeyValueIterable &attributes, const trace_api::SpanContextKeyValueIterable &links) noexcept override
The decision either respects the parent span’s sampling decision or delegates to delegateSampler for root spans
- Returns
Returns DROP always
-
virtual nostd::string_view GetDescription() const noexcept override
- Returns
Description MUST be ParentBased{delegate_sampler_.getDescription()}
-
virtual SamplingResult ShouldSample(const trace_api::SpanContext &parent_context, trace_api::TraceId trace_id, nostd::string_view name, trace_api::SpanKind span_kind, const opentelemetry::common::KeyValueIterable &attributes, const trace_api::SpanContextKeyValueIterable &links) noexcept override