Create an instance of metrics manager
Configuration options for the metrics manager
The application identifier
Links offered by this service
The application name
The registry used by the aggregator
An Express router with access to metrics information
The health status of the component
Retrieves a single metric value in JSON format.
The name of the metric.
A promise resolved with the metric object or undefined if not found.
MetricsFacade class serves as a facade to simplify metrics management across all services in an application. It leverages the prom-client library for metrics management and the express library to expose these metrics via an HTTP endpoint.
It accommodates working in cluster environments by optionally creating a new AggregatorRegistry to hold metrics from all worker nodes, in addition to a separate registry for application-specific metrics and the default prom-client registry. Thus, it can manage up to three different registries:
Depending on the environment and the node type (primary or worker), it responds to metric requests by merging and presenting metrics from appropriate registries.