Overview
The /health endpoint provides real-time information about the load balancer’s operational status and backend server health.
Endpoint
Response
Overall health status
ok: Load balancer is operating normally
degraded: Some backends are down but service continues
down: No healthy backends available
Ratio of healthy backends (e.g., “3/3” or “2/3”)
Load balancer uptime in seconds since start
Example Request
curl http://localhost:8080/health
Example Response
All Backends Healthy
{
"status": "ok",
"healthy_backends": "3/3",
"uptime_seconds": 3600
}
Degraded State
{
"status": "degraded",
"healthy_backends": "2/3",
"uptime_seconds": 7200
}
No Healthy Backends
{
"status": "down",
"healthy_backends": "0/3",
"uptime_seconds": 1800
}
Use Cases
Kubernetes Liveness Probe
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
#!/bin/bash
response=$(curl -s http://localhost:8080/health)
status=$(echo $response | jq -r '.status')
if [ "$status" != "ok" ]; then
echo "ALERT: Load balancer unhealthy"
# Send alert
fi
Load Balancer Health Check
If you have multiple UltraBalancer instances behind a load balancer:upstream ultrabalancer_cluster {
server ultra1:8080;
server ultra2:8080;
}
# Health check
health_check interval=5s fails=3 passes=2 uri=/health;
Status Interpretation
All configured backends are healthy. The load balancer is fully operational.
One or more backends are unhealthy, but at least one backend is available. Service continues with reduced capacity.
No backends are available. The load balancer cannot serve requests.
Uptime Calculation
The uptime_seconds field represents how long the load balancer has been running since its last start. This counter resets to 0 when:
- The process is restarted
- Configuration is reloaded (in future versions)
- The system reboots
Use this field to track restart frequency and overall stability.
Integration Examples
Prometheus Blackbox Exporter
Monitor health endpoint availability:
scrape_configs:
- job_name: 'ultrabalancer-health'
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- http://ultrabalancer:8080/health
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
Grafana Alert
Create alert when health degrades:
alert: UltraBalancerDegraded
expr: ultrabalancer_healthy_backends_ratio < 1
for: 5m
labels:
severity: warning
annotations:
summary: "UltraBalancer has unhealthy backends"
description: "Only {{ $value }} backends are healthy"
Next Steps