Readiness check for load balancers
const url = 'http://localhost:8080/health/ready';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:8080/health/readyTells a load balancer whether this server can take requests. It
returns 503 when the server is shutting down (draining) or cannot
reach the database. A late billing scheduler shows as degraded in
the body but keeps the status at 200: taking the server out of the
balancer would not restart the scheduler. Alert on the scheduler
metrics instead (see docs/ops/runbook/monitoring.md).
Responses
Section titled “Responses”Ready. status is ok, or degraded when only the scheduler is late.
object
One entry per check. api is ok or draining. database is
ok or error. scheduler starts with ok or degraded,
followed by detail such as ok: last run 12s ago. While
draining, only api is sent.
object
Example
{ "status": "ok"}Not ready. status is draining, or degraded when the database cannot be reached.
object
One entry per check. api is ok or draining. database is
ok or error. scheduler starts with ok or degraded,
followed by detail such as ok: last run 12s ago. While
draining, only api is sent.
object
Example
{ "status": "ok"}