10.6 Metrics for Prometheus and Zabbix
The server publishes key figures at /metrics in the Prometheus text format. Prometheus reads them directly; Zabbix reads them through an item of the type HTTP agent. Access is protected by metrics tokens, which only admins manage.
Access and tokens
/metrics requires a bearer token of the form Authorization: Bearer pdcm_β¦ as soon as a token is required. Without a valid token the server answers with 401 and the header WWW-Authenticate: Bearer realm="pdc-metrics". API tokens (pdc_β¦) and sessions are not accepted there; conversely, metrics tokens do not work for the API.
A token is required when either condition holds:
server.tomlcontains[metrics] require_token = true. New installations write this on first start.An admin switched on Require a token in the settings. What
server.tomlrequires cannot be switched off there (the interface reports a conflict).
An existing server.toml without a [metrics] section leaves /metrics open. The dashboard then warns that anyone who reaches the server can read the metrics until a token is required.
Managing tokens
Under Settings in the Metrics access section ("/metrics for Prometheus and Zabbix"), an admin creates and manages tokens:
Under the field with the Scrape address, enter a name (1 to 100 characters, for example
zabbix) and choose Create token.Copy the token from the Metrics token field. It is shown only once; only its SHA-256 value is stored.
Enter the token in the scraper (see below), then switch on Require a token. If no active token exists yet, the interface asks first, because scrapers stop working until they send one.
The table shows Name, Prefix (the first 12 characters), Created, and Last used. A valid token updates "Last used" even while no token is required yet, so you can check that the scraper works before switching over. Revoke⦠and the confirmation Revoke (Keep cancels) disable a token for good; Show revoked also lists revoked tokens. Tokens can only be created in a session, not with an API token. Creating, revoking, and switching Require a token are recorded in the audit log (metrics_token.created, metrics_token.revoked, metrics.require_token).
Setting up the scraper
The scrape address is https://<server>:8443/metrics (port and scheme as for the web interface; the settings page shows the address).
Prometheus:
scrape_configs:
- job_name: pdc-backup
scheme: https
metrics_path: /metrics
authorization:
credentials: pdcm_β¦
static_configs:
- targets: ["backup-server:8443"]
Zabbix: an item of the type HTTP agent with the URL https://<server>:8443/metrics, request type GET, and in the Headers field the entry Authorization with the value Bearer pdcm_β¦. Dependent items evaluate the raw data with the "Prometheus pattern" preprocessing, for example pdc_protection_status{agent_id="β¦"}.
Separate address for /metrics
With [metrics] listen = "127.0.0.1:9101" the server serves /metrics only at this address (HTTPS with the server certificate, nothing else). The web port then answers /metrics with 404. A change requires a server restart.
Metrics
Labels contain IDs only, never names. Times are Unix timestamps in seconds.
Metric | Meaning |
|---|---|
| Enrolled agents that are not revoked. |
| Agents with a live connection. |
| Revoked agents. |
| Runs in progress. |
| Counter of runs by kind and status (from the catalog; run logs expire, runs stay). |
| Open runs by status. |
| Jobs by kind. |
| Enabled jobs whose last run failed. |
| Result of a job's last run. |
| Time of the last successful run. |
| Time of the next scheduled run. |
| Snapshots in all repositories (catalog cache). |
| Stored bytes per repository. |
| Snapshots per repository. |
| Free space of the volume. |
| Fill level of the volume as a share from 0 to 1. |
| Forecast time at which the repository is full (see section 10.3 Reports). |
| Protection status per agent: 2 green, 1 yellow, 0 red. |
| Number of agents per protection status. |
| Newest snapshot of the agent in any repository. |
| Active retention holds (see section 10.5 Ransomware early warning). |
| Raised conditions (agent offline, repository full, certificate expiry). |
| Backups that raised a ransomware warning. |
| 1 while the server keeps Windows awake for running jobs. |
| Seconds since the server started. |
| Expiry of the server's TLS certificate. |
| Expiry of the internal CA certificate. |
Configuration in server.toml
Option | Effect | Default |
|---|---|---|
|
|
|
| Separate HTTPS address for | not set |
[metrics]
require_token = true
listen = "127.0.0.1:9101"