GET /health
Returns the health status of all configured backends. This endpoint does not require authentication and can be used for monitoring, alerting, and load balancer health checks.Request
No parameters required.Response
Returns a JSON object with overall status and per-backend health details.Overall router health status:
"healthy": At least one backend is healthy"unhealthy": All backends are unhealthy
Array of backend health status objects
Health Check Algorithm
Backends are marked healthy/unhealthy based on a circuit breaker pattern:- Initial State: All backends start healthy
- Health Probe: Background task calls configured RPC method (e.g.,
getSlot) everyhealth_check.interval_secs(default 30s) - Failure Threshold: Backend marked unhealthy after
consecutive_failures_thresholdconsecutive failures (default 3) - Recovery Threshold: Unhealthy backend marked healthy after
consecutive_successes_thresholdconsecutive successes (default 2)
Configuration
Health check behavior is configured inconfig.toml:
Example Request
Health Check
Response Examples
Use Cases
Monitoring & Alerting
Monitoroverall_status and backend-level healthy flags:
Alert on Unhealthy
Load Balancer Health Checks
Configure upstream health checks to poll/health and validate overall_status:
nginx.conf
Grafana Dashboard
Parse health endpoint in a JSON datasource:- Panel 1: Gauge showing healthy backend count
- Panel 2: Table with
label,healthy,consecutive_failures,last_error - Alert: Trigger when
overall_status != "healthy"
Impact on Request Routing
Unhealthy backends are automatically excluded from:- Weighted load balancing selection
- Method-based routing (falls back to weighted selection if target is unhealthy)
- WebSocket backend selection
503 Service Unavailable.
Hot Reload Support
The health state persists across configuration reloads (kill -HUP <pid>). When backends are reloaded:
- Existing backend labels retain their health status and history
- New backends start healthy with no history
- Removed backends are discarded from the health state