Check readiness
const url = 'http://127.0.0.1:9090/api/ready';const options = { method: 'GET', headers: {'X-Request-Id': '4f1c2b0e-8a7d-4c51-9e2f-3a6b8d0c1e7f'}};
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://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.
Authorizations
Section titled “Authorizations”- None
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”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-3a6b8d0c1e7fResponses
Section titled “Responses”It takes work.
Whether an instance takes work (GET /api/ready).
object
The config version this instance has put into use.
Whether the database answered this instance’s last read of the config version (it reads it once a second). It does not decide readiness.
It takes work: answered with 200, else 503.
Why it does not take work, one reason each; empty when it does.
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.
Whether an instance takes work (GET /api/ready).
object
The config version this instance has put into use.
Whether the database answered this instance’s last read of the config version (it reads it once a second). It does not decide readiness.
It takes work: answered with 200, else 503.
Why it does not take work, one reason each; empty when it does.
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)" ]}