Skip to content

feat(health): dependency-aware readiness probe with bounded checks#488

Merged
Baskarayelu merged 1 commit into
CredenceOrg:mainfrom
fikrah-Tech:feature/deep-readiness-probe
Jun 19, 2026
Merged

feat(health): dependency-aware readiness probe with bounded checks#488
Baskarayelu merged 1 commit into
CredenceOrg:mainfrom
fikrah-Tech:feature/deep-readiness-probe

Conversation

@yunus-dev-codecrafter

Copy link
Copy Markdown
Contributor

Closes #464

Summary

This PR introduces a dependency-aware readiness probe that ensures pods only receive traffic when all required dependencies are healthy. It also separates readiness from liveness checks, following Kubernetes best practices.

Changes

  • Added a dependency-aware /api/health/ready endpoint.
  • Kept /api/health/live as a simple process health check.
  • Added a Horizon/Soroban circuit breaker readiness probe.
  • Added per-dependency latency (latencyMs) reporting for improved observability.
  • Added bounded timeouts (5s) for all health checks to prevent hanging probes.
  • Executed all dependency checks in parallel using Promise.all.
  • Simplified health aggregation logic to automatically support new probes.
  • Improved testability by making the Horizon probe fully injectable.

Benefits

  • Prevents unhealthy pods from receiving traffic.
  • Supports safer rolling deployments and zero-downtime releases.
  • Improves observability with per-dependency latency metrics.
  • Ensures health checks complete within a predictable time.
  • Makes the health check system easier to extend and maintain.

Testing

  • Verified readiness returns 503 when a required dependency is unavailable.
  • Verified liveness remains unaffected by dependency failures.
  • Verified timeout behavior for unresponsive dependencies.
  • Verified circuit breaker states are reported correctly.
  • Verified latency metrics are included in readiness responses.

@Baskarayelu

Copy link
Copy Markdown
Contributor

dependency-aware readiness probe with bounded checks - good ops hardening so a pod with a dead dependency stops taking traffic. merging 👍

@Baskarayelu Baskarayelu merged commit 26e7f05 into CredenceOrg:main Jun 19, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a deep readiness probe in src/routes/health.ts checking Postgres, Redis, and Horizon

2 participants