UNPKG

nestjs-metrics-reporter

Version:

A global static Prometheus metrics reporter for NestJS applications

18 lines (17 loc) 907 B
import { Registry } from 'prom-client'; import { MetricsConfig, PushgatewayResponse } from '../interfaces'; export declare class MetricsService { private readonly registry; private readonly config; private readonly counter; private readonly gauge; private readonly histogram; private readonly summary; private readonly pushgateway; constructor(registry: Registry, config: MetricsConfig); incCounter(key: string, labels?: Record<string, string | number>, value?: number): void; setGauge(key: string, value: number, labels?: Record<string, string | number>): void; observeHistogram(key: string, value: number, labels?: Record<string, string | number>, buckets?: number[]): void; observeSummary(key: string, value: number, labels?: Record<string, string | number>, percentiles?: number[]): void; pushMetrics(jobName: string): Promise<PushgatewayResponse>; }