Health Checks
Use liveness to detect an HTTP process that has stopped responding. Use readiness to decide whether to send it traffic.
HTTP Probes
Send a GET request to the App's HTTP listener. Both endpoints accept HEAD when you need only the status code.
| Endpoint | Result |
|---|---|
/-/health | HTTP 200 with {"status":"ok"} when the listener responds |
/-/ready | HTTP 200 with {"status":"ready","app":"app"} when checks pass, or HTTP 503 with {"status":"not_ready","app":"app"} when one fails |
For a local listener on port 3000, check readiness with this command.
curl --fail-with-body http://127.0.0.1:3000/-/readyLiveness skips dependency checks. Readiness checks run sequentially, with a two-second timeout per check. Give the load balancer enough time for the configured checks. GoForj logs failed checks on the server.
Inspect a Failed Dependency
Public readiness returns the status and App name. Send the HTTP process's APP_DIAG_TOKEN in the Authorization header to include the individual checks.
Authorization: Bearer $APP_DIAG_TOKENAuthorized results include each check's type, name, status, and driver when available. A failed check includes its raw error. For example, a failed db check for default can report a connection refusal.
Check from the Command Line
The built App's health command probes a running instance without starting local dependencies.
./bin/app health --url http://127.0.0.1:3000 --timeout-ms 10000 --failExpect ready, HTTP 200, and exit status zero. The command defaults to readiness and sends the diagnostic token when configured. Use --probe health for liveness. --fail exits nonzero for an unhealthy result.
Use an explicit base URL or probe URL to check a particular replica. Without --url, the command uses APP_URL or the configured loopback HTTP port. The default request timeout is two seconds. For an additional App, use its binary and listener, such as ./bin/admin at port 3100.
Readiness covers checks registered for enabled dependencies, such as the database, storage, cache, queues, and events. Follow release verification for an application smoke check and runtime verification for separate workers and schedulers.