Skip to content

Commit c545ec2

Browse files
committed
Move health check documentation to its own file
1 parent 26e2929 commit c545ec2

2 files changed

Lines changed: 56 additions & 48 deletions

File tree

docs/README.md

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -43,54 +43,7 @@ $ docker run -p 8080:8080 --env DATABASE_URL ghcr.io/riverqueue/riverui:latest
4343
```
4444

4545
## 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-
```
46+
See [health checks](./healthchecks.md).
9447

9548

9649
## Configuration

docs/healthchecks.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# River UI Health Checks
2+
River UI exposes two types of health checks:
3+
1. `minimal`: Will succeed if the server can return a response regardless of the database connection.
4+
2. `complete`: Will succeed if the database connection is working.
5+
6+
For production deployments, it is recommended to use the `complete` health check.
7+
8+
## How to use
9+
### HTTP Endpoint
10+
Useful when running on Kubernetes or behind load balancer that can hit the HTTP endpoint.
11+
12+
The URL would be `{prefix}/api/health-checks/{name}`
13+
14+
- `{prefix}` is the path prefix set in the environment variable `PATH_PREFIX` or `-prefix` flag
15+
- `{name}` is the health check name. Can be `minimal` or `complete`.
16+
17+
**Example:** When setting `PATH_PREFIX=/my-prefix` and wanting to include the database connection in the health check the path would be
18+
```text
19+
/my-prefix/api/health-checks/complete
20+
```
21+
22+
### CLI Flag
23+
The riverui binary provides `-healthcheck=<minimal|complete>` flag. This flag allows the binary to perform a health check as a command.
24+
25+
This useful when the container orchestrator cannot hit the health check endpoint natively. Like in AWS ECS Tasks or Docker Compose file.
26+
27+
The CLI flag will query the HTTP endpoint internally and exit based on the response.
28+
29+
This keeps the container image small without having to install additional dependencies.
30+
31+
**Example:** When using a prefix like `/my-prefix` and wanting to include the database connection in the health check the command would be
32+
```text
33+
/bin/riverui -prefix=/my-prefix -healthcheck=complete
34+
```
35+
36+
When setting this command in ECS tasks for healtechecks it would something like this:
37+
```json
38+
{
39+
"containerDefinitions": [
40+
{
41+
"name": "riverui",
42+
"image": "ghcr.io/riverqueue/riverui:latest",
43+
"essential": true,
44+
"healthCheck": {
45+
"command": [
46+
"CMD",
47+
"/bin/riverui",
48+
"-prefix=/my-prefix",
49+
"-healthcheck=complete"
50+
]
51+
}
52+
}
53+
]
54+
}
55+
```

0 commit comments

Comments
 (0)