Skip to content

Check readiness

GET
/api/ready
curl --request GET \
--url http://127.0.0.1:9090/api/ready \
--header 'X-Request-Id: 4f1c2b0e-8a7d-4c51-9e2f-3a6b8d0c1e7f'

Whether the instance takes work, for a load balancer’s health check: 200 while it does, 503 with why while it does not. It is not ready while it starts or shuts down, while an http listener not stopped by hand does not have its port, or when it has known for more than 5 seconds that it is behind the config version and could not catch up. A database it cannot reach does not make it not ready, as every instance shares the database: database says whether it answered. It answers from memory, and needs no login.

  • None
X-Request-Id
string
<= 128 characters /^[A-Za-z0-9._:-]+$/

An id to follow the request by: answered back in X-Request-Id, and in the log, the audit trail and the events the request causes. 1 to 128 letters, digits, -, _, . or :; anything else is replaced by a new id.

Example
4f1c2b0e-8a7d-4c51-9e2f-3a6b8d0c1e7f

It takes work.

Media typeapplication/json

Whether an instance takes work (GET /api/ready).

object
config_version
required

The config version this instance has put into use.

integer format: int64
database
required

Whether the database answered this instance’s last read of the config version (it reads it once a second). It does not decide readiness.

boolean
ready
required

It takes work: answered with 200, else 503.

boolean
why
required

Why it does not take work, one reason each; empty when it does.

Array<string>
Example
{
"config_version": 42,
"database": true,
"ready": true,
"why": []
}

It does not take work: it is starting or shutting down, an http listener does not have its port, or it is behind the config version. why says which.

Media typeapplication/json

Whether an instance takes work (GET /api/ready).

object
config_version
required

The config version this instance has put into use.

integer format: int64
database
required

Whether the database answered this instance’s last read of the config version (it reads it once a second). It does not decide readiness.

boolean
ready
required

It takes work: answered with 200, else 503.

boolean
why
required

Why it does not take work, one reason each; empty when it does.

Array<string>
Example
{
"config_version": 42,
"database": true,
"ready": false,
"why": [
"listener 'public' does not have its port: listener 'public' binding 0.0.0.0:8080: Address already in use (os error 98)"
]
}