Health Monitor
The Health Monitor is a standalone service within the primedocs infrastructure that continuously monitors the system state. It periodically checks all configured services and data sources and provides the results both via a dashboard in the DataSourceAdminApp and via an API. The Health Monitor is has to be configured in the primedocs.config (primedocs.config).
General Function
Dashboard
The Health Monitor dashboard is accessible via the DataSource Admin App and provides an overview of the current system status. It shows the status of all PrimeDocs services and data sources and allows the status to be refreshed manually. Detected warning and error messages from the application log can also be marked as read.
The dashboard updates automatically as long as the status is still unknown (e.g. directly after the service has started).
API
The current system status can also be retrieved programmatically. The API can be called without authentication:
GET {HealthMonitorUrl}/v1/status
Return values:
| Value | Status | HTTP Code | Description |
|---|---|---|---|
0 | OK | 200 | No problems detected. All services are running normally. |
1 | Degraded | 200 | Warnings are present. Services may be operating with limited functionality. |
2 | Severely degraded or nonoperational | 500 | Errors are present. Services may not be reachable or not functioning. |
3 | Unknown | 200 | The status is currently being determined. Typically occurs only when the Health Monitor starts. |
For detailed information, another endpoint is available which requires Basic Authentication (credentials are configured in primedocs.config):
GET {HealthMonitorUrl}/v1/status/detailed
Detected Errors and Warnings
The Health Monitor performs various checks on the system and data source level. The checks can be grouped into the following categories:
Configuration
Checks the validity of primedocs.config. This includes:
- Syntactic and structural correctness of the XML configuration file
- Valid app types for all configured applications
Possible impact: 🔴 Error
Reachability of Services
Checks whether the configured PrimeDocs services (e.g. Web API, other server applications) are reachable at their configured URLs.
Possible impact: 🔴 Error
Certificates
Checks the validity of the signing certificate configured for the Identity Server.
Possible impact: ⚠️ Warning (expires in < 30 days), 🔴 Error (expires in < 14 days or could not be loaded)
Application Log
Analyzes the NLog database for warnings and errors from the last 24 hours. Using the optional errorRatePolicy in primedocs.config, you can configure from which error rate per hour an error is triggered:
<healthMonitor basicAuth="user:pass" clientSecret="secret" intervalInSeconds="600">
<errorRatePolicy errorsPerHourThreshold="10"
statusBelowThreshold="Warning"
statusAboveThreshold="Error" />
</healthMonitor>
Without a configured policy, entries in the error log are displayed as warnings.
This function must be activated via the attribute databaseLoggingEnabled="true" on the primedocs element in primedocs.config.
Possible impact: ⚠️ Warning, 🔴 Error (depending on configuration)
Data Source Configuration and Content
For each configured data source, additional checks are carried out, e.g. for global settings, themes and content (for example snippets).
Possible impact: ⚠️ Warning, 🔴 Error
Unexpected Errors
If an unhandled exception occurs while executing any check, it is recorded as an error and displayed on the dashboard.
Possible impact: 🔴 Error