export type MetricType = "counter" | "gauge" | "histogram" | "summary"; export type Metric = { name: string; type: MetricType; value: number; labels?: Record; timestamp: Date; description?: string; }; export type AlertRule = { id: string; name: string; condition: string; threshold: number; severity: "low" | "medium" | "high" | "critical"; enabled: boolean; cooldownMinutes: number; lastTriggered?: Date; }; export type Alert = { id: string; ruleId: string; message: string; severity: "low" | "medium" | "high" | "critical"; timestamp: Date; labels?: Record; resolved?: boolean; resolvedAt?: Date; }; export type HealthStatus = { service: string; status: "healthy" | "degraded" | "unhealthy"; message?: string; checks: HealthCheck[]; timestamp: Date; }; export type HealthCheck = { name: string; status: "pass" | "fail" | "warn"; message?: string; durationMs: number; timestamp: Date; }; export type MetricsSink = { record(metric: Metric): Promise; query(name: string, labels?: Record, start?: Date, end?: Date): Promise; }; export type AlertSink = { createAlert(alert: Omit): Promise; resolveAlert(alertId: string): Promise; getActiveAlerts(): Promise; }; export declare class InMemoryMetricsSink implements MetricsSink { private metrics; private readonly maxMetrics; constructor(maxMetrics?: number); record(metric: Metric): Promise; query(name: string, labels?: Record, start?: Date, end?: Date): Promise; } export declare class ConsoleAlertSink implements AlertSink { createAlert(alert: Omit): Promise; resolveAlert(alertId: string): Promise; getActiveAlerts(): Promise; } export declare class MetricsCollector { private readonly sink; constructor(sink: MetricsSink); recordCounter(name: string, value?: number, labels?: Record): Promise; recordGauge(name: string, value: number, labels?: Record): Promise; recordHistogram(name: string, value: number, labels?: Record): Promise; recordTiming(name: string, durationMs: number, labels?: Record): Promise; queryMetrics(name: string, labels?: Record, hours?: number): Promise; } export declare class AlertManager { private readonly alertSink; private readonly rules; private readonly activeAlerts; constructor(alertSink: AlertSink); addRule(rule: AlertRule): void; removeRule(ruleId: string): void; evaluateRules(metrics: MetricsCollector): Promise; private evaluateCondition; resolveAlert(alertId: string): Promise; getActiveAlerts(): Alert[]; getRules(): AlertRule[]; } export declare class HealthMonitor { private readonly checks; addCheck(name: string, checkFn: () => Promise): void; runHealthChecks(): Promise; getHealthStatus(): Promise; } export declare class ObservabilityManager { private readonly metrics; private readonly alerts; private readonly health; constructor(metricsSink?: MetricsSink, alertSink?: AlertSink); private initializeDefaultChecks; private initializeDefaultAlertRules; recordOperation(operation: string, success: boolean, durationMs: number, labels?: Record): Promise; recordGauge(name: string, value: number, labels?: Record): Promise; addAlertRule(rule: AlertRule): void; evaluateAlerts(): Promise; getActiveAlerts(): Alert[]; addHealthCheck(name: string, checkFn: () => Promise): void; getHealthStatus(): Promise; queryMetrics(name: string, labels?: Record, hours?: number): Promise; getMetricsCollector(): MetricsCollector; getAlertManager(): AlertManager; getHealthMonitor(): HealthMonitor; } //# sourceMappingURL=monitoring.d.ts.map