Monitoring
Kanadr exposes its metrics in Prometheus format, and ships reference alerts.
Plugging in Prometheus
Two ways to read /metrics:
-
From the VM, with nothing to set up: Prometheus, or a local agent that relays (Grafana Agent, node_exporter…), scrapes
127.0.0.1:8080.scrape_configs: - job_name: kanadr static_configs: - targets: ["127.0.0.1:8080"] -
From your Prometheus, over https, with a monitoring token: API menu of the portal, Monitoring (Prometheus) card, Create a token. The configuration to copy is shown only once, token included:
scrape_configs: - job_name: kanadr scheme: https authorization: credentials: cxs_… static_configs: - targets: ["voip.operateur.exemple"]One token at a time: Replace the token invalidates the old one at once, Revoke makes
/metricslocal only again. The card shows Prometheus’s last read. Without a valid token, a request that goes through nginx is refused. Only an operator admin, signed in in person, manages this token: neither an API key nor the publisher’s support access.
Metrics
| Metric | Meaning |
|---|---|
kanadr_info{version, schema} | Installed version and database schema. |
kanadr_mise_a_jour_disponible | 1 if a newer version is waiting in the repository. |
kanadr_redemarrage_machine_a_prevoir | 1 if a system patch is waiting for the machine to restart. |
kanadr_moteur_joignable | 1 if the telephony engine answers. |
kanadr_appels_en_cours | Live calls on the instance. |
kanadr_postes_inscrits | Registered phones and softphones. |
kanadr_licence_jours_restants | License days left; negative: expired for that many days. |
kanadr_licence_bloquee | 1 if the license expired more than 30 days ago (portal and API read-only). |
kanadr_appels_coupes | 1 if the license expired more than 60 days ago (new calls refused, except emergency numbers). |
kanadr_trunks{etat} | Customer trunks by registration state (REGED, FAIL_WAIT, NOREG for an IP-authenticated trunk, INCONNU). |
kanadr_cdr_recus | Calls kept in the log. |
kanadr_cdr_dernier_horodatage_secondes | When the last call reached the log. |
kanadr_webhooks_en_attente | Webhook deliveries waiting. |
kanadr_webhooks_abandonnes | Deliveries given up after all their attempts. |
kanadr_ip_bannies | Addresses banned right now. |
kanadr_volume_taille_octets{volume} | Volume size: enregistrements (theirs, see Recordings volume) or systeme (system disk). |
kanadr_volume_libre_octets{volume} | Free bytes on the volume. |
kanadr_enregistrements_volume_dedie | 1 if recordings have their own volume, 0 if they share the system disk. |
kanadr_bascule_passives_connectees | Active/passive, on the active: passives replicating (1 in steady state). |
kanadr_replication_retard_secondes | Active/passive, on the active: lag of the passive. |
Reference alerts
/usr/share/doc/kanadr/supervision/alertes.yml, to load into Prometheus: Kanadr or the telephony
engine unreachable, trunk not registered, no more calls in the log during the day, webhooks waiting or
given up, too many banned addresses, update waiting for a week, active/passive without a passive
or lagging, license about to expire or expired, sudden drop of registered phones, recordings volume at 80% then
95% or sharing the system disk, less than 10% free on the system disk. The thresholds are
starting points, to adjust.
Add an alert on CPU (above 75% at peak, see Sizing) and on disk space, with your system agent.
In active/passive, Kanadr is stopped on the passive: monitor both VMs, and only raise “Kanadr unreachable” if neither answers.
In the portal
The Diagnostics page shows the health of the instance (telephony engine, database, call log, webhooks, trunks), live calls and banned addresses; fleet alerts by email or webhook (trunk down or restored, usage cap, budget, license, storage) are set in the instance settings.