Skip to content

Enhance Health Check Endpoint with Detailed Service Information #195

@aphansal123

Description

@aphansal123

Problem

The current health check endpoint (/v0/health) only returns basic status information. For a production service, we need more comprehensive health information to properly monitor the service and diagnose issues.

Current Behavior

{
  "status": "ok",
  "github_client_id": "client_id_here"
}

Proposed Enhancement

Add additional health information including:

  • Database connectivity status
  • Service dependencies status
  • Memory usage
  • Uptime information
  • Version information

Expected Response

{
  "status": "ok",
  "github_client_id": "client_id_here",
  "database": {
    "status": "connected",
    "type": "mongodb",
    "collection_count": 1
  },
  "uptime": "2h30m15s",
  "version": "v0.1.0",
  "memory": {
    "alloc": "2.1MB",
    "sys": "8.5MB"
  }
}

Technical Details

  • Modify internal/api/handlers/v0/health.go
  • Add database connectivity check
  • Include runtime metrics
  • Maintain backward compatibility

Acceptance Criteria

  • Database connection status is checked and reported
  • Service uptime is included
  • Memory usage is reported
  • Version information is included
  • Existing response format is maintained (backward compatible)
  • Health check responds quickly (< 100ms)

Labels

  • enhancement
  • good first issue
  • monitoring

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions