Skip to content

Performance Monitoring

The monitoring module collects runtime telemetry, assesses latency thresholds, and triggers alert notifications when health targets are breached. It powers the built-in terminal performance dashboard and maintains rolling statistical windows of request durations and status codes. It provides operations teams with immediate visibility into gateway health.

SymbolKindSignaturePurpose
AlertSeveritytypetype AlertSeverity = 'info' | 'warning' | 'critical'Alert severity levels
Metricsinterfaceinterface MetricsMetrics for alert evaluation
AlertRuleinterfaceinterface AlertRuleAlert rule definition
Alertinterfaceinterface AlertActive alert
AlertConfiginterfaceinterface AlertConfigAlert configuration
PerformanceAlerterclassclass PerformanceAlerterPerformance Alerter
TimeRangeinterfaceinterface TimeRangeTime range for historical queries
HistoricalMetricsinterfaceinterface HistoricalMetricsHistorical metrics data
MetricPointinterfaceinterface MetricPointSingle metric point
MetricAggregatesinterfaceinterface MetricAggregatesMetric aggregates
WorkerMetricsinterfaceinterface WorkerMetricsWorker metrics
RouteMetricsinterfaceinterface RouteMetricsRoute metrics
UpstreamMetricsinterfaceinterface UpstreamMetricsUpstream metrics
PerformanceAlertinterfaceinterface PerformanceAlertPerformance alert
EventStreamclassclass EventStream extends EventEmitterEvent stream for SSE
PerformanceDashboardclassclass PerformanceDashboardPerformance Dashboard

Renders live ANSI terminal charts displaying P50, P95, and P99 latency alongside error rates.

Configurable alerting engine triggering webhooks or logs when error rates or latency spike above limits.

  • src/monitoring/performance-alerts.ts
  • src/monitoring/performance-dashboard.ts