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 Datasources 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 DataSourceAdminApp and provides an overview of the current system status. It is opened at https://your-url.example.com/datasourceadminapp/HealthMonitor. It shows the status of all PrimeDocs services and Datasources 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
The /v1/status endpoint is well suited as a health check for an external monitoring system: the HTTP code (200 for OK/Degraded/Unknown, 500 for errors) as well as the numeric return value can be evaluated directly. This way, incidents are detected without anyone having to open the dashboard manually.
Active client versions
The detailed endpoint (/v1/status/detailed) additionally reports under userClientUsages which primedocs clients are actively in use, in which versions — e.g. to check before a server update whether outdated desktop clients are still running, or whether old add-in manifests are still in circulation.
Per datasource, grouped by client type and version, the number of active clients as well as first and last use are recorded:
| Client type | Recorded version |
|---|---|
Desktop | Version of the desktop client (additionally with the machine name). |
Web | Version of the web app. |
TeamsAddin, OutlookAddin, OfficeAddin | Version of the deployed add-in manifest. |
SharePoint | Version of the deployed SharePoint package (sppkg). |
Notes on the behaviour:
- Usage is recorded at most once per 24 hours per user, client type and version; the tracking is non-critical and never impairs operation.
- Add-in and SharePoint deployments rolled out before this feature appear as version
unknown— an indicator that an update of the manifest or package is due there. - A background job cleans up entries whose last use is older than the retention period (default 90 days; configurable via the
userClientUsageRetentionDaysattribute on the<syncBehavior>element of theprimedocs.config).
Detected Errors and Warnings
The Health Monitor performs various checks on the system and Datasource 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)
Datasource Configuration and Content
For each configured Datasource, 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