A sampling result contains a decision for a Span and additional attributes the sampler would like to added to the Span.

interface SamplingResult {
    attributes?: Readonly<@opentelemetry/api.Attributes>;
    decision: node.SamplingDecision;
    traceState?: @opentelemetry/api.TraceState;
}

Properties

attributes?: Readonly<@opentelemetry/api.Attributes>

The list of attributes returned by SamplingResult MUST be immutable. Caller may call Sampler.shouldSample any number of times and can safely cache the returned value.

A sampling decision, refer to SamplingDecision for details.

A TraceState that will be associated with the Span through the new SpanContext. Samplers SHOULD return the TraceState from the passed-in Context if they do not intend to change it. Leaving the value undefined will also leave the TraceState unchanged.

MMNEPVFCICPMFPCPTTAAATR