Skip to content

feat: per-component health probes#856

Merged
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
eliassmthl-collab:task/health-probes
Jul 27, 2026
Merged

feat: per-component health probes#856
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
eliassmthl-collab:task/health-probes

Conversation

@eliassmthl-collab

Copy link
Copy Markdown

Implement GET /api/admin/health/probes and GET /api/admin/health/probes/:component for detailed per-component health monitoring (api, database, soroban_rpc, horizon).

  • Router factory in src/routes/admin/health/probes.ts with dependency injection for pool and config to enable unit testing without real services
  • All components checked in parallel via Promise.all on the aggregate endpoint
  • HTTP 503 returned when overall status is 'down'; 200 for 'ok' and 'degraded'
  • Per-component route validates component name via Zod; returns 404 for unconfigured optional components (soroban_rpc, horizon) and 400 for unknown names
  • Audit log emitted on every request (READ_HEALTH_PROBES / READ_HEALTH_PROBE_COMPONENT)
  • Mounted at /health/probes in admin router behind adminAuth + IP allowlist
  • 16 focused tests covering healthy/degraded/down states, 401, 400, 404, response shape, timestamp, version; 94.6% stmt / 93.3% branch / 100% func coverage
  • Fix duplicate import and dead code block in errorHandler.ts
  • Add docs/admin-health-probes.md with full API reference, status table, config vars, audit log format, and curl examples
  • Update README What's included section

Closes #604

Implement GET /api/admin/health/probes and GET /api/admin/health/probes/:component
for detailed per-component health monitoring (api, database, soroban_rpc, horizon).

- Router factory in src/routes/admin/health/probes.ts with dependency injection
  for pool and config to enable unit testing without real services
- All components checked in parallel via Promise.all on the aggregate endpoint
- HTTP 503 returned when overall status is 'down'; 200 for 'ok' and 'degraded'
- Per-component route validates component name via Zod; returns 404 for unconfigured
  optional components (soroban_rpc, horizon) and 400 for unknown names
- Audit log emitted on every request (READ_HEALTH_PROBES / READ_HEALTH_PROBE_COMPONENT)
- Mounted at /health/probes in admin router behind adminAuth + IP allowlist
- 16 focused tests covering healthy/degraded/down states, 401, 400, 404,
  response shape, timestamp, version; 94.6% stmt / 93.3% branch / 100% func coverage
- Fix duplicate import and dead code block in errorHandler.ts
- Add docs/admin-health-probes.md with full API reference, status table,
  config vars, audit log format, and curl examples
- Update README What's included section

Closes CalloraOrg#604
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@eliassmthl-collab Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@greatest0fallt1me
greatest0fallt1me merged commit e92024a into CalloraOrg:main Jul 27, 2026
@grantfox-oss grantfox-oss Bot mentioned this pull request Jul 27, 2026
4 tasks
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.

Add /api/admin/health/probes

2 participants