/**
 * Circuit Breaker Monitoring and Metrics System
 *
 * Provides comprehensive monitoring, metrics collection, and alerting
 * for circuit breaker instances with Prometheus export support.
 */
import { EventEmitter } from 'events';
import { ICircuitBreaker } from './types.js';
import { CircuitBreakerMetrics, AlertCondition, DashboardData } from './monitoring-types.js';
export { MetricType } from './monitoring-types.js';
export type { MetricPoint, TimeSeries, CircuitBreakerMetrics, AlertCondition, Alert, DashboardData, MonitoringEvents, MonitorConfig, PrometheusConfig, } from './monitoring-types.js';
/**
 * Circuit Breaker Monitor implementation
 */
export declare class CircuitBreakerMonitor extends EventEmitter {
    private readonly circuits;
    private readonly metricsRetention;
    private readonly metricsInterval;
    private cleanupTimer?;
    private readonly alertConditions;
    private readonly activeAlerts;
    private readonly alertCooldowns;
    private readonly cacheMetrics;
    constructor(options?: {
        metricsRetention?: number;
        metricsInterval?: number;
    });
    /**
     * Register a circuit breaker for monitoring
     */
    register(name: string, circuitBreaker: ICircuitBreaker): void;
    /**
     * Unregister a circuit breaker from monitoring
     */
    unregister(name: string): void;
    /**
     * Add alert condition for a circuit
     */
    addAlertCondition(circuitName: string, condition: AlertCondition): void;
    /**
     * Get metrics for a specific circuit
     */
    getMetrics(circuitName: string): CircuitBreakerMetrics | undefined;
    /**
     * Get all metrics
     */
    getAllMetrics(): Map<string, CircuitBreakerMetrics>;
    /**
     * Export metrics in Prometheus format
     */
    exportPrometheus(): string;
    /**
     * Get dashboard data for real-time monitoring
     */
    getDashboard(): DashboardData;
    /**
     * Get real-time stream of metrics
     */
    streamMetrics(interval?: number): AsyncGenerator<DashboardData>;
    /**
     * Record cache hit
     */
    recordCacheHit(circuitName: string): void;
    /**
     * Record cache miss
     */
    recordCacheMiss(circuitName: string): void;
    /**
     * Destroy the monitor and clean up resources
     */
    destroy(): void;
    private createInitialMetrics;
    private createTimeSeries;
    private recordStateChange;
    private recordSuccess;
    private recordFailure;
    private recordTimeout;
    private recordRejection;
    private incrementCounter;
    private addMetricPoint;
    private getLatestValue;
    private updateRates;
    private updateLatencyPercentiles;
    private percentile;
    private checkAlerts;
    private getMetricValue;
    private evaluateCondition;
    private triggerAlert;
    private getAlertSeverity;
    private calculateHealth;
    private startCleanupTimer;
    private cleanupTimeSeries;
}
/**
 * Create a new circuit breaker monitor instance
 */
export declare function createCircuitBreakerMonitor(options?: {
    metricsRetention?: number;
    metricsInterval?: number;
}): CircuitBreakerMonitor;
/**
 * Express/HTTP endpoint for Prometheus metrics
 */
export declare function createMetricsEndpoint(monitor: CircuitBreakerMonitor): (req: any, res: any) => void;
/**
 * WebSocket handler for real-time dashboard
 */
export declare function createDashboardWebSocket(monitor: CircuitBreakerMonitor): (ws: any) => Promise<void>;
//# sourceMappingURL=monitoring.d.ts.map