Language

Health probe and operations readings

What tiers /healthz has, why pending does not change the status code, why failure originals live only in the log, and which address to go to for metrics.

/healthz is the only address on this machine that answers the outside question "what state am I in right now". It is short, but it has three states, and the three-state thing is often misread by monitoring ends.

What the tiers are. On a freshly installed instance serving normally, the checks in the response are these seven: kernel, database, storage, migrations, plugins, console, and the certificate module's own tier misi.certificates. Plus the ok boolean and the HTTP status code above them. Exactly which items appear on your machine depends on which plugins are installed, so do not hard-code a name list into your alert rules — iterate over the returned keys.

pending is not failure. Only failed turns ok into false and pushes the status code to 503; pending changes neither ok nor the status code. This distinction is not formatting; it is two completely opposite operations actions:

  • The certificate tier is pending while the first certificate is being requested, or when the renewal window has been entered but the current certificate is still valid. The site has no problem then, and treating it as "failure" reports a normal issuance as an incident.
  • migrations is pending when "the ledger has some version rows already applied that the current binary no longer declares". This is a common and normal shape after upgrading an old store, and the site keeps serving. Reading it as "upgrade failed" would lead people to roll back a version that was fine; reading it as "no problem" would miss a genuinely missing structure — so this tier's original text lives only in the startup log, and the criterion must combine it with whether the specific interface answers.
  • console is also pending when the backend artifacts are missing or the mount point was taken by another process, deliberately not reporting failed: the administration entry cannot be reached, yet the site is still serving visitors at that moment. Reporting it as failed would make monitoring say "backend unreachable" as "the site is down".

The response body carries only state words. Paths, SQL, data-source strings and original backend error text do not enter this response; failure reasons are written in the log. So do not expect the probe to tell you why; it only tells you which tier is off — the original words are found in the startup log, which clearly distinguishes "this build has no backend artifacts" from "the mount point is occupied", two causes with opposite fixes.

Every tier finishes computing before it answers. The old style of returning at the first failure hands back a partial list that varies with ordering: the tiers after the fault were never looked at. Now all checks run concurrently, each with its own timeout, pinned inside a fixed window overall, so long-term polling at the 10-second level is fine; a panic inside one check is also contained into that tier's failure instead of taking the process down.

It does not touch disk, so "can answer" is not "everything is healthy". The kernel tiers ask about registration state, the migration ledger, database and storage availability — things whose answers are already in memory. A full disk, drifted upload-directory permissions, backlogged derived images: these are not reported here but in the operations readings.

For numbers, go to another address. Diagnostic metrics (HTTP latency distribution, connection-pool waiting, request-protection bucket-overflow counts) live at /api/v1/ops/metrics; the four operation metric blocks at the bottom of the backend workbench pull from it. The process-and-site statistics at the top of the workbench go through another read-only interface, pulled every 10 seconds. These three surfaces each have their own readers; do not use the probe as a metrics endpoint, and do not use metrics as a liveness criterion.

The minimal workable advice for external monitoring: use the status code as the primary criterion (200 means serving), report per-tier failed separately, and only record pending without alerting — but also write in the docs which tiers are allowed to be pending long-term, otherwise nobody remembers in half a year why it has always been yellow.