Skip to content

Build Health Check and Observability Module #39

@Mkalbani

Description

@Mkalbani

Description

Implement a health module that exposes readiness and liveness endpoints, along with basic observability hooks. In a production API, especially one with on-chain integrations, knowing the service is healthy and its dependencies are reachable is critical. This module ensures the API is production-operable from day one.

Acceptance Criteria

  • A health module is scaffolded at src/health/
  • GET /health/live returns 200 if the process is running
  • GET /health/ready checks DB connectivity and returns 200 or 503 accordingly
  • Response includes individual dependency statuses (db, cache if applicable)
  • Health endpoints are excluded from JWT authentication
  • Unhealthy dependencies return a structured error body, not a plain 500
  • Request logging middleware logs method, path, status, and duration for every request
  • Unit tests cover healthy state, DB failure simulation, and response structure

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions