Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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 /metrics local 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

MetricMeaning
kanadr_info{version, schema}Installed version and database schema.
kanadr_mise_a_jour_disponible1 if a newer version is waiting in the repository.
kanadr_redemarrage_machine_a_prevoir1 if a system patch is waiting for the machine to restart.
kanadr_moteur_joignable1 if the telephony engine answers.
kanadr_appels_en_coursLive calls on the instance.
kanadr_postes_inscritsRegistered phones and softphones.
kanadr_licence_jours_restantsLicense days left; negative: expired for that many days.
kanadr_licence_bloquee1 if the license expired more than 30 days ago (portal and API read-only).
kanadr_appels_coupes1 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_recusCalls kept in the log.
kanadr_cdr_dernier_horodatage_secondesWhen the last call reached the log.
kanadr_webhooks_en_attenteWebhook deliveries waiting.
kanadr_webhooks_abandonnesDeliveries given up after all their attempts.
kanadr_ip_banniesAddresses 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_dedie1 if recordings have their own volume, 0 if they share the system disk.
kanadr_bascule_passives_connecteesActive/passive, on the active: passives replicating (1 in steady state).
kanadr_replication_retard_secondesActive/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.