import { Request, Response } from 'express';
import client from 'prom-client';
import type { Metric, MetricObjectWithValues, MetricValue } from 'prom-client';
import type { Knex } from 'knex';
type PrometheusClientConfig = {
    register?: client.Registry;
    pushgateway?: {
        enabled: boolean;
        url?: string;
        interval?: number;
        jobName?: string;
    };
};
/**
 * A client for exporting metrics to Prometheus, based on prom-client
 */
export declare class PrometheusClient {
    /**
     * Creates a new PrometheusClient instance
     * @param prometheusConfig - The configuration for the PrometheusClient
     */
    constructor(prometheusConfig?: PrometheusClientConfig, logger?: any);
    client: typeof client;
    gateway: client.Pushgateway<client.RegistryContentType> | undefined;
    queries: Map<string, () => void>;
    acquires: Map<number, () => void>;
    creates: Map<number, () => void>;
    private config;
    private prefix;
    private pushInterval;
    private pushRetries;
    private logger;
    /**
     * Initializes the prometheus client, setting up the pushgateway if enabled
     */
    init(): void;
    /**
     * Pushes metrics to the pushgateway, if enabled
     */
    pushMetrics(): Promise<void>;
    /**
     * Shuts down the prometheus client cleanly
     */
    stop(): void;
    /**
     * Tells prom-client to collect default metrics
     * Only called once on init
     */
    collectDefaultMetrics(): void;
    /**
     * Handles metrics requests to serve the /metrics endpoint
     * @param req - The request object
     * @param res - The response object
     */
    handleMetricsRequest(req: Request, res: Response): Promise<void>;
    /**
     * Returns the metrics from the registry as a string
     */
    getMetrics(): Promise<string>;
    /**
     * Returns the metrics from the registry as a JSON object
     *
     * Particularly useful for testing
     */
    getMetricsAsJSON(): Promise<object[]>;
    getMetricsAsArray(): Promise<object[]>;
    /**
     * Returns the content type for the metrics
     */
    getContentType(): "text/plain; version=0.0.4; charset=utf-8";
    /**
     * Returns a single metric from the registry
     * @param name - The name of the metric
     * @returns The metric
     */
    getMetric(name: string): Metric | undefined;
    /**
     * Returns the metric object of a single metric, if it exists
     * @param name - The name of the metric
     * @returns The values of the metric
     */
    getMetricObject(name: string): Promise<MetricObjectWithValues<MetricValue<string>> | undefined>;
    getMetricValues(name: string): Promise<MetricValue<string>[] | undefined>;
    /**
     *
     */
    /**
     * Registers a counter metric
     * @param name - The name of the metric
     * @param help - The help text for the metric
     * @param labelNames - The names of the labels for the metric
     * @returns The counter metric
     */
    registerCounter({ name, help, labelNames }: {
        name: string;
        help: string;
        labelNames?: string[];
    }): client.Counter;
    /**
     * Registers a gauge metric
     * @param name - The name of the metric
     * @param help - The help text for the metric
     * @param collect - The collect function to use for the gauge
     * @returns The gauge metric
     */
    registerGauge({ name, help, collect }: {
        name: string;
        help: string;
        collect?: () => void;
    }): client.Gauge;
    /**
     * Registers a summary metric
     * @param name - The name of the metric
     * @param help - The help text for the metric
     * @param percentiles - The percentiles to calculate for the summary
     * @param collect - The collect function to use for the summary
     * @returns The summary metric
     */
    registerSummary({ name, help, percentiles, maxAgeSeconds, ageBuckets, pruneAgedBuckets, collect }: {
        name: string;
        help: string;
        percentiles?: number[];
        maxAgeSeconds?: number;
        ageBuckets?: number;
        pruneAgedBuckets?: boolean;
        collect?: () => void;
    }): client.Summary;
    /**
     * Registers a histogram metric
     * @param name - The name of the metric
     * @param help - The help text for the metric
     * @param buckets - The buckets to calculate for the histogram
     * @param collect - The collect function to use for the histogram
     * @returns The histogram metric
     */
    registerHistogram({ name, help, buckets }: {
        name: string;
        help: string;
        buckets: number[];
        collect?: () => void;
    }): client.Histogram;
    /**
     * Instruments the knex connection pool and queries
     * @param knexInstance - The knex instance
     */
    instrumentKnex(knexInstance: Knex): void;
}
export {};
