Skip to content

fix: use correct health handlers#5376

Draft
Flo4604 wants to merge 1 commit into03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwisefrom
03-18-fix_use_correct_health_handlers
Draft

fix: use correct health handlers#5376
Flo4604 wants to merge 1 commit into03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwisefrom
03-18-fix_use_correct_health_handlers

Conversation

@Flo4604
Copy link
Member

@Flo4604 Flo4604 commented Mar 18, 2026

What does this PR do?

Replaces the basic health check endpoint with separate liveness and readiness probes for the sentinel service. The liveness probe continues to use the simple health endpoint, while the readiness probe now includes database connectivity and middleware engine status checks.

Adds a PingContext method to the database replica to support connection health verification.

Updates Kubernetes probe configurations to use distinct endpoints: /_unkey/internal/health/live for liveness and /_unkey/internal/health/ready for readiness.

Fixes #5367

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

  • Verify the liveness probe endpoint /_unkey/internal/health/live returns 200 OK
  • Verify the readiness probe endpoint /_unkey/internal/health/ready returns 200 OK when database and engine are healthy
  • Test that readiness probe fails when database connection is unavailable
  • Test that readiness probe fails when middleware engine is not ready
  • Confirm Kubernetes probes work correctly with the new endpoint paths

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • Ran make fmt on /go directory
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Unkey Docs if changes were necessary

Copy link
Member Author

Flo4604 commented Mar 18, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vercel
Copy link

vercel bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboard Ready Ready Preview, Comment Mar 24, 2026 1:23pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 35740387-9ba5-4c7c-a499-8b63f2c4135e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 03-18-fix_use_correct_health_handlers

Comment @coderabbitai help to get the list of available commands and usage tips.

@Flo4604 Flo4604 changed the base branch from 03-11-feat_cache_parsed_policies_extract_timer_pkg to graphite-base/5376 March 18, 2026 16:10
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from c5c3602 to 39a64e3 Compare March 18, 2026 16:11
@Flo4604 Flo4604 force-pushed the graphite-base/5376 branch from d62a21e to 3f550d3 Compare March 19, 2026 11:14
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from 39a64e3 to 3cf0336 Compare March 19, 2026 11:14
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from 3cf0336 to 21ef251 Compare March 23, 2026 12:08
@Flo4604 Flo4604 force-pushed the graphite-base/5376 branch from 3f550d3 to 3bdc149 Compare March 23, 2026 12:08
@Flo4604 Flo4604 changed the base branch from graphite-base/5376 to 03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwise March 23, 2026 12:09
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from 21ef251 to c216917 Compare March 23, 2026 12:26
@Flo4604 Flo4604 force-pushed the 03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwise branch from 3bdc149 to 60fb344 Compare March 23, 2026 12:26
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from c216917 to c2f78f0 Compare March 23, 2026 12:44
@Flo4604 Flo4604 force-pushed the 03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwise branch from 60fb344 to 9763159 Compare March 23, 2026 12:44
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from c2f78f0 to 3f823a1 Compare March 23, 2026 12:59
@Flo4604 Flo4604 force-pushed the 03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwise branch from 9763159 to 4cbd947 Compare March 23, 2026 12:59
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from 3f823a1 to f6c9de1 Compare March 23, 2026 13:08
@Flo4604 Flo4604 force-pushed the 03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwise branch from 4cbd947 to a5f4056 Compare March 23, 2026 13:08
@Flo4604 Flo4604 force-pushed the 03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwise branch from a5f4056 to e64329e Compare March 23, 2026 13:12
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from f6c9de1 to 46922be Compare March 23, 2026 13:12
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from 46922be to b0443f3 Compare March 23, 2026 13:38
@Flo4604 Flo4604 force-pushed the 03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwise branch from e64329e to 0ddba89 Compare March 23, 2026 13:38
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from b0443f3 to d142bd7 Compare March 23, 2026 13:41
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from d142bd7 to e95f096 Compare March 23, 2026 13:44
@Flo4604 Flo4604 force-pushed the 03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwise branch from 7be0117 to 832fd10 Compare March 23, 2026 13:44
@Flo4604 Flo4604 force-pushed the 03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwise branch from 832fd10 to a777cd3 Compare March 24, 2026 09:38
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from e95f096 to 01d783e Compare March 24, 2026 09:38
@Flo4604 Flo4604 force-pushed the 03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwise branch from a777cd3 to c8d828b Compare March 24, 2026 12:08
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from 01d783e to 9cdf0ef Compare March 24, 2026 12:08
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from 9cdf0ef to bba35ea Compare March 24, 2026 12:22
@Flo4604 Flo4604 force-pushed the 03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwise branch from c8d828b to 8912607 Compare March 24, 2026 12:22
@Flo4604 Flo4604 force-pushed the 03-18-fix_retry_redis_conn_in_the_bg_and_fail_open_otherwise branch from 8912607 to 8339690 Compare March 24, 2026 13:21
@Flo4604 Flo4604 force-pushed the 03-18-fix_use_correct_health_handlers branch from bba35ea to 810a4f1 Compare March 24, 2026 13:21
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.

1 participant