/**
 * API Metrics Middleware
 *
 * Fastify plugin for collecting API request metrics including:
 * - Request duration
 * - Request/response sizes
 * - Error rates
 * - Active requests tracking
 *
 * @packageDocumentation
 */
import { FastifyInstance, FastifyRequest } from 'fastify';
/**
 * Configuration options for the metrics middleware
 */
export interface MetricsMiddlewareOptions {
    /** Routes to exclude from metrics collection (e.g., /health, /metrics) */
    excludeRoutes?: string[];
    /** Whether to collect request body size metrics */
    collectRequestSize?: boolean;
    /** Whether to collect response body size metrics */
    collectResponseSize?: boolean;
    /** Custom route normalizer function to reduce cardinality */
    normalizeRoute?: (request: FastifyRequest) => string;
}
/**
 * Fastify plugin for API metrics collection
 */
declare function metricsMiddlewarePlugin(fastify: FastifyInstance, options: MetricsMiddlewareOptions): Promise<void>;
/**
 * Export as Fastify plugin
 */
export declare const metricsMiddleware: typeof metricsMiddlewarePlugin;
/**
 * Create metrics tracking timer for manual instrumentation
 */
export declare function createApiTimer(method: string, route: string): {
    stop: (statusCode: number) => void;
};
export {};
//# sourceMappingURL=metrics.d.ts.map