Skip to content

Add optional HTTP liveness and readiness probes - #4526

Open
Th0masL wants to merge 1 commit into
OpenSIPS:masterfrom
Th0masL:feat/http-health-probes
Open

Th0masL wants to merge 1 commit into
OpenSIPS:masterfrom
Th0masL:feat/http-health-probes

Conversation

@Th0masL

@Th0masL Th0masL commented Dec 2, 2026

Copy link
Copy Markdown

Summary

Add an optional http_health module providing HTTP liveness and readiness endpoints through httpd.

Details

Kubernetes probes and DNS services with HTTP health checks need an HTTP status code to determine whether an OpenSIPS instance is ready to receive traffic.

This builds on the drain module introduced in #4301 by exposing its readiness signal through HTTP status codes, while keeping liveness successful during draining.

Solution

  • /healthz returns 200 while the HTTP handler can respond.
  • /readyz returns 200 when the core is running and an optional configured Status/Report group has a positive status; otherwise 503.
  • Setting readiness_group to drain makes readiness reflect the existing drain state. Without this parameter, readiness checks only the core status.

Liveness does not check SIP worker responsiveness. These endpoints do not themselves remove instances from DNS or terminate them; external health-check configuration is still required. Existing httpd authentication applies to both endpoints.

Validated with a -Wall -Werror build and live integration tests covering drain/recovery, initial drain state, missing groups, core-only readiness, and liveness during draining.

Compatibility

The module is optional and requires httpd. Existing configurations remain unchanged unless the module is loaded.

SIP routing, SIP OPTIONS responses and the existing drain behavior are unchanged.

Closing issues

None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant