Your health check isn't evidence your deploy worked
Jordan Owens ·
I'm building DeployAngel, which watches each Rails deploy in production and decides when it's safe to stop watching it. It runs on itself, and on its second day its own releases started clearing at High confidence, 17 minutes after each deploy. That felt good until I looked at what the clearances rested on.
The clearance report said "2 of 2 routes ran." One was the agent's telemetry endpoint. The other was GET /up.
What I found
DeployAngel runs on DigitalOcean App Platform, which checks /up about every 10 seconds to decide whether to send the container traffic. Over one day that came to 8,689 health-check requests, against a few hundred for the dashboard pages people actually use.
So when a release had been live for 17 minutes and had served 119 requests, most of those were the platform asking "are you up?" and getting "yes." None of the pages a person uses had to run for the release to clear at High confidence. If I'd shipped a broken dashboard, the health check would have kept answering 200, and the numbers would have looked fine.
What /up actually tells you
Every Rails app generated since 7.1 has this route:
get "up" => "rails/health#show", as: :rails_health_check
Rails::HealthController returns 200 if the app booted without raising, and 500 if it didn't. It doesn't touch the database, Redis, your job queue, or any page you've written. That's exactly what a load balancer needs: is this process ready to take traffic? It's not an answer to "did this release work?"
The trouble is that it's often the busiest route in a small app, and it's always fast and always successful. Anything that measures your app as a whole counts it unless you tell it not to.
Three ways it hides a bad release
It meets your minimums. Any check that waits for "enough traffic" before judging a release gets there quickly when a load balancer is generating six requests a minute per instance. The release looks well exercised when nothing a user touches has run.
It dilutes your error rate. Say a release breaks one page, and 10 of the next day's 1,000 real requests fail. That's a 1% error rate, which an alert set at 1% would catch. Add a day of health checks at my app's rate, about 8,700, and the app-wide rate is about 0.1%, which it won't.
It drags your p95 down. If 90% of your requests are 2 ms health checks, your app-wide p95 isn't the 95th percentile of anything a user sees. The health checks fill the fastest 90%, so the top 5% of all requests is the slower half of your real ones: the "p95" on your dashboard is your real pages' median. A release that doubles the time of your slowest pages barely moves it.
There's a fourth, smaller version of the same problem: bots. Over the last day DeployAngel got 175 requests that matched no route, for things like /wp-admin and .env. They're answered with a fast 404 and they pad the request count and pull latency down the same way.
What to do about it, whatever you use
- Find out how much of your traffic is health checks. Group a day of request logs by path. If
/up(or/health,/healthz,/ping) is near the top, everything app-wide is skewed. - Leave health checks out of release metrics and alerts. Most APM and error-tracking tools can ignore a transaction by name or path. Ignore your health check there. Keep unrouted 404s out of the error rate and latency too, but don't throw them away: a link you broke or a route you renamed by mistake shows up there first.
- Compare route by route, not app-wide. A per-route error rate and p95, compared with the previous release, can't be diluted by a route you didn't change.
- Fix the history, not just the future. If you start excluding health checks today, your baseline from last week is still full of 2 ms requests, and today's release will look slower by comparison. Compare like with like.
- If your app is quiet, make some evidence. A smoke test against production after each deploy, one that signs in and loads a few real pages, tells you more than a day of health checks.
- Keep the health check. Your load balancer needs it. It just shouldn't vote on whether a release worked.
What changed in DeployAngel
The agent no longer records health checks at all. It recognizes Rails' /up wherever it's mounted, the OkComputer, health_check, and rails-healthcheck gems, and a lambda or Rack app at a conventional path such as /healthz. A health check served by your own controller can be listed:
DeployAngel.configure do |config| config.ignored_routes = [ "GET /healthz" ] end
Requests no route matched are still recorded, but an unrouted 4xx no longer counts toward the app's request count, error rate, or latency. An unrouted 5xx still counts, since something broke. The server also drops /up from older agents, and I rewrote the telemetry already stored, so baselines and new releases are measured the same way.
Here are two releases of the same app, one from just before the fix and one from after it, each at the moment it cleared, 17 minutes after rollout. They're different releases about three hours apart, which is why the job counts differ slightly. The request count is the difference that matters.
| Before the fix | After the fix | |
|---|---|---|
| Routes counted | Before: 2 of 2: /up and the telemetry API | After: 1 of 1: the telemetry API |
| Requests | Before: 119 | After: 49 |
| Job runs | Before: 186 | After: 184 |
| Confidence | Before: High | After: Medium |
Without the health checks, the release had 49 real requests in 17 minutes. That's too few to rule out a small rise in errors, so it cleared on DeployAngel's small-app rule instead: the routes the app normally serves (here, just one) each ran at least three times, with no errors. That rule never gives more than Medium confidence. High, before the fix, was a health check talking.
Why "1 of 1" and not "1 of 10, dashboard missing"? Coverage counts the routes the app normally serves at that time: the ones that, over the last two weeks at the same hour on similar days, would get at least five requests in the window being checked. On a quiet dashboard, no page does, so none is expected, and removing /up doesn't hide anything that was counted before. It only stops a health check from passing as a page. The dashboard pages are checked in other ways:
- A page whose code changed in the release, and that hasn't run yet, is listed on the report as changed but not yet exercised.
- Rarely used routes are watched for up to 30 days, and you're alerted if one fails the first time it runs on the release.
- Pages that must have run before anything clears, like sign-in, can be named as critical flows, and the app can require them for clearance. DeployAngel's own app names sign-in but doesn't require it, which is why this release could clear before anyone signed in, and its report says sign-in wasn't exercised.
The general lesson I keep relearning while building this: a verdict is only as good as what it's counting, so it should always say what it counted.
About DeployAngel
DeployAngel verifies each deploy of a Ruby, Python, or .NET app in production. A small agent reports aggregated telemetry once a minute, and each release is compared with the last healthy one and given a verdict: cleared, failed, or not cleared yet, with what it rests on. CI and coding agents can wait for that verdict through a CLI or an MCP server. It's free during the beta.