Skip to content

feat(backend): Implement Health Check Dashboard with Real-time Metrics #271

Description

@devJaja

Summary

Build a comprehensive health check dashboard endpoint that provides real-time system metrics, dependency status, and performance analytics.

Motivation

Current health endpoints only check basic connectivity. A detailed health dashboard enables proactive monitoring and quick incident response.

Acceptance Criteria

  • GET /health/dashboard returns comprehensive system status
  • Metrics: request rate, avg response time, error rate, p95/p99 latency
  • Dependency status: SQLite, Venice AI, Stellar Horizon, WebSocket
  • Memory usage, CPU usage, uptime, and garbage collection stats
  • Agent status: online/offline count, average response time
  • Task metrics: active, queued, completed, failed counts
  • Payment metrics: total locked, released, refunded amounts
  • Metrics refreshed every 5 seconds (cached)
  • Endpoint protected by admin API key
  • Unit tests for all metric calculations

Files to Modify

File Action
backend/src/api/routes/health.ts Add dashboard endpoint
backend/src/services/metrics.ts New: metrics collection service
backend/src/services/metrics.types.ts New: metrics type definitions
backend/src/config/index.ts Add admin API key configuration
backend/src/api/routes/health.test.ts Add dashboard endpoint tests

How to Contribute

  1. Create branch feat/health-dashboard
  2. Build metrics collection service
  3. Implement dashboard endpoint with all metrics
  4. Add admin API key protection
  5. Write unit tests for metric calculations
  6. Run npm run test && npm run lint before submitting PR

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions