NVIDIA DeepStream SDK API Reference

9.2 Release
sdk::trace::TraceIdRatioBasedSampler Class Reference

Detailed Description

The TraceIdRatioBased sampler computes and returns a decision based on the provided trace_id and the configured ratio.

Definition at line 24 of file includes/opentelemetry/sdk/trace/samplers/trace_id_ratio.h.

Inheritance diagram for sdk::trace::TraceIdRatioBasedSampler:
Collaboration diagram for sdk::trace::TraceIdRatioBasedSampler:

Public Member Functions

 TraceIdRatioBasedSampler (double ratio)
 
SamplingResult ShouldSample (const opentelemetry::trace::SpanContext &, opentelemetry::trace::TraceId trace_id, nostd::string_view, opentelemetry::trace::SpanKind, const opentelemetry::common::KeyValueIterable &, const opentelemetry::trace::SpanContextKeyValueIterable &) noexcept override
 
nostd::string_view GetDescription () const noexcept override
 
 TraceIdRatioBasedSampler (double ratio)
 
SamplingResult ShouldSample (const opentelemetry::trace::SpanContext &, opentelemetry::trace::TraceId trace_id, nostd::string_view, opentelemetry::trace::SpanKind, const opentelemetry::common::KeyValueIterable &, const opentelemetry::trace::SpanContextKeyValueIterable &) noexcept override
 
nostd::string_view GetDescription () const noexcept override
 

Constructor & Destructor Documentation

◆ TraceIdRatioBasedSampler() [1/2]

sdk::trace::TraceIdRatioBasedSampler::TraceIdRatioBasedSampler ( double  ratio)
explicit
Parameters
ratioa required value, 1.0 >= ratio >= 0.0. If the given trace_id falls into a given ratio of all possible trace_id values, ShouldSample will return RECORD_AND_SAMPLE.
Exceptions
invalid_argumentif ratio is out of bounds [0.0, 1.0]

◆ TraceIdRatioBasedSampler() [2/2]

sdk::trace::TraceIdRatioBasedSampler::TraceIdRatioBasedSampler ( double  ratio)
explicit
Parameters
ratioa required value, 1.0 >= ratio >= 0.0. If the given trace_id falls into a given ratio of all possible trace_id values, ShouldSample will return RECORD_AND_SAMPLE.
Exceptions
invalid_argumentif ratio is out of bounds [0.0, 1.0]

Member Function Documentation

◆ GetDescription() [1/2]

nostd::string_view sdk::trace::TraceIdRatioBasedSampler::GetDescription ( ) const
overridevirtualnoexcept
Returns
Description MUST be TraceIdRatioBasedSampler{0.000100}

Implements sdk::trace::Sampler.

◆ GetDescription() [2/2]

nostd::string_view sdk::trace::TraceIdRatioBasedSampler::GetDescription ( ) const
overridevirtualnoexcept
Returns
Description MUST be TraceIdRatioBasedSampler{0.000100}

Implements sdk::trace::Sampler.

◆ ShouldSample() [1/2]

SamplingResult sdk::trace::TraceIdRatioBasedSampler::ShouldSample ( const opentelemetry::trace::SpanContext &  ,
opentelemetry::trace::TraceId  trace_id,
nostd::string_view  ,
opentelemetry::trace::SpanKind  ,
const opentelemetry::common::KeyValueIterable &  ,
const opentelemetry::trace::SpanContextKeyValueIterable &   
)
overridevirtualnoexcept
Returns
Returns either RECORD_AND_SAMPLE or DROP based on current sampler configuration and provided trace_id and ratio. trace_id is used as a pseudorandom value in conjunction with the predefined ratio to determine whether this trace should be sampled

Implements sdk::trace::Sampler.

◆ ShouldSample() [2/2]

SamplingResult sdk::trace::TraceIdRatioBasedSampler::ShouldSample ( const opentelemetry::trace::SpanContext &  ,
opentelemetry::trace::TraceId  trace_id,
nostd::string_view  ,
opentelemetry::trace::SpanKind  ,
const opentelemetry::common::KeyValueIterable &  ,
const opentelemetry::trace::SpanContextKeyValueIterable &   
)
overridevirtualnoexcept
Returns
Returns either RECORD_AND_SAMPLE or DROP based on current sampler configuration and provided trace_id and ratio. trace_id is used as a pseudorandom value in conjunction with the predefined ratio to determine whether this trace should be sampled

Implements sdk::trace::Sampler.


The documentation for this class was generated from the following file: