%Trace.ParentBasedSampler
class %Trace.ParentBasedSampler extends %Trace.AbstractSampler
Returns a decision based on the Span Parent (parent sampled flag and local vs. remote).ParentBasedSampler distinguishes between the following cases:
Based on the case, ParentBasedSampler will then call other delegated Samplers, as defined by the %OnNew() Parameters, to create the SamplingResult. The Parameters should be the ClassName of the Sampler, or the short ClassName if using one of the %Trace Samplers (e.g. 'AlwaysOnSampler' or 'TraceIdRatioBasedSampler').
Property Inventory
Method Inventory
Properties
property localParentNotSampled as AbstractSampler;
Sampler for Parent Remote = 0 and Sampled = 0
Property methods: localParentNotSampledGet(), localParentNotSampledGetSwizzled(), localParentNotSampledIsValid(), localParentNotSampledNewObject(), localParentNotSampledSet()
property localParentSampled as AbstractSampler;
Sampler for Parent Remote = 0 and Sampled = 1
Property methods: localParentSampledGet(), localParentSampledGetSwizzled(), localParentSampledIsValid(), localParentSampledNewObject(), localParentSampledSet()
property remoteParentNotSampled as AbstractSampler;
Sampler for Parent Remote = 1 and Sampled = 0
Property methods: remoteParentNotSampledGet(), remoteParentNotSampledGetSwizzled(), remoteParentNotSampledIsValid(), remoteParentNotSampledNewObject(), remoteParentNotSampledSet()
property remoteParentSampled as AbstractSampler;
Sampler for Parent Remote = 1 and Sampled = 1
Property methods: remoteParentSampledGet(), remoteParentSampledGetSwizzled(), remoteParentSampledIsValid(), remoteParentSampledNewObject(), remoteParentSampledSet()
property root as AbstractSampler;
Sampler for root Spans (no Parent)
Property methods: rootGet(), rootGetSwizzled(), rootIsValid(), rootNewObject(), rootSet()
Methods
Parameters is a $List of ClassNames (or short ClassNames if using %Trace)
of Samplers and their Parameters, to be called by the ParentBasedSampler.
The Parameters for the Sampler Class are specified using an embedded $List.
The format is:
$List(Sampler1,$List(Param1),Sampler2,$List(Param2))
There are five possible delegated Samplers, but only the first ('root') is Required.
In order in the $List, these Samplers are:
$List(Sampler1,$List(Param1),Sampler2,$List(Param2))
set Parameters = $lb("TraceIdRatioBasedSampler",$lb(".001"),"AlwaysOnSampler","","AlwaysOffSampler","")
- root - Sampler called for spans with no parent (root spans)
- remoteParentSampled (default: AlwaysOnSampler)
- remoteParentNotSampler (default: AlwaysOffSampler)
- localParentSampled (default: AlwaysOnSampler)
- localParentNotSampled (default: AlwaysOffSampler)
method GetDescription() as %String
Returns the sampler name or short description.
This may be displayed on debug pages or in 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
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()