A flag indicating whether the check interval has started.
Retrieves the statuses of all registered dependencies.
Retrieves the Prometheus metrics for all dependencies.
const prometheusMetrics = await monitor.getPrometheusMetrics();
console.log(prometheusMetrics);
// Output:
// # HELP dependency_health The status of the database connection (0 = Healthy, 1 = Unhealthy)
// # TYPE dependency_health gauge
// dependency_health{dependency="Database", impact="Database info will not be available."} 0
// # HELP dependency_latency The latency of the database connection check
// # TYPE dependency_latency gauge
// dependency_latency{dependency="Database"} 50
Returns the underlying prom-client Registry used for metrics. Metrics are always enabled; this method never returns undefined.
Retrieves the status of a specific dependency by name.
The name of the dependency to check.
Registers a new dependency to be monitored.
The dependency to register.
An interface defining the structure of the dependency monitor class. It includes properties and methods for managing the monitoring of dependencies. DependencyMonitorInterface