import type { LogEntry, LogDestinationConfig, LogBatchResult, LogDestinationStats } from './types.js'; /** * Enterprise-grade log destination for Elasticsearch * * Features: * - Batched bulk indexing with configurable batch size * - Automatic flushing at intervals * - Log enrichment pipeline * - Sampling strategies (all, errors-only, percentage, rate-limit) * - ILM (Index Lifecycle Management) integration * - Metric extraction from logs * - Auto index template creation * - Queue overflow protection * - Full observability integration * * @example * ```typescript * const logDest = new LogDestination({ * indexPattern: 'logs-myapp-{now/d}', * batchSize: 100, * flushIntervalMs: 5000, * sampling: { * strategy: 'percentage', * percentage: 10, * alwaysSampleErrors: true * }, * enrichers: [addHostInfo, addEnvironment], * ilm: { * name: 'logs-policy', * hotDuration: '7d', * deleteDuration: '30d' * } * }); * * await logDest.initialize(); * await logDest.send({ * timestamp: new Date().toISOString(), * level: 'INFO', * message: 'User logged in', * metadata: { userId: '123' } * }); * ``` */ export declare class LogDestination { private config; private queue; private flushTimer?; private stats; private batchDurations; private lastRateLimitReset; private rateLimitCounter; private initialized; constructor(config: LogDestinationConfig); /** * Create a new log destination */ static create(config: LogDestinationConfig): LogDestination; /** * Initialize the log destination (create template, ILM policy) */ initialize(): Promise; /** * Send a log entry */ send(entry: LogEntry): Promise; /** * Send multiple log entries */ sendBatch(entries: LogEntry[]): Promise; /** * Flush pending logs immediately */ flush(): Promise; /** * Get destination statistics */ getStats(): LogDestinationStats; /** * Destroy the destination (flush pending logs and stop timer) */ destroy(): Promise; private startFlushTimer; private shouldSample; private resolveIndexName; private extractMetrics; private getNestedValue; private createILMPolicy; private createIndexTemplate; } /** * Create a new log destination */ export declare function createLogDestination(config: LogDestinationConfig): LogDestination;