AudioFlux Docs
Guide
Ecosystem OverviewFull Setup GuideBackend CoreWeb PlayerStatus Monitor
DocsStatus Monitor
Observability & Monitoring

Status Monitor

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.

Monitoring Architecture

The status monitor runs synthetic checks every 60 seconds against critical infrastructure endpoints.

Synthetic Checks

GET

Automated HTTP requests sent every 60 seconds to /health to verify system uptime, memory pressure, and Redis connectivity.

Check Interval

60 seconds (configurable via environment variable)

Latency Tracking

Tracks Round-Trip Time (RTT) for Socket.IO synchronization events to detect network congestion and degraded performance.

Threshold

Alerts triggered if RTT exceeds 500ms

Monitoring Targets

Critical infrastructure components under continuous surveillance.

API Backend

Verifies that the Node.js orchestration layer is accepting Socket.IO connections and responding to REST requests. Checks include:

  • • HTTP 200 response from /health
  • • Redis connection status
  • • Memory usage < 90% threshold
  • • Active Socket.IO connections count

Search Providers

Performs 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;

CDN Connectivity

Checks edge cache availability for high-fidelity audio streams from JioSaavn and YouTube CDNs. Validates CORS headers and streaming endpoint accessibility.

Health Check Response Schema

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 Level Indicators

StatusColorCondition
Operational
All checks passing, latency < 200ms
Degraded
Latency 200-500ms or partial provider failures
Outage
Backend unreachable or Redis connection lost

Fault Tolerance Architecture

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.

Historical Metrics

The monitor stores the last 24 hours of check results for trend analysis.

Uptime (24h)
99.8%

1,438 / 1,440 checks passed

Avg Latency
142ms

P95: 287ms, P99: 412ms

Incidents
2

Last incident: 6 hours ago

Self-Hosting Tip

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.