feat: Add comprehensive health check endpoints with real-time monitoring - #18
Merged
Conversation
- Add health check command to CLI for checking the health status of the parity client and its services. - Introduce health handler with endpoints for basic health, detailed health, readiness, and liveness checks. - Update Makefile to include versioning information during build. - Enhance README with comprehensive health monitoring documentation and usage examples. - Refactor router to handle health check endpoints.
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.
Health Check Implementation
This PR adds comprehensive health monitoring capabilities to the parity client with real-time data collection and service connectivity testing.
Features Added
HTTP Health Endpoints
/health- Basic health check with service configuration status/health/detailed- Detailed health information with live service connectivity tests/health/ready- Kubernetes readiness probe with dependency validation/health/live- Kubernetes liveness probe for application statusCLI Health Command
parity-client health- Command line health checkparity-client health --detailed- Detailed health informationparity-client health --endpoint <url>- Custom endpoint supportparity-client health --timeout <duration>- Configurable timeoutReal-Time Data Collection
Technical Implementation
Service Health Checks
Version Management
Kubernetes Integration
Usage Examples
Command Line
HTTP API
Response Format
Basic Health Check
{ "status": "healthy", "timestamp": "2024-01-15T10:30:00Z", "version": "v1.0.0", "uptime": "2h30m15s", "services": { "blockchain": "configured", "ipfs": "configured", "runner": "configured" } }Detailed Health Check
{ "status": "healthy", "timestamp": "2024-01-15T10:30:00Z", "version": "v1.0.0", "uptime": "2h30m15s", "services": { "blockchain": { "status": "healthy", "last_check": "2024-01-15T10:29:55Z", "latency": "125ms" }, "ipfs": { "status": "healthy", "last_check": "2024-01-15T10:29:58Z", "latency": "45ms" }, "runner": { "status": "healthy", "last_check": "2024-01-15T10:30:00Z", "latency": "78ms" } }, "config": { "server_host": "0.0.0.0", "server_port": 3000, "blockchain_rpc": "https://your-blockchain-node.com", "ipfs_endpoint": "http://localhost:5001", "runner_url": "http://localhost:8080" } }