Skip to main content
GET
/
health
Health Endpoint
curl --request GET \
  --url https://api.example.com/health
{
  "status": "<string>",
  "healthy_backends": "<string>",
  "uptime_seconds": 123
}

Overview

The /health endpoint provides real-time information about the load balancer’s operational status and backend server health.

Endpoint

GET /health

Response

status
string
Overall health status
  • ok: Load balancer is operating normally
  • degraded: Some backends are down but service continues
  • down: No healthy backends available
healthy_backends
string
Ratio of healthy backends (e.g., “3/3” or “2/3”)
uptime_seconds
number
Load balancer uptime in seconds since start

Example Request

curl http://localhost:8080/health

Example Response

All Backends Healthy

200 OK
{
  "status": "ok",
  "healthy_backends": "3/3",
  "uptime_seconds": 3600
}

Degraded State

200 OK
{
  "status": "degraded",
  "healthy_backends": "2/3",
  "uptime_seconds": 7200
}

No Healthy Backends

503 Service Unavailable
{
  "status": "down",
  "healthy_backends": "0/3",
  "uptime_seconds": 1800
}

Use Cases

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
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

ok
All configured backends are healthy. The load balancer is fully operational.
degraded
One or more backends are unhealthy, but at least one backend is available. Service continues with reduced capacity.
down
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:
prometheus.yml
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