/**
 * OpenTelemetry Tracer Configuration
 *
 * Core tracer setup with SDK initialization, exporter configuration,
 * and sampling strategies for the Vorion security platform.
 *
 * Features:
 * - OTLP exporter for Jaeger, Tempo, and other backends
 * - Configurable sampling strategies (always, probability, rate-limiting)
 * - Resource attributes for service identification
 * - Environment-aware configuration
 *
 * @packageDocumentation
 */
import { type Sampler, type SamplingResult } from '@opentelemetry/sdk-trace-base';
import { SpanKind, type Tracer, type TracerProvider, type Context, type Link, type Attributes } from '@opentelemetry/api';
/**
 * Sampling strategy types
 */
export type SamplingStrategy = 'always' | 'never' | 'probability' | 'rate-limiting' | 'parent-based';
/**
 * Telemetry configuration options
 */
export interface TelemetryConfig {
    /** Service name for trace identification */
    serviceName: string;
    /** Service version */
    serviceVersion: string;
    /** Deployment environment (development, staging, production) */
    environment: string;
    /** OTLP endpoint URL */
    otlpEndpoint: string;
    /** OTLP headers for authentication */
    otlpHeaders?: Record<string, string>;
    /** Sampling strategy */
    samplingStrategy: SamplingStrategy;
    /** Sampling rate (0.0 - 1.0) for probability sampling */
    samplingRate: number;
    /** Rate limit (requests per second) for rate-limiting sampling */
    rateLimitPerSecond?: number;
    /** Enable console exporter for debugging */
    enableConsoleExporter?: boolean;
    /** Use batch processor (recommended for production) */
    useBatchProcessor?: boolean;
    /** Batch processor configuration */
    batchConfig?: {
        /** Maximum batch size */
        maxExportBatchSize?: number;
        /** Maximum queue size */
        maxQueueSize?: number;
        /** Scheduled delay in milliseconds */
        scheduledDelayMillis?: number;
        /** Export timeout in milliseconds */
        exportTimeoutMillis?: number;
    };
    /** Additional resource attributes */
    resourceAttributes?: Record<string, string | number | boolean>;
    /** Enable telemetry */
    enabled?: boolean;
}
/**
 * Rate-limiting sampler implementation
 *
 * Limits the number of sampled traces per second to prevent
 * overwhelming the trace backend during high-traffic periods.
 */
export declare class RateLimitingSampler implements Sampler {
    private readonly maxTracesPerSecond;
    private tracesThisSecond;
    private currentSecond;
    constructor(maxTracesPerSecond: number);
    shouldSample(_context: Context, _traceId: string, _spanName: string, _spanKind: SpanKind, _attributes: Attributes, _links: Link[]): SamplingResult;
    toString(): string;
}
/**
 * Security-aware sampler that always samples high-risk operations
 *
 * Ensures security-critical operations are always traced regardless
 * of the base sampling strategy.
 */
export declare class SecurityAwareSampler implements Sampler {
    private readonly baseSampler;
    private readonly alwaysSampleOperations;
    constructor(baseSampler: Sampler, alwaysSampleOperations?: string[]);
    shouldSample(context: Context, traceId: string, spanName: string, spanKind: SpanKind, attributes: Attributes, links: Link[]): SamplingResult;
    toString(): string;
}
/**
 * Get default telemetry configuration from environment
 */
export declare function getDefaultTelemetryConfig(): TelemetryConfig;
/**
 * Initialize the OpenTelemetry SDK
 *
 * @param config - Telemetry configuration (optional, uses defaults)
 * @returns void
 * @throws Error if already initialized
 */
export declare function initializeTracer(config?: Partial<TelemetryConfig>): void;
/**
 * Shutdown the OpenTelemetry SDK gracefully
 *
 * Should be called during application shutdown to ensure
 * all pending spans are exported.
 */
export declare function shutdownTracer(): Promise<void>;
/**
 * Get a tracer instance for a specific component
 *
 * @param name - Component name (e.g., 'vorion.intent', 'vorion.policy')
 * @param version - Component version (optional)
 * @returns Tracer instance
 */
export declare function getTracer(name: string, version?: string): Tracer;
/**
 * Get the global tracer provider
 */
export declare function getTracerProvider(): TracerProvider;
/**
 * Check if the tracer is initialized
 */
export declare function isTracerInitialized(): boolean;
/**
 * Vorion-specific tracer names
 */
export declare const VorionTracers: {
    readonly INTENT: "vorion.intent";
    readonly POLICY: "vorion.policy";
    readonly TRUST: "vorion.trust";
    readonly SECURITY: "vorion.security";
    readonly API: "vorion.api";
    readonly QUEUE: "vorion.queue";
    readonly DATABASE: "vorion.database";
    readonly CACHE: "vorion.cache";
    readonly WEBHOOK: "vorion.webhook";
    readonly AUDIT: "vorion.audit";
    readonly GOVERNANCE: "vorion.governance";
};
/**
 * Get the intent tracer
 */
export declare function getIntentTracer(): Tracer;
/**
 * Get the policy tracer
 */
export declare function getPolicyTracer(): Tracer;
/**
 * Get the security tracer
 */
export declare function getSecurityTracer(): Tracer;
/**
 * Get the API tracer
 */
export declare function getApiTracer(): Tracer;
//# sourceMappingURL=tracer.d.ts.map