Skip to main content

%Trace.AbstractSampler

class %Trace.AbstractSampler extends %Library.RegisteredObject

Base Class for all Trace Samplers.

Method Inventory

Methods

method %OnNew(Parameters As %List) as %Status
Any parameters required for the Sampler must be passed here as a $List. If the Sampler is specified as part of the %Trace.Provider singleton, these parameters will get stored with that and used to instantiate the Sampler object.
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

Subclasses

FeedbackOpens in a new tab