Skip to content

NethVoice: Monitor service availability #8093

Closed
1 of 1 issue completed
Closed

Description

@Amygos

Description

Add the first set of built-in alerts for NethVoice and NethVoice proxy, as part of #8066, so administrators know about problems before users report them.

Each module exports its own metrics and publishes its own alert rules. The node runs the export-metrics command of each module every 5 minutes (NethServer/ns8-core#1365). The metrics app evaluates the rules stored by the module (NethServer/ns8-metrics#91) and sends notifications with its existing portal and email settings.

The full list of alerts, with severity and conditions, is in this comment.

Scope

  • Services: ServiceDown for the NethVoice services (FreePBX/Asterisk, MariaDB, Janus, CTI, Phonebook, Tancredi, Satellite, Reports, SFTP, SAML2/OAuth2 proxies) and the proxy services (kamailio, postgres, redis, rtpengine). Service state is read from systemd, not from podman.
  • Trunks: NethVoiceTrunkUnreachable. NethVoice checks trunks that bypass the proxy; NethVoice proxy checks UDP trunks that go through it. TCP and TLS trunks through the proxy are not checked yet.
  • DNS: NethVoiceDnsFailure and NethVoiceDnsSlow for the NethVoice, CTI and proxy names, checked on the DNS resolver of the node (/etc/resolv.conf).
  • AI: NethVoiceAiKeyInvalid and NethVoiceAiCreditExhausted for the Deepgram and OpenAI keys used by transcription.
  • Alerts are off by default and are turned on per module from the "Alerts" card of the Settings page (set-alerts action). The list of alerts and their thresholds cannot be changed.

Call quality and configurable thresholds belong to the parent issue.

Acceptance criteria

  • With alerts off (default), no rules are published, but metrics are still exported. Turning alerts on publishes the rules; turning them off removes them.
  • Rules are published at module create, update, restore and clone, and removed when the module is removed. Rules of other modules are not touched.
  • ServiceDown fires with reason=stopped when a service is stopped for 10 minutes, or with reason=crash_loop when systemd restarts it at least 3 times in 10 minutes. Disabled services and services never started are not watched.
  • NethVoiceTrunkUnreachable fires when a trunk stays unregistered or its provider does not answer for 10 minutes.
  • NethVoiceDnsFailure fires when a name does not resolve (reason=not_resolved) or the proxy name does not point to the proxy IP (reason=ip_mismatch) for 15 minutes. NethVoiceDnsSlow fires when the resolver is slower than 3 seconds or does not answer for 15 minutes.
  • NethVoiceAiKeyInvalid fires when transcription is on and the provider rejects the API key for 10 minutes. NethVoiceAiCreditExhausted fires when Satellite reports a call refused for lack of credit, and clears after the next successful call.
  • A check that cannot run (for example AI provider unreachable or FreePBX stopped) is reported with nethvoice_exporter_collector_up = 0 (nethvoice_proxy_exporter_collector_up for the proxy) and raises no alert.
  • Alerts show the service or trunk, module instance and node, in English and Italian.
  • Requires core 3.24.0 or later and metrics app 1.7.0 or later. With an older metrics app the rules are ignored.

Verification

  • Unit tests for the metric collectors and rule publishing, and promtool tests for the alert rules, in both repositories.
  • Robot tests in CI for export-metrics, set-alerts and rule publishing.
  • Manual QA on a test cluster: services stopped and in crash loop, trunk failures, DNS not_resolved and ip_mismatch, invalid AI key, and rule cleanup on module removal.

References

Activity

  1. self-assigned this
    on Jul 8, 2026
  2. added
    nethvoiceBug or features releted to the NethVoice project
    on Jul 8, 2026
  3. added theissue type on Jul 8, 2026
  4. moved this from Todo to In Progress in NethVoiceon Jul 8, 2026
  5. linked a pull request that will close this issuefeat(metrics): add systemd exporter #194on Jul 8, 2026
  6. linked a pull request that will close this issueAdd systemd Prometheus exporter #907on Jul 8, 2026
  7. linked a pull request that will close this issueAdd NethVoice failed unit alerts #78on Jul 8, 2026
  8. added this to the NethVoice 1.7 milestone on Jul 8, 2026
  9. changed the title [-]NethVoice: Monitor failed systemd units[/-] [+]NethVoice: Monitor service availability[/+] on Sep 25, 2026
  10. 4 remaining items

  11. added
    testingPackages are available from testing repositories
    on Oct 28, 2026
  12. removed their assignment
    on Oct 28, 2026
  13. moved this from In Progress to Testing in NethVoiceon Oct 28, 2026
  14. self-assigned this
    on Oct 28, 2026
  15. removed their assignment
    on Nov 9, 2026
  16. removed
    testingPackages are available from testing repositories
    on Nov 9, 2026
  17. moved this from Testing to Verified in NethVoiceon Nov 9, 2026
  18. edospadoni commented on Nov 9, 2026

    @edospadoni
    Member

    Release nethesis/ns8-nethvoice-proxy 1.8.0

  19. edospadoni commented on Nov 9, 2026

    @edospadoni
    Member

    Release nethesis/ns8-nethvoice 1.8.0

  20. moved this from Verified to Done in NethVoiceon Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    nethvoiceBug or features releted to the NethVoice projectverifiedAll test cases were verified successfully

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions