@loopback/metrics
Version:
An extension exposes metrics for Prometheus with LoopBack 4
33 lines (32 loc) • 830 B
TypeScript
import { DefaultMetricsCollectorConfiguration } from 'prom-client';
/**
* Options for metrics component
*/
export interface MetricsOptions {
endpoint?: {
disabled?: boolean;
basePath?: string;
};
defaultMetrics?: {
disabled?: boolean;
} & DefaultMetricsCollectorConfiguration;
defaultLabels?: {
[labelName: string]: string;
};
pushGateway?: {
disabled?: boolean;
url: string;
interval?: number;
jobName?: string;
groupingKey?: {
[key: string]: string;
};
replaceAll?: boolean;
};
openApiSpec?: boolean;
}
/**
* Configuration for metrics component with optional properties
*/
export type MetricsConfig = Partial<MetricsOptions>;
export declare const DEFAULT_METRICS_OPTIONS: MetricsOptions;