feat: add estate-standard /health endpoint - #174
Merged
Conversation
Adopt @agentage/observability/health so admin.agentage.io can probe this service; promote COMMIT_SHA/BUILD_TIME to runtime ENV in the Dockerfile runner stage and point the Swarm healthcheck at /health.
|
🎉 PR Validation ✅ PASSED Commit: Checks:
Visual Changes: 8 of 8 screenshots changed 📸 contacts desktop — 100% changed📸 contacts mobile — 100% changed📸 home desktop — 100% changed📸 home mobile — 100% changed📸 interests desktop — 100% changed📸 interests mobile — 100% changed📸 projects desktop — 100% changed📸 projects mobile — 100% changedReady to merge! ✨ 🔗 View workflow run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the estate-standard
/healthcontract (/home/vreshch/vaults/agentage/specs/health-endpoints.md) to vreshch.com. Todayhttps://vreshch.com/health404s; without it, admin.agentage.io can only show "No probe" for this service.@agentage/observability^0.6.1->^0.8.0(already a dependency for OTEL tracing via/next; this adds the/healthsubpath, which is dependency-free - no OpenTelemetry pulled into the route).src/app/health/route.ts-export const dynamic = 'force-dynamic'+healthResponse(), per the Next.js profile in the spec (SSR shell, no downstream dependency checks).Dockerfile- runner stage now redeclaresARG COMMIT_SHA/BUILD_TIMEand promotes them toENV, since ARGs don't cross stage boundaries and the envelope reads build provenance from runtime env vars. Without this it would report0.0.0-dev/devforever.docker-compose.yml- Swarm healthcheck now spiders/healthinstead of/(see judgement call below).Judgement calls
serviceparam. The route callshealthResponse()with no override..github/workflows/deploy.ymlwritesOTEL_SERVICE_NAME=vreshch-webinto the runtime.env(consumed viadocker-compose.yml'senv_file: .env), and the kit'sresolveServiceNamedefaults toOTEL_SERVICE_NAME. Confirmed this end-to-end with a local container run:-e OTEL_SERVICE_NAME=vreshch-webproduces"service": "vreshch-web"; without it,"service": "unknown"(loud on purpose, per the kit's docstring). This is deliberate: it keeps the healthserviceand the OTELservice.nameequal by construction instead of by two hand-typed strings drifting apart, which is the exact defect (H hand-typed mismatch) the spec calls out in 9 of 10 services today. Trade-off: a container run outside this deploy pipeline (e.g. localdocker runwithout the prod.env) will reportservice: "unknown"rather thanvreshch-web- acceptable since this repo has no preview environment (direct-to-prod).docker-compose.ymlhealthcheck moved from/to/health. Recommended and made the change:/renders the full homepage (blog list, images) so a content-only regression or a slow render can flap the Swarm health state for reasons unrelated to "is the process alive";/healthis the minimal, stable, estate-standard surface built for exactly this and won't shift when the homepage changes. Also lines up the container's own healthcheck with what admin.agentage.io will be probing externally.Verification
npm run verify(type-check + lint + build + test) - green,/healthbuilds asƒ(dynamic).npm run format:check- green (separate CI step, not part ofverifyin this repo).--build-arg COMMIT_SHA=testsha1234567890 --build-arg BRANCH=feature/health-endpoint --build-arg BUILD_TIME=2026-08-09T12:00:00Z, ran it, and curled/health:{ "success": true, "data": { "status": "ok", "service": "unknown", "version": "testsha1234567890", "commit": "testsha", "buildTime": "2026-08-09T12:00:00Z", "startedAt": "2026-08-09T14:34:12.819Z", "uptimeSeconds": 7 } }commitis 7 chars,versionis the full sha,buildTimeround-trips - confirms the Dockerfile ARG-to-ENV promotion works.servicereadsunknownhere because this ad-hocdocker rundidn't setOTEL_SERVICE_NAME(not baked into the image, only written to the server's.envby the deploy job). Re-ran with-e OTEL_SERVICE_NAME=vreshch-weband got"service": "vreshch-web", matching what prod will report.src/app/health/route.test.ts(Vitest) asserting 200,success: true,data.service === 'vreshch-web',data.status === 'ok'(stubsOTEL_SERVICE_NAMEto mirror the prod runtime env).Test plan
pr-validation.ymlincluding the separate Format check step)curl https://vreshch.com/healthreturns the envelope withservice: "vreshch-web"and realcommit/buildTime