Skip to content

Have /health report the services behind the site - #302

Merged
adamjohnwright merged 1 commit into
mainfrom
feat/aggregate-health
Sep 25, 2026
Merged

adamjohnwright merged 1 commit into
mainfrom
feat/aggregate-health

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Every deployment fault on this box has had one shape: something merged, something else kept running the version from before it, and nothing said so. Three times in one day, the last a live 404 — an nginx route added to content-node while content-node still ran the image built before those endpoints existed.

Each service already answered its own health check. Nobody polls three URLs, so the drift was only ever found by someone tripping over it.

What it reports now

"services": {
  "content-node": { "up": true, "build": "8e87ba1d", "release": "97", "endpoints": 12 },
  "render":       { "up": true, "build": "d4b04cde" },
  "mcp":          { "up": true, "build": "1.4.0" }
}

Not just that each answered — what each one is. Two services disagreeing about the release is the thing worth seeing, and it is invisible when all you have is a green tick each. endpoints: 12 is exactly what would have shown yesterday's stale content-node at a glance: it was serving 10.

ok stays the site's answer

The site renders without the render service. A monitor asking "is the website up" must not be told no because a sibling is down — that pages somebody for the wrong thing. What is wrong is named in services.

Cost

Asked in parallel with a 2s budget. A service being down is a fact, not an error: 11ms with everything up, 11ms with mcp stopped (measured by stopping the container).

The addresses are overridable, and that is what made it testable

On this box those services are genuinely running, so a test asserting "down" would have been green in CI and red locally, for a reason unrelated to the code. The spec points them at a closed port and asserts each reports its own state while the site stays ok.

457 tests green; lint 652 and dead-code 145 unchanged from baseline.

🤖 Generated with Claude Code

Every deployment fault on this box has had one shape: something merged,
something else kept running the version from before it, and nothing said so.
Three times in a day, the last one a live 404 -- an nginx route added to
content-node while content-node still ran the image built before those
endpoints existed.

Each service already answered its own health check. Nobody polls three URLs, so
the drift was only ever found by someone tripping over it. `/health` now asks
them and reports what each one *is*: the build it is running, the release it
holds, how many endpoints it serves. Two services disagreeing about the release
is the thing worth seeing, and it is invisible when all you have is a green
tick each.

    "services": {
      "content-node": { "up": true, "build": "8e87ba1d", "release": "97", "endpoints": 12 },
      "render":       { "up": true, "build": "d4b04cde" },
      "mcp":          { "up": true, "build": "1.4.0" }
    }

`ok` stays the *site's* answer and not the estate's. The site renders without
the render service, so a monitor asking "is the website up" must not be told no
because a sibling is down -- that pages somebody for the wrong thing. What is
wrong is named in `services`.

Asked in parallel with a two-second budget, and a service that is down is a
fact rather than an error: measured at 11ms with everything up, and 11ms with
mcp stopped.

The addresses are overridable rather than hardcoded. That is what makes the
case worth testing testable -- on this box those services are genuinely
running, so a test asserting "down" would have been green in CI and red
locally, for a reason unrelated to the code. The spec points them at a closed
port and asserts each reports its own state while the site stays ok.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit ba72c2e into main Sep 25, 2026
6 checks passed
@adamjohnwright
adamjohnwright deleted the feat/aggregate-health branch September 25, 2026 13:20
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.

1 participant