/**
 * Prometheus Metrics Exporter
 *
 * Export metrics in Prometheus format:
 * - HTTP endpoint for scraping
 * - Standard metrics format
 * - Custom metrics support
 * - Histogram and counter types
 */
import { EventEmitter } from 'events';
export interface MetricValue {
    value: number;
    labels?: Record<string, string>;
    timestamp?: number;
}
export interface MetricDefinition {
    name: string;
    help: string;
    type: 'counter' | 'gauge' | 'histogram' | 'summary';
    labelNames?: string[];
}
export interface HistogramBucket {
    le: number;
    count: number;
}
export interface HistogramValue {
    buckets: HistogramBucket[];
    sum: number;
    count: number;
    labels?: Record<string, string>;
}
export interface PrometheusConfig {
    /** HTTP server port */
    port: number;
    /** Metrics endpoint path */
    path: string;
    /** Default labels for all metrics */
    defaultLabels?: Record<string, string>;
    /** Metric prefix */
    prefix: string;
}
/**
 * Prometheus Metrics Exporter
 */
export declare class PrometheusExporter extends EventEmitter {
    private config;
    private server;
    private metrics;
    private values;
    private histograms;
    constructor(config?: Partial<PrometheusConfig>);
    /**
     * Register default metrics
     */
    private registerDefaultMetrics;
    /**
     * Register a metric
     */
    registerMetric(definition: MetricDefinition): void;
    /**
     * Increment a counter
     */
    inc(name: string, value?: number, labels?: Record<string, string>): void;
    /**
     * Set a gauge value
     */
    set(name: string, value: number, labels?: Record<string, string>): void;
    /**
     * Observe a histogram value
     */
    observe(name: string, value: number, labels?: Record<string, string>): void;
    /**
     * Create default histogram buckets
     */
    private createDefaultBuckets;
    /**
     * Find existing value by labels
     */
    private findValue;
    /**
     * Format metrics for Prometheus
     */
    formatMetrics(): string;
    /**
     * Format labels for Prometheus
     */
    private formatLabels;
    /**
     * Escape label value
     */
    private escapeLabel;
    /**
     * Start HTTP server
     */
    start(): Promise<void>;
    /**
     * Handle HTTP request
     */
    private handleRequest;
    /**
     * Stop HTTP server
     */
    stop(): Promise<void>;
    /**
     * Reset all metrics
     */
    reset(): void;
    /**
     * Get current metric value
     */
    getValue(name: string, labels?: Record<string, string>): number | undefined;
    /**
     * Push metrics to Prometheus Pushgateway
     */
    pushToGateway(gatewayUrl: string, jobName: string): Promise<void>;
}
/**
 * Get or create Prometheus exporter
 */
export declare function getPrometheusExporter(config?: Partial<PrometheusConfig>): PrometheusExporter;
/**
 * Create metrics middleware for integration
 */
export declare function createMetricsCollector(exporter: PrometheusExporter): {
    onSessionStart: () => void;
    onSessionEnd: (durationSeconds: number) => void;
    onMessage: (role: string, tokens: number) => void;
    onToolCall: (tool: string, success: boolean, durationSeconds: number) => void;
    onCost: (amount: number) => void;
    onError: (type: string) => void;
    onResponse: (durationSeconds: number) => void;
    onContextUpdate: (tokens: number) => void;
    onFileRead: () => void;
    onFileWrite: () => void;
    onLinesChanged: (added: number, removed: number) => void;
};
export default PrometheusExporter;
