import type { FastifyInstance } from 'fastify'; import promClient from 'prom-client'; import type { IFastifyMetrics, IMetricsPluginOptions } from './types'; /** * Plugin constructor * * @public */ interface IConstructiorDeps { /** Prometheus client */ client: typeof promClient; /** Fastify instance */ fastify: FastifyInstance; /** Metric plugin options */ options: Partial; } export declare const DEFAULT_OPTIONS: IMetricsPluginOptions; /** * Fastify metrics handler class * * @public */ export declare class FastifyMetrics implements IFastifyMetrics { private readonly deps; private readonly metricStorage; private readonly routesWhitelist; private readonly methodBlacklist; private routeMetrics?; private readonly options; private readonly routeFallback; private readonly getRouteLabel; private readonly registeredRoutesOnly; private readonly groupStatusCodes; private readonly hasCustomLabels; private readonly customLabelEntries; private createTimers; /** Prom-client instance. */ readonly client: typeof promClient; /** Creates metrics collector instance */ constructor(deps: IConstructiorDeps); /** Populates methods blacklist to exclude them from metrics collection */ private setMethodBlacklist; /** Populates routes whitelist */ private setRouteWhitelist; /** * Get default metrics registry * * @returns Default metrics registry */ private getCustomDefaultMetricsRegistries; /** * Get route metrics registry * * @returns Route metrics registry */ private getCustomRouteMetricsRegistries; /** Register route to expose metrics */ private exposeMetrics; /** Collect default prom-client metrics */ private collectDefaultMetrics; private registerRouteMetrics; /** * Build a pre-computed timer strategy function based on enabled configuration. */ private buildTimerStrategy; /** Check if route is in whitelist */ private isRouteWhitelisted; /** Check if route is in blacklist */ private isRouteBlacklisted; /** Collect per-route metrics */ private collectRouteMetrics; /** * Initialize metrics in registries. Useful if you call `registry.clear()` to * register metrics in regisitries once again */ initMetricsInRegistry(): void; } export {}; //# sourceMappingURL=fastify-metrics.d.ts.map