UNPKG

@christiangalsterer/node-postgres-prometheus-exporter

Version:
21 lines (20 loc) 734 B
import type { Client } from 'pg'; import { type Registry } from 'prom-client'; import type { PgClientExporterOptions } from './pgClientExporterOptions'; /** * Exports metrics for the pg.Client module */ export declare class PgClientPrometheusExporter { private readonly client; private readonly register; private readonly options; private readonly defaultOptions; private readonly PG_CLIENT_ERRORS_TOTAL; private readonly PG_CLIENT_DISCONNECTS_TOTAL; private readonly clientErrors; private readonly clientDisconnects; constructor(client: Client, register: Registry, options?: PgClientExporterOptions); enableMetrics(): void; onClientError(_error: Error): void; onClientEnd(): void; }