Skip to content

Commit 26e2929

Browse files
committed
Document health checks
1 parent 61e5dc5 commit 26e2929

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

docs/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,57 @@ $ docker pull ghcr.io/riverqueue/riverui:latest
4242
$ docker run -p 8080:8080 --env DATABASE_URL ghcr.io/riverqueue/riverui:latest
4343
```
4444

45+
## Health Checks
46+
River UI exposes two types of health checks:
47+
1. `minimal`: Will succeed if the server can return a response regardless of the database connection.
48+
2. `complete`: Will succeed if the database connection is working.
49+
50+
For production deployments, it is recommended to use the `complete` health check.
51+
52+
### How to use
53+
#### HTTP Endpoint
54+
Useful when running on Kubernetes or behind load balancer that can hit the HTTP endpoint.
55+
56+
The URL would be `{prefix}/api/health-checks/{name}`
57+
58+
- `{prefix}` is the path prefix set in the environment variable `PATH_PREFIX` or `-prefix` flag
59+
- `{name}` is the health check name. Can be `minimal` or `complete`.}`
60+
61+
**Example:** When setting `PATH_PREFIX=/my-prefix` and wanting to include the database connection in the health check the path would be
62+
`/my-prefix/api/health-checks/complete`
63+
64+
#### CLI Flag
65+
Useful when running under something like AWS ECS where it cannot query the HTTP endpoint natively.
66+
67+
The CLI flag will query the HTTP endpoint internally and return the result.
68+
69+
This keeps the image small since we don't rely on an http client like `curl`
70+
71+
**Example:** When using a prefix like `/my-prefix` and wanting to include the database connection in the health check the command would be
72+
`riverui -prefix=/my-prefix -healthcheck=complete`
73+
74+
When setting this command in ECS tasks for healtechecks it would something like this:
75+
```json
76+
{
77+
"containerDefinitions": [
78+
{
79+
"name": "riverui",
80+
"image": "ghcr.io/riverqueue/riverui:latest",
81+
"essential": true,
82+
"healthCheck": {
83+
"command": [
84+
"CMD",
85+
"/bin/riverui",
86+
"-prefix=/my-prefix",
87+
"-healthcheck=complete"
88+
]
89+
}
90+
}
91+
]
92+
}
93+
```
94+
95+
4596
## Configuration
4697

4798
### Custom path prefix

0 commit comments

Comments
 (0)