Service Status
Real-time monitoring of microservices health and SLA metrics.
Configuration
To monitor your actual microservices, update the configuration above:
Expected Health Endpoint Format
Your services should expose a health endpoint that returns:
{
"status": "healthy",
"uptime": 86400,
"version": "1.0.0",
"responseTime": 45,
"sla": {
"target": 99.9,
"current": 99.95
},
"message": "All systems operational"
}
Configuration Options
const monitor = new StatusMonitor('status-dashboard', {
services: [
{
name: 'Your Service Name',
healthEndpoint: 'https://your-service.com/health',
displayUrl: 'your-service.com' // Optional display URL
}
],
refreshInterval: 30000 // Auto-refresh interval in ms
});
Status Values
- healthy - Service is fully operational (green)
- degraded - Service is running but with issues (yellow)
- unhealthy - Service is down or unreachable (red)
- unknown - Unable to determine status (gray)
SLA Tracking
If your health endpoint returns SLA data:
{
"sla": {
"target": 99.9, // Target uptime percentage
"current": 99.95 // Current uptime percentage
}
}
A progress bar will be displayed showing SLA performance.
Features
- ✅ Real-time monitoring - Auto-refreshes every 30 seconds
- ✅ Response time tracking - Shows API response times
- ✅ Uptime display - Shows how long service has been running
- ✅ SLA metrics - Visual progress bars for SLA targets
- ✅ Status badges - Color-coded health indicators
- ✅ Overall health - Aggregate health percentage
- ✅ Error handling - Gracefully handles service failures
Example Backend Health Endpoint
Node.js/Express
app.get('/health', (req, res) => {
res.json({
status: 'healthy',
uptime: process.uptime(),
version: '1.0.0',
sla: {
target: 99.9,
current: 99.95
},
message: 'Service operational'
});
});
Python/FastAPI
@app.get("/health")
async def health_check():
return {
"status": "healthy",
"uptime": time.time() - start_time,
"version": "1.0.0",
"sla": {
"target": 99.9,
"current": 99.95
},
"message": "Service operational"
}
Stopping Monitoring
window.statusMonitor.stop(); // Stops auto-refresh