use the one declared in @opentelemetry/sdk-trace-base instead. This interface represent a sampler. Sampling is a mechanism to control the noise and overhead introduced by OpenTelemetry by reducing the number of samples of traces collected and sent to the backend.

1.0.0

interface Sampler {
    shouldSample(
        context: @opentelemetry/api.Context,
        traceId: string,
        spanName: string,
        spanKind: @opentelemetry/api.SpanKind,
        attributes: @opentelemetry/api.Attributes,
        links: @opentelemetry/api.Link[],
    ): @opentelemetry/api.SamplingResult;
    toString(): string;
}

Methods

  • Returns the sampler name or short description with the configuration.

    Returns string