Skip to content

feat: add readiness probe with DB and cache checks#167

Closed
Uchechukwu-Ekezie wants to merge 1 commit into
accesslayerorg:mainfrom
OpenSourceCOntr:feat/readiness-probe-162
Closed

feat: add readiness probe with DB and cache checks#167
Uchechukwu-Ekezie wants to merge 1 commit into
accesslayerorg:mainfrom
OpenSourceCOntr:feat/readiness-probe-162

Conversation

@Uchechukwu-Ekezie
Copy link
Copy Markdown
Contributor

Fixes #162

What changed

  • Added GET /api/v1/health/ready endpoint checking database and HTTP cache config
  • Returns 200 when all dependencies healthy, 503 when any critical dep is unavailable
  • Response includes per-check status, latencyMs, and error for operator visibility
  • Liveness endpoint (GET /api/v1/health/) is unchanged — safe for load balancer keep-alives

Why

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

  1. Start server with valid DATABASE_URLGET /api/v1/health/ready returns 200 with both checks ok
  2. Point DATABASE_URL at unreachable host → returns 503 with database fail
  3. GET /api/v1/health/ still returns 200 OK regardless

- 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>
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 25, 2026

@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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add readiness probe with DB and cache checks

1 participant