@hemantwasthere/monitoring-sdk
Version:
Centralized monitoring SDK for Node.js applications with Prometheus, Loki, and Grafana integration
32 lines (31 loc) • 834 B
TypeScript
export interface MonitoringConfig {
projectName: string;
serviceName: string;
technology: "nestjs" | "express" | "nodejs" | string;
environment?: string;
lokiHost?: string;
metricsPath?: string;
enableDefaultMetrics?: boolean;
prefixCustomMetrics?: boolean;
prefixAllMetrics?: boolean;
customLabels?: Record<string, string>;
}
export interface GlobalMonitoringConfig {
lokiHost: string;
environment?: string;
customLabels?: Record<string, string>;
}
export interface CronJobMetric {
jobName: string;
success: boolean;
duration: number;
error?: string;
}
export interface CustomMetricConfig {
name: string;
help: string;
labelNames?: string[];
type: "counter" | "gauge" | "histogram" | "summary";
buckets?: number[];
percentiles?: number[];
}