import type { Attributes, Context, Link, SpanKind } from '@opentelemetry/api'; import { type Sampler, type SamplingResult } from '@opentelemetry/sdk-trace-base'; export interface SessionBasedSamplerConfig { /** * Ratio of sessions that get sampled (0.0 - 1.0, where 1 is all sessions) */ ratio?: number; /** * Sampler called when session is being sampled * default: AlwaysOnSampler */ sampled?: Sampler; /** * Sampler called when session isn't being sampled * default: AlwaysOffSampler */ notSampled?: Sampler; } export declare class SessionBasedSampler implements Sampler { protected _ratio: number; protected _upperBound: number; protected _sampled: Sampler; protected _notSampled: Sampler; protected _currentSession: string | undefined; protected _currentSessionSampled: boolean | undefined; constructor({ ratio, sampled, notSampled, }?: SessionBasedSamplerConfig); shouldSample(context: Context, traceId: string, spanName: string, spanKind: SpanKind, attributes: Attributes, links: Link[]): SamplingResult; toString(): string; private _normalize; private _accumulate; }