feat(discordsh): add real-time health monitoring with sysinfo (Phase 3)#7223
Merged
feat(discordsh): add real-time health monitoring with sysinfo (Phase 3)#7223
Conversation
Add HealthMonitor with background 60s polling for CPU, memory, threads, and process metrics via sysinfo 0.38.2. Wire shared Arc<HealthMonitor> into both Discord bot and Axum HTTP server. /health command shows rich embed with status thresholds (Healthy/Warning/Critical), /status embed gains health fields, HTTP /health returns JSON with system metrics, and Refresh button triggers immediate force_refresh(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Feb 24, 2026
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
HealthMonitormodule with background 60s polling for CPU, memory, threads, and process metrics viasysinfo0.38.2Arc<HealthMonitor>into both Discord bot (Data) and Axum HTTP server (HttpState)/healthslash command now shows rich embed with health thresholds (Healthy/Warning/Critical), memory bar, CPU, threads, PID, and uptime/statusembed gains conditional health fields (Memory, CPU, Threads, Health) when data is available/healthendpoint returns JSON with full system metrics instead of plain "OK"force_refresh()for immediate metric update before re-renderingTest plan
cargo build -p axum-discordsh— zero errorscargo clippy -p axum-discordsh— clean (only pre-existing warnings in other modules)cargo test -p axum-discordsh— 21/21 pass (5 new health tests + 16 existing)rustfmt --check— clean, passes pre-commit hookpnpm nx e2e discordsh— Docker build (requires OrbStack running)/statusshows Memory, CPU, Threads, Health fields/healthshows detailed health embed with thresholdsforce_refresh()and updates embedcurl localhost:4321/healthreturns JSON withstatus: "ok"and health metrics🤖 Generated with Claude Code