Skip to main content

%Trace.TraceIdRatioBasedSampler

class %Trace.TraceIdRatioBasedSampler extends %Trace.AbstractSampler

Returns either DROP or RECORD_AND_SAMPLE based on a Ratio parameter.

Property Inventory

Method Inventory

Properties

property Ratio as %Numeric;
Property methods: RatioDisplayToLogical(), RatioGet(), RatioIsValid(), RatioLogicalToDisplay(), RatioNormalize(), RatioSet()

Methods

method %OnNew(Parameters As %List) as %Status
Parameters is a $List with a single element, which is the Ratio (as a decimal number) to be used by the Sampler.
method GetDescription() as %String
Returns the sampler name or short description with the configuration. This may be displayed on debug pages or in the logs. Example: 'TraceIdRatioBased{0.000100}'
method ShouldSample(Context As %Trace.SpanContext, TraceId As %String, Name As %String, SpanKind As %String, ByRef Attributes As %String) as %Trace.SamplingResult
Returns the sampling Decision for a Span to be created and recorded. 'Attributes' should be passed by reference as an array, e.g. Attribute("key")="value".

Inherited Members

Inherited Methods

FeedbackOpens in a new tab