Health & Readiness API
Canonical reference: docs/api-reference.md (generated endpoint directory) — this page is a task-oriented summary.
Sol exposes three operational health endpoints plus a Prometheus metrics scrape endpoint. The health and readiness probes are designed for very different audiences:
/api/v1/health is a shallow check — it tells you the HTTP server is
up and how many models are running. Use it for liveness probes that should
succeed as long as the BEAM is answering HTTP.
/api/v1/ready is a deep check that runs 19 subsystem probes and
returns 503 if any critical component is degraded. Use it for Kubernetes
readiness, load-balancer health, and deployment gates.
/api/v1/infra/status (see Infra) is the detailed
per-service status with reasons and counts — the deep version that operators
read when /ready is failing.
/api/v1/healthand/api/v1/readyare on the auth-exempt list so infrastructure probes can hit them without credentials.
Health Check (shallow)
GET /health
GET /api/v1/health
Both aliases run the same handler and return the same body. No authentication required.
Response (200):
{
"status": "ok",
"models_running": 2
}
| Field | Description |
|---|---|
status | Always "ok" when the handler can answer. |
models_running | Count of currently running inference models (sol_registry:list_running). Falls back to 0 if the registry call fails. |
This endpoint never returns subsystem details, a checks array, or a degraded
status — for that, use /api/v1/ready (which still omits details, see below)
or /api/v1/infra/status (which includes them).
curl http://localhost:21434/api/v1/health
Readiness Probe (deep)
GET /api/v1/ready
Runs all 19 subsystem checks via sol_health:check_all/0. Returns 200 only when
every check passes; 503 otherwise.
Response (200, healthy):
{
"status": "ok",
"checks": [
{ "name": "providers", "status": "ok" },
{"name": "init", "status": "ok"},
{"name": "mnesia", "status": "ok"},
{"name": "zmq", "status": "ok"},
{"name": "mango", "status": "ok"},
{"name": "orchestrator_lease", "status": "ok"},
{"name": "projection", "status": "ok"},
{"name": "postgres", "status": "ok"},
{"name": "ets", "status": "ok"},
{"name": "listeners", "status": "ok"},
{"name": "disk", "status": "ok"},
{"name": "process_util", "status": "ok"},
{"name": "memory_util", "status": "ok"},
{"name": "message_queues", "status": "ok"},
{"name": "models", "status": "ok"},
{"name": "workers", "status": "ok"},
{"name": "core_data_plane", "status": "ok"},
{"name": "backup", "status": "ok"},
{"name": "audit", "status": "ok"}
]
}
Response (503, degraded):
{
"status": "degraded",
"checks": [
{"name": "mnesia", "status": "ok"},
{"name": "zmq", "status": "error"},
{"name": "disk", "status": "warning"}
]
}
providers — readiness check (see the /api/v1/ready list)
Checks array shape
Each entry has exactly two keys:
{ "name": "<subsystem>", "status": "ok|warning|error" }
There is intentionally no
detailsfield./api/v1/readyis on the auth-exempt list, so the full reason strings are stripped to avoid leaking internal state (paths, hostnames, error reasons) to unauthenticated callers. The detail maps are logged server-side atwarninglevel for operator diagnostics. To see details in the response body, use the admin-gated/api/v1/infra/statusendpoint.
Subsystems checked
| Check | Error conditions |
|---|---|
init | Application init tasks (event_store, workflow_defs, provider_boot) failed |
mnesia | Mnesia not started / not running |
zmq | ZMQ gateway not responding |
mango | Mango auth service unreachable |
orchestrator_lease | Orchestrator single-writer lease not confirmed/held: an unfenced (never-confirmed) boot or a stale hold is an error unless orchestrator_lease_stale_hold_ack=true; a fenced loser, an authority refusal or a holder-but-fenced deadlock is always an error. Reports gateway_fenced so the deploy probe sees a quiesced gateway. Independent of mango (Mango-down already fails that row; this one never reads it). |
postgres | PostgreSQL pool health check failed |
ets | Core ETS tables missing |
listeners | No Cowboy HTTP listener bound |
disk | Disk below critical (100 MB) or warning (1 GB) |
process_util | Process count > 80% (warning) / 95% (error) of limit |
memory_util | BEAM total memory > 4 GB (warning) |
message_queues | Any process mailbox > 100 messages |
models | Configured models exist but zero are ready (running/prepared) — an error when a fleet is expected (health_expect_models, default: any registered row); an absent table is “not configured”, never green-by-accident |
workers | Zero workers while a fleet is expected (fleet expected but no workers are registered; expectation = health_expect_workers, else zmq_enabled AND initial_workers > 0 — the shipped entrypoint renders initial_workers=1). Staleness uses worker_heartbeat_timeout_ms (shipped 15000 ms; code fallback 45000). A fresh deploy with no worker therefore returns 503. |
core_data_plane | A core data-plane owner is missing/suspended, or its mailbox is over the warning (5000) / critical (20000) bound |
projection | The per-boot projection proof is missing (event_replay_on_boot=false/degraded boot) — the RAM views may be empty; event retention is refused until a replay (projection_unproven). |
backup | Local scheduled backup disabled in prod (air-gap still requires it: local_backup_required), no off-host target in prod without airgap_mode=true (offhost_target_required), or the last backup failed. airgap_mode=true relaxes only the off-host leg. |
audit | Audit sink not running, or the flush is persistently degraded (configured-but-unreadable is an error) |
Prometheus Metrics
GET /metrics
Exposes metrics in Prometheus text exposition format (text/plain; version=0.0.4).
Auth-exempt (Alloy scrapes on a 15 s interval).
curl http://localhost:21434/metrics
Sample output:
# HELP sol_http_2xx_total HTTP 2xx responses (SLO)
# TYPE sol_http_2xx_total counter
sol_http_2xx_total 1234
# HELP sol_errors_total Error counts by module and category
# TYPE sol_errors_total counter
sol_errors_total{module="sol_pipeline",category="timeout"} 3
# HELP sol_latency_us Latency in microseconds
# TYPE sol_latency_us summary
sol_latency_us{quantile="0.50",name="http_request"} 12000
sol_latency_us{quantile="0.95",name="http_request"} 45000
sol_latency_us{quantile="0.99",name="http_request"} 245000
Metric families
| Family | Type | Description |
|---|---|---|
sol_*_total | counter | Request, task, worker counters |
sol_errors_total | counter | Errors by module and category |
sol_latency_* | summary | Request latency histogram |
sol_circuit_breaker_state | gauge | Circuit breaker open/closed |
sol_workers_* | gauge | Worker count and status |
sol_models_* | gauge | Model availability |
sol_uptime_seconds | gauge | Server uptime |
sol_build_info | gauge | Version and build metadata |
sol_process_* | gauge | Erlang process metrics |
sol_memory_* | gauge | BEAM memory metrics |
sol_ets_count | gauge | ETS table row counts |
sol_task_queue_* | gauge | Task queue depth |
sol_cluster_nodes | gauge | Connected cluster nodes |
sol_availability_percent | gauge | Calculated availability |
The internal JSON metrics counters exposed at
GET /api/v1/metricsare a separate, application-level snapshot — not the Prometheus scrape format.
Related
Infra — admin-gated detailed service status
(GET /api/v1/infra/status), maintenance mode, cache invalidation