[health]
The /_gio/health endpoint load balancers and gio start poll: on by default, with a switch for the details it reports.
gio.toml
[health]
details = false # only {"status":"ok","nodeReady":...}Reference
| Key | Default | Description |
|---|---|---|
enabledboolean | true | Serve the endpoint. Turn it off when your platform probes another URL and you want no extra public endpoint. |
detailsboolean | true | Report the deployment id, worker topology, cache size and uptime. Off, the answer keeps what a probe needs, so the deployment id and worker count are not public. |
Behavior
The endpoint answers 200 from Rust while the process runs, without waiting for the worker:
json
{
"cacheEntries": 0,
"deploymentId": "495ddeb861e730d0",
"http2": true,
"nodeReady": true,
"status": "ok",
"tls": false,
"uptimeSecs": 0,
"workers": { "configured": 1, "ready": 1 }
}nodeReadyisfalsewhile no render worker is ready - during the respawn of the only worker, or of every worker in a pool. Cached and static content still serves, so the status stays200: readiness probes should read the field.- With
details = falsethe body is{"nodeReady":true,"status":"ok"}. - The endpoint is never rate-limited and no
gio.tomlormiddleware.tsrule applies to it.
No key in this section logs a warning.
Examples
A Kubernetes readiness probe
The status is always 200, so use the HTTP check for liveness and read nodeReady for readiness (the app image has Node, so no extra tool is needed):
deployment.yaml
livenessProbe:
httpGet: { path: /_gio/health, port: 3000 }
readinessProbe:
exec:
command:
- node
- -e
- "fetch('http://127.0.0.1:3000/_gio/health').then(r => r.json()).then(h => process.exit(h.nodeReady ? 0 : 1), () => process.exit(1))"Hide the deployment id
gio.toml
[health]
details = falseGood to know
- With
enabled = false,gio dev,gio startand the testing kit cannot read readiness from it, and treat any answer from the server as ready. - The deployment id is also visible in every page (
window.__GIO_DEPLOYMENT_ID__):details = falsekeeps it off this endpoint only.
Related
Version history
| Version | Changes |
|---|---|
v0.1.0-beta.8 | Introduced the section with enabled and details. The endpoint reports workers: { configured, ready }. |
v0.1.0-beta.6 | The endpoint reports deploymentId, nodeReady, cacheEntries and uptimeSecs. |
v0.1.0-beta.1 | /_gio/health introduced, not configurable. |