/** * Prometheus Metrics Module * * Exposes metrics for monitoring: * - Request counters (total, by tool, by status) * - Cache hit/miss counters * - Request duration histograms * - Circuit breaker state gauge * - Rate limiter gauge * - Cache size gauge */ import { Counter, Histogram, Gauge, Registry } from "prom-client"; export declare const registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; /** * Total number of API requests */ export declare const requestsTotal: Counter<"tool" | "status" | "error_category">; /** * Cache hit counter */ export declare const cacheHitsTotal: Counter<"method">; /** * Cache miss counter */ export declare const cacheMissesTotal: Counter<"method">; /** * Rate limit hits counter */ export declare const rateLimitHitsTotal: Counter<"type">; /** * Circuit breaker trips counter */ export declare const circuitBreakerTripsTotal: Counter; /** * Retry counter */ export declare const retriesTotal: Counter<"tool" | "reason">; /** * Request duration histogram */ export declare const requestDuration: Histogram<"tool" | "status">; /** * Circuit breaker state * 0 = closed (normal) * 1 = half-open (testing) * 2 = open (blocking) */ export declare const circuitBreakerState: Gauge; /** * Rate limiter requests in current window */ export declare const rateLimiterRequests: Gauge; /** * Cache size gauge */ export declare const cacheSize: Gauge; /** * Active chats tracked by per-chat rate limiter */ export declare const activeChatsTracked: Gauge; /** * Convert circuit breaker state string to numeric value */ export declare function circuitBreakerStateToNumber(state: "closed" | "open" | "half-open"): number; /** * Record a request with all relevant metrics */ export declare function recordRequest(params: { tool: string; status: "success" | "error"; errorCategory?: string; durationMs: number; }): void; /** * Get all metrics in Prometheus format */ export declare function getMetrics(): Promise; /** * Get metrics content type */ export declare function getMetricsContentType(): string; //# sourceMappingURL=index.d.ts.map