resq-health
Version:Service health diagnostic dashboard for ResQ platformv0.1.16· License:Apache-2.0· Crate: crates.io · API docs: docs.rs
Overview
--check mode, and supports integration test execution via --test.
Overview
resq-health monitors five core ResQ services by issuing HTTP health checks on a configurable interval. Standard services are probed with GET /health, while the Neo N3 RPC node uses a JSON-RPC getversion call. Results are displayed in a navigable table with color-coded status indicators, latency measurements, and error diagnostics. A non-interactive --check mode provides deterministic exit codes for CI pipelines.
Architecture
Installation
CLI Arguments
| Flag | Short | Default | Description |
|---|---|---|---|
--check | -c | off | CI mode: run a single health check cycle, print results, and exit with a status code |
--interval <N> | -i | 5 | Polling interval in seconds (TUI mode only) |
--test <PATH> | -t | — | Path to an integration test script or directory to execute |
Usage Examples
Interactive TUI (default)
CI / Health Gate Mode
Integration Tests
Integration Test JSON Format
TUI Layout
Detail View
PressingEnter on a service shows an expanded detail panel with the full URL, status, latency, and diagnostic error message.
Keyboard Shortcuts
| Key | Action |
|---|---|
q / Esc | Quit the application |
Down / j | Move selection down |
Up / k | Move selection up |
Enter | Toggle detail view for selected service |
h | Toggle help popup |
Health Status Levels
| Status | Color | Description |
|---|---|---|
Healthy | Green | Service responded successfully within timeout |
Degraded | Yellow | Service responded but reported non-”ok” status or high latency |
Unhealthy | Red | Service timed out, returned an error HTTP status, or is unreachable |
Unknown | Gray | Service has not been checked yet (initial state) |
Exit Codes (—check mode)
| Exit Code | Meaning |
|---|---|
0 | All services report Healthy |
1 | One or more services are not Healthy |
Monitored Services
| Service | Default URL | Health Endpoint | Protocol |
|---|---|---|---|
coordination-hce | http://localhost:5000 | /health | HTTP GET |
infrastructure-api | http://localhost:8080 | /health | HTTP GET |
intelligence-pdie | http://localhost:8000 | /health | HTTP GET |
neo-n3-rpc | http://localhost:20332 | / | JSON-RPC POST (getversion) |
ipfs-gateway | http://localhost:8081 | /api/v0/version | HTTP GET |
Environment Variables
Service URLs can be overridden via environment variables:| Variable | Default | Description |
|---|---|---|
HCE_URL | http://localhost:5000 | Base URL for the coordination-hce service |
INFRA_API_URL | http://localhost:8080 | Base URL for the infrastructure-api service |
PDIE_URL | http://localhost:8000 | Base URL for the intelligence-pdie service |
NEO_RPC_URL | http://localhost:20332 | URL for the Neo N3 RPC node |
IPFS_URL | http://localhost:8081 | Base URL for the IPFS gateway |
Configuration
resq-health does not use configuration files. All configuration is handled through CLI flags and environment variables as described above. To add a new service to the monitoring list, add it to the ServiceRegistry::new() function in src/services.rs.
Dependencies
| Crate | Purpose |
|---|---|
resq-tui | Shared TUI components, theme, header/footer/popup widgets |
clap | CLI argument parsing (derive mode) |
tokio | Async runtime with timer support |
reqwest | HTTP client for health check requests |
futures | Concurrent polling via join_all |
serde / serde_json | JSON deserialization of health responses |
chrono | Timestamp handling |
walkdir | Directory traversal for integration test discovery |
anyhow | Error propagation |