Create health monitoring dashboard
✓Works with OpenClaudeYou are a full-stack monitoring engineer. The user wants to build a real-time health monitoring dashboard that displays system metrics, service status, and alerts.
What to check first
- Verify Node.js 16+ is installed:
node --version - Check if you have a metrics collection service (Prometheus, StatsD, or custom endpoint)
- Confirm frontend framework preference (React recommended for real-time updates)
Steps
- Set up Express backend with
/api/healthendpoint that aggregates service metrics - Install real-time socket communication:
npm install socket.io expressfor bi-directional updates - Create metric collection functions that query system stats using
osmodule or external APIs - Build React frontend component with
npm install react rechartsfor chart rendering - Implement WebSocket listeners on client to receive metric updates every 5-10 seconds
- Add color-coded status indicators (green/yellow/red) based on threshold logic
- Create alert system that triggers notifications when metrics exceed defined limits
- Deploy with environment variables for metric thresholds and service URLs
Code
// server.js - Express + Socket.io backend
const express = require('express');
const http = require('http');
const socketIo = require('socket.io');
const os = require('os');
const app = express();
const server = http.createServer(app);
const io = socketIo(server, { cors: { origin: '*' } });
// Metric collection function
function gatherMetrics() {
const cpuUsage = os.loadavg()[0] * 100 / os.cpus().length;
const totalMem = os.totalmem();
const freeMem = os.freemem();
const memUsage = ((totalMem - freeMem) / totalMem) * 100;
return {
timestamp: new Date().toISOString(),
cpu: parseFloat(cpuUsage.toFixed(2)),
memory: parseFloat(memUsage.toFixed(2)),
uptime: os.uptime(),
services: {
api: { status: 'healthy', latency: 45 },
database: { status: 'healthy', latency: 12 },
cache: { status: 'healthy', latency: 8 }
}
};
}
// Emit metrics to connected clients every 5 seconds
setInterval(() => {
const metrics = gatherMetrics();
io.emit('metrics', metrics);
}, 5000);
// REST endpoint for initial load
app.get('/api/health', (req, res) => {
res.json(gatherMetrics());
});
app.use(express.static('public'));
server.listen(3000, () => {
console.log('Health dashboard server running on port 3000');
});
// Dashboard.jsx - React frontend component
import React, { useState
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Monitoring & Logging Skills
Other Claude Code skills in the same category — free to download.
Structured Logging
Implement structured logging (Winston, Pino)
Error Tracking
Set up error tracking (Sentry)
APM Setup
Set up Application Performance Monitoring
Log Rotation
Configure log rotation and management
Alert Rules
Configure alerting rules and notifications
Distributed Tracing
Set up distributed tracing
Metrics Collector
Implement custom metrics collection
Uptime Monitor
Set up uptime monitoring
Want a Monitoring & Logging skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.