Real-time ecosystem surveillance for core API health, bot latency, and music provider availability. Built with Next.js and server-sent events for live status updates.
The status monitor runs synthetic checks every 60 seconds against critical infrastructure endpoints.
Automated HTTP requests sent every 60 seconds to /health to verify system uptime, memory pressure, and Redis connectivity.
60 seconds (configurable via environment variable)
Tracks Round-Trip Time (RTT) for Socket.IO synchronization events to detect network congestion and degraded performance.
Alerts triggered if RTT exceeds 500ms
Critical infrastructure components under continuous surveillance.
Verifies that the Node.js orchestration layer is accepting Socket.IO connections and responding to REST requests. Checks include:
/healthPerforms dummy searches on JioSaavn and YouTube to ensure valid upstream responses and detect API rate limiting or regional blocks.
// Synthetic search test
const testQuery = 'test';
const response = await fetch(
`/api/search/songs?q=${testQuery}`
);
const isHealthy = response.ok && response.data.length > 0;Checks edge cache availability for high-fidelity audio streams from JioSaavn and YouTube CDNs. Validates CORS headers and streaming endpoint accessibility.
The /health endpoint returns a comprehensive status object.
{
"status": "healthy",
"timestamp": 1673456789000,
"uptime": 86400,
"memory": {
"used": 512,
"total": 1024,
"percentage": 50
},
"redis": {
"connected": true,
"latency": 12
},
"activeRooms": 42,
"activeConnections": 156
}| Status | Color | Condition |
|---|---|---|
| Operational | All checks passing, latency < 200ms | |
| Degraded | Latency 200-500ms or partial provider failures | |
| Outage | Backend unreachable or Redis connection lost |
The status monitor is decoupled from the core API. If the backend fails, the monitor serves a static cached "Outage Detected" page to users, preventing redundant error reports and providing immediate feedback. The monitor itself is deployed on a separate infrastructure (Vercel Edge Network) to ensure availability even during complete backend failures.
The monitor stores the last 24 hours of check results for trend analysis.
1,438 / 1,440 checks passed
P95: 287ms, P99: 412ms
Last incident: 6 hours ago
When self-hosting the status monitor, configure the NEXT_PUBLIC_BACKEND_URL environment variable to point to your backend instance. For production deployments, consider using a separate monitoring service like UptimeRobot or Pingdom for external validation.