feat: add readiness probe with DB and cache checks#167
Closed
Uchechukwu-Ekezie wants to merge 1 commit into
Closed
feat: add readiness probe with DB and cache checks#167Uchechukwu-Ekezie wants to merge 1 commit into
Uchechukwu-Ekezie wants to merge 1 commit into
Conversation
- Add /api/v1/health/ready endpoint that checks database and HTTP cache config - Returns 200 when all checks pass, 503 when any critical dependency is unavailable - Liveness endpoint (GET /health/) remains unchanged for load balancer compatibility - Readiness response includes per-check status, latency, and error details Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@Uchechukwu-Ekezie Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Fixes #162
What changed
GET /api/v1/health/readyendpoint checking database and HTTP cache config200when all dependencies healthy,503when any critical dep is unavailablestatus,latencyMs, anderrorfor operator visibilityGET /api/v1/health/) is unchanged — safe for load balancer keep-alivesWhy
Separating liveness from readiness lets orchestrators (Kubernetes, ECS) distinguish process-alive from ready-to-serve-traffic. A failing DB connection routes traffic away without killing the pod.
How to test
DATABASE_URL→GET /api/v1/health/readyreturns200with both checks okDATABASE_URLat unreachable host → returns503with database failGET /api/v1/health/still returns200 OKregardless