Skip to content

feat(api): health endpoint metrics for self-host monitoring - #314

Merged
unjica merged 2 commits into
developfrom
feat/234-health-metrics
Jul 9, 2026
Merged

unjica merged 2 commits into
developfrom
feat/234-health-metrics

Conversation

@unjica

@unjica unjica commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Extends GET /health with version on every response (from TELEMETRY_API_VERSION or package version)
  • When HEALTH_CHECK_DATABASE=true, reports database_latency_ms alongside existing database status
  • Optional HEALTH_DETAILED=true adds uptime_seconds and node_version (no secrets)
  • Documents new env vars in DEPLOYMENT.md and .env.example

Closes #234

Test plan

  • pnpm lint && pnpm test && pnpm build
  • Unit tests for buildHealthResponse (version, DB latency, detailed mode, no secret leakage)
  • Smoke and integration tests updated for new fields
  • Manual: curl localhost:3001/health with HEALTH_CHECK_DATABASE=true and HEALTH_DETAILED=true

Made with Cursor

Adds structured health metrics for self-host uptime monitoring (#234):
version on every response, database_latency_ms when HEALTH_CHECK_DATABASE
is set, and optional uptime/node_version via HEALTH_DETAILED.

Co-authored-by: Cursor <[email protected]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 507dca3. Configure here.

Comment thread apps/api/src/lib/health.ts Resolved
@unjica
unjica merged commit f6d39c3 into develop Jul 9, 2026
4 checks passed
@unjica
unjica deleted the feat/234-health-metrics branch July 9, 2026 17:02
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.

API: health endpoint metrics for self-host monitoring

1 participant