feat: add HTTP health endpoints to instance manager - #12
Merged
Conversation
Add /healthz, /readyz, and /status HTTP endpoints to the instance manager following the CNPG pattern. These endpoints provide health information without spawning processes. Endpoints: - GET /healthz - Liveness check (200 if Redis responds to PING) - GET /readyz - Readiness check (200 if Redis is ready for traffic) - GET /status - Detailed status for debugging/monitoring Features: - Persistent Redis connection (no process spawning) - Cached health status (refreshed every 1s) - Readiness checks for loading, syncing, master link status - Configurable port via --health-port flag Includes: - Unit tests for all endpoints - E2E tests validating endpoint behavior Fixes #6
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.
Summary
Adds HTTP health endpoints to the instance manager, following the CNPG pattern. These endpoints provide health information without spawning processes, enabling future replacement of the current
redis-clibased probes.Fixes #6
Endpoints
/healthz/readyz/statusFeatures
--health-portflag (default 8080)Response Examples
/healthz
{"status":"ok","redis_pid":123,"uptime_seconds":3600}/readyz
{"status":"ok","role":"master","connected_clients":5,"loading":false}/status
{ "redis": {"pid":123,"role":"master","connected_clients":5,...}, "replication": {"role":"master","connected_slaves":2,...}, "instance_manager": {"version":"v1.7.0","uptime_seconds":3600,...} }Test Coverage
Test Plan