@ai-capabilities-suite/mcp-debugger-core
Version:
Core debugging engine for Node.js and TypeScript applications. Provides Inspector Protocol integration, breakpoint management, variable inspection, execution control, profiling, hang detection, and source map support.
93 lines (92 loc) • 2.65 kB
TypeScript
/**
* Prometheus Metrics Exporter
* Exports metrics in Prometheus format
*/
export interface PrometheusMetric {
name: string;
type: 'counter' | 'gauge' | 'histogram' | 'summary';
help: string;
value: number;
labels?: Record<string, string>;
}
export declare class PrometheusExporter {
private metrics;
/**
* Register a counter metric
* @param name Metric name
* @param help Help text
* @param labels Optional labels
*/
registerCounter(name: string, help: string, labels?: Record<string, string>): void;
/**
* Increment a counter
* @param name Metric name
* @param value Increment value (default: 1)
* @param labels Optional labels
*/
incrementCounter(name: string, value?: number, labels?: Record<string, string>): void;
/**
* Register a gauge metric
* @param name Metric name
* @param help Help text
* @param labels Optional labels
*/
registerGauge(name: string, help: string, labels?: Record<string, string>): void;
/**
* Set a gauge value
* @param name Metric name
* @param value Gauge value
* @param labels Optional labels
*/
setGauge(name: string, value: number, labels?: Record<string, string>): void;
/**
* Increment a gauge
* @param name Metric name
* @param value Increment value (default: 1)
* @param labels Optional labels
*/
incrementGauge(name: string, value?: number, labels?: Record<string, string>): void;
/**
* Decrement a gauge
* @param name Metric name
* @param value Decrement value (default: 1)
* @param labels Optional labels
*/
decrementGauge(name: string, value?: number, labels?: Record<string, string>): void;
/**
* Get metric key with labels
*/
private getMetricKey;
/**
* Format labels for Prometheus
*/
private formatLabels;
/**
* Export metrics in Prometheus format
* @returns Metrics in Prometheus text format
*/
export(): string;
/**
* Get all metrics
* @returns Map of all metrics
*/
getMetrics(): Map<string, PrometheusMetric>;
/**
* Reset all metrics
*/
reset(): void;
/**
* Remove a metric
* @param name Metric name
* @param labels Optional labels
*/
removeMetric(name: string, labels?: Record<string, string>): void;
}
/**
* Global Prometheus exporter instance
*/
export declare const prometheusExporter: PrometheusExporter;
/**
* Initialize standard debugging metrics
*/
export declare function initializeDebuggerMetrics(exporter: PrometheusExporter): void;