Skip to content

feat(health): BA-112 report dependency health separately from application health - #1047

Open
ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/dependency-health-1025
Open

ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/dependency-health-1025

Conversation

@ranjeetprabhatedu-dotcom

Copy link
Copy Markdown

Summary

This PR implements BA-112 to report external dependency health separately from core application health, ensuring graceful operational degradation without false-positive core crashes.

  • Updates HealthController in health.controller.ts with checkDependencies() inspecting database, Stellar Horizon/RPC, and storage health indicators.
  • Distinguishes core application uptime (application.status: 'up') from external dependency failures (status: 'degraded').
  • Sets HTTP 503 SERVICE_UNAVAILABLE when critical dependencies are degraded while preserving diagnostic payload body.
  • Fixes exception import in coverage.ts to use HttpException with HttpStatus.TOO_MANY_REQUESTS.
  • Adds unit tests in app.controller.spec.ts covering healthy baseline state, isolated database degradation, and isolated Stellar RPC degradation.
  • Scoped strictly to the 3 allowlisted files:
    • BackendAcademy/src/health/health.controller.ts
    • BackendAcademy/src/health/coverage.ts
    • BackendAcademy/src/app.controller.spec.ts

Closes #1025

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.

BA-112 — Report dependency health separately

1 participant