@christiangalsterer/node-postgres-prometheus-exporter
Version:
A prometheus exporter for node-postgres
41 lines (40 loc) • 2.03 kB
TypeScript
import type { Pool } from 'pg';
/**
* Merges an array of label names with the label names of the default labels into a new array.
* @param labelNames array of label names to merge with the default labels
* @param defaultLabels default labels to merge with
* @returns array of merged label names
*/
export declare function mergeLabelNamesWithStandardLabels(labelNames: string[], defaultLabels?: {}): string[];
/**
* Merges Labels with default labels
* @param labels labels to merge with the default labels
* @param defaultLabels default labels to merge with
* @returns merged labels
*/
export declare function mergeLabelsWithStandardLabels(labels: Record<string, string | number | undefined>, defaultLabels?: {}): Record<string, string | number>;
/**
* Tries to determine the max pool size from the pool via direct property access as the configuration is not exported
* @param pool the pool from which to get the property
* @returns the configured max pool size or undefined
*/
export declare function getMaxPoolSize(pool: Pool): number | undefined;
/**
* Tries to determine the host configuration from the pool via direct property access as the configuration is not exported
* @param pool the pool from which to get the property
* @returns the configured host or undefined
*/
export declare function getHost(pool: Pool): string | undefined;
/**
* Tries to determine the port configuration from the pool via direct property access as the configuration is not exported
* @param pool the pool from which to get the property
* @returns the configured port or 5432 if not set
* @see https://node-postgres.com/api/pool#pool-connection-parameters
*/
export declare function getPort(pool: Pool): number;
/**
* Tries to determine the database configuration from the pool via direct property access as the configuration is not exported
* @param pool the pool from which to get the property
* @returns the configured database or undefined
*/
export declare function getDatabase(pool: Pool): string | undefined;