Create an instance of the Health aggregator
Metadata describing the application, used to enrich the health data.
Logger instance for logging activities related to health monitoring.
Overall component status
Update or add a check measure. This should be used to inform about the state of resources behind the Component/Microservice, for example states of connections with field devices.
The new check will be taking into account in the overall health status.
The new check will be included in the checks
object with the key "component:measure".
If this key already exists, the componentId
of the check
parameter will be checked, if
there is a check with the same componentId
in the array, the check will be updated, in other
case the new check will be added to the existing array.
The maximum number external checks entries is 10, and the maximum number of checks per entry is 100.
component identification
measure identification
check to be updated or included
true, if the check has been updated or included
Update or add a check measure for a worker.
This should be used to inform about the state of resources behind the worker.
The new check will be taking into account in the overall health status.
The new check will be included in the checks
object with the key "component:measure".
If this key already exists, the componentId
of the check
parameter will be checked, if
there is a check with the same componentId
in the array, the check will be updated, in other
case the new check will be added to the existing array.
component identification
measure identification
check to be updated or included
true, if the check has been updated or included
The Aggregator class serves as a central point for collecting and aggregating health checks and statuses from various components within an application. It also allows for the integration of external and worker-specific checks to provide a comprehensive view of the application's health status.
This class extends EventEmitter to emit status updates, enabling other parts of the application to react to changes in health status as necessary.