UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio

105 lines (104 loc) 3.12 kB
/** * Sampling Strategies * Control which spans are exported for production optimization */ import type { SamplerConfig, SamplingRule, SpanData, Sampler } from "../../types/index.js"; /** * Always sample all spans */ export declare class AlwaysSampler implements Sampler { readonly name = "always"; shouldSample(_span: SpanData): boolean; getDescription(): string; } /** * Never sample any spans */ export declare class NeverSampler implements Sampler { readonly name = "never"; shouldSample(_span: SpanData): boolean; getDescription(): string; } /** * Sample spans based on a probability ratio */ export declare class RatioSampler implements Sampler { readonly name = "ratio"; private readonly ratio; constructor(ratio: number); shouldSample(_span: SpanData): boolean; getDescription(): string; } /** * Sample based on trace ID for consistent sampling across a trace */ export declare class TraceIdRatioSampler implements Sampler { readonly name = "trace-id-ratio"; private readonly ratio; private readonly upperBound; constructor(ratio: number); shouldSample(span: SpanData): boolean; getDescription(): string; } /** * Sample based on span attributes (e.g., errors, specific providers) */ export declare class AttributeBasedSampler implements Sampler { readonly name = "attribute-based"; private readonly rules; private readonly defaultSampler; constructor(rules: SamplingRule[], defaultSampler?: Sampler); shouldSample(span: SpanData): boolean; private matchesRule; getDescription(): string; } /** * Priority-based sampler - always sample high-priority spans */ export declare class PrioritySampler implements Sampler { readonly name = "priority"; private readonly highPriorityTypes; private readonly fallbackSampler; constructor(highPriorityTypes?: string[], fallbackSampler?: Sampler); shouldSample(span: SpanData): boolean; getDescription(): string; } /** * Error-only sampler - only sample error spans */ export declare class ErrorOnlySampler implements Sampler { readonly name = "error-only"; shouldSample(span: SpanData): boolean; getDescription(): string; } /** * Composite sampler that combines multiple samplers */ export declare class CompositeSampler implements Sampler { readonly name = "composite"; private readonly samplers; private readonly totalWeight; constructor(samplers: Array<{ sampler: Sampler; weight: number; }>); shouldSample(span: SpanData): boolean; getDescription(): string; } /** * Custom sampler that uses a user-provided function */ export declare class CustomSampler implements Sampler { readonly name = "custom"; private readonly sampleFn; private readonly description; constructor(sampleFn: (span: SpanData) => boolean, description?: string); shouldSample(span: SpanData): boolean; getDescription(): string; } /** * Factory for creating samplers from configuration */ export declare class SamplerFactory { static create(config: SamplerConfig): Sampler; }