Skip to content

feat(observability): enhanced health check with dependency latency #175

Description

@chitrank2050

Problem

Current health check only verifies Postgres connectivity. Redis and Kafka status are unknown. No latency information — a 10-second database response still shows "healthy."

Proposed solution

Enhance GET /health to report all dependencies:

{
  "status": "ok",
  "dependencies": {
    "postgres": { "status": "up", "latencyMs": 2 },
    "redis": { "status": "up", "latencyMs": 1 },
    "kafka": { "status": "up", "latencyMs": 5 }
  },
  "uptime": 86400,
  "version": "0.6.0"
}

Each dependency check: ping/NOOP command, measure round-trip, timeout at 5 seconds.

Alternatives considered

  • Separate liveness and readiness probes — future enhancement for Kubernetes. Start with unified /health.

Additional context

Uses @nestjs/terminus which is already installed. Add Redis and Kafka health indicators.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions