Closed
Conversation
Collaborator
|
@isaacd9 Thank you! Do you mind if I take this one over? I just brought in a small API framework in #63, and we're starting to write more tests for new endpoints. I also want to follow this pattern [1] of two separate health check endpoints, one of which will ping the database to make sure it's also healthy. Basic health check endpoints are useful in some cases like where a proxy might want to it to check liveness, but the app could be totally non-functional because the DB is down and a basic health check would still be reading as healthy. |
brandur
added a commit
that referenced
this pull request
Jun 28, 2024
…abase An alternative to #68 that adds a pair of health check endpoints: * `GET /api/health-checks/complete` * `GET /api/health-checks/minimal` The minimal endpoint just returns an OK response regardless of anything else so it'll return 200 as long as the Go process is up. The complete endpoint runs the additional check of pinging the database, verifying its liveliness as well. This is useful because if the database is totally down then River UI will be totally non-functional, but the minimal endpoint would still return OK, and it's nice to have an alternative that'll return an unhealthy status. Based on something I wrote about last year here [1]. [1] https://brandur.org/fragments/database-health-check
brandur
added a commit
that referenced
this pull request
Jun 28, 2024
…abase An alternative to #68 that adds a pair of health check endpoints: * `GET /api/health-checks/complete` * `GET /api/health-checks/minimal` The minimal endpoint just returns an OK response regardless of anything else so it'll return 200 as long as the Go process is up. The complete endpoint runs the additional check of pinging the database, verifying its liveliness as well. This is useful because if the database is totally down then River UI will be totally non-functional, but the minimal endpoint would still return OK, and it's nice to have an alternative that'll return an unhealthy status. Based on something I wrote about last year here [1]. Fixes #67. [1] https://brandur.org/fragments/database-health-check
Collaborator
|
Pitched up #72 as an alternative. |
brandur
added a commit
that referenced
this pull request
Jun 28, 2024
…abase (#72) An alternative to #68 that adds a pair of health check endpoints: * `GET /api/health-checks/complete` * `GET /api/health-checks/minimal` The minimal endpoint just returns an OK response regardless of anything else so it'll return 200 as long as the Go process is up. The complete endpoint runs the additional check of pinging the database, verifying its liveliness as well. This is useful because if the database is totally down then River UI will be totally non-functional, but the minimal endpoint would still return OK, and it's nice to have an alternative that'll return an unhealthy status. Based on something I wrote about last year here [1]. Fixes #67. [1] https://brandur.org/fragments/database-health-check --------- Co-authored-by: Isaac Diamond <isaac@meter.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a Healthcheck handler at
/healthcheck.Closes #67