Health API
Health check endpoints
Health API
Health check endpoints for monitoring and load balancers.
GET /livez
Liveness probe. Indicates the agent process is running.
Authentication
None required (public endpoint).
Response
{
"status": "ok",
"timestamp": "2024-01-15T10:30:00Z"
}HTTP Status
200 OK- Agent is alive503 Service Unavailable- Agent is unhealthy
Example
curl http://agent:8080/livezUse Cases
- Kubernetes liveness probe
- Load balancer health check
- Basic connectivity test
GET /readyz
Readiness probe. Indicates the agent is ready to serve requests.
Authentication
None required (public endpoint).
Response
{
"status": "ok",
"timestamp": "2024-01-15T10:30:00Z"
}HTTP Status
200 OK- Agent is ready503 Service Unavailable- Agent is not ready
Example
curl http://agent:8080/readyzUse Cases
- Kubernetes readiness probe
- Load balancer health check
- Verify agent is fully initialized
Differences from Liveness
| Aspect | Liveness | Readiness |
|---|---|---|
| Purpose | Is the process alive? | Is it ready to serve? |
| During startup | Returns OK immediately | May return not ready |
| During maintenance | Returns OK | May return not ready |
Kubernetes Configuration
Example Kubernetes probe configuration:
apiVersion: v1
kind: Pod
metadata:
name: arctic-agent
spec:
containers:
- name: agent
image: arctic-agent:latest
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /livez
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
httpGet:
path: /readyz
port: 8080
initialDelaySeconds: 5
periodSeconds: 5Load Balancer Configuration
HAProxy
backend arctic_agents
option httpchk GET /livez
http-check expect status 200
server agent1 192.168.1.10:8080 check
server agent2 192.168.1.20:8080 checkNGINX
upstream arctic_agents {
server 192.168.1.10:8080;
server 192.168.1.20:8080;
}
server {
location /health {
proxy_pass http://arctic_agents/livez;
}
}