How Fleet checks a site's health

Fleet reads two public addresses of every site every 5 minutes and shows the result as a label and an observation.

What it is

Fleet decides a site's health from what the site answers on two public addresses. The health ring on a site tile shows the result, and the site page shows the observation behind it. Fleet installs nothing on the site, and no Fleet code runs on a site.

How it works in Fleet

What Fleet reads. Every 5 minutes Fleet requests two addresses of each site:

  • GET /_emdash/api/health: the product, the EmDash version and whether the plugin registry is on.
  • GET /_emdash/api/setup/status: whether EmDash still needs its first setup.

The request goes to the site's workers.dev address or a custom domain. It carries the header User-Agent: EmDashFleet-HealthPoller/1, no cookie and no credential. Fleet never follows a redirect, reads at most 2 KB and waits 10 seconds for the answer. Once an hour it also reads the Worker's settings from the connected Cloudflare account, to find a resource deleted outside Fleet.

What it shows. The labels are Awaiting first check, Healthy, Needs attention and Down. Needs attention comes with one or more of these observations. A site shows Update available instead when that is its observation:

  • Setup not finished: EmDash still asks for its first setup.
  • Migration did not finish: the site answered 503 for 60 minutes while its migrations ran.
  • Site error <status>: the site answered with a server error, and the status is its number.
  • Health check blocked: a challenge page, a 403 or 429 without a JSON body, or a redirect (a Cloudflare Access login sends one) came back. Fleet could not read the health. The hint is Allow requests from Fleet's health check in your firewall. The site did answer, so this never counts towards Down. See Allow health checks behind Access or a WAF.
  • Fleet could not read the site's health response: the answer had an unexpected shape.
  • Health check refused: Fleet does not send requests to this kind of address. The note says "Use the site's workers.dev address or a custom domain attached to this Worker".
  • Update available: the site answers and a newer stable EmDash release exists. It never counts towards Down.
  • Site admin connection expired: the optional site admin connection needs approval again.
  • Plugin update available: a plugin has a newer version.

A site shows Down after three reads in a row that end in a connection failure, the 10-second timeout or a server error other than the 503 of a running migration. The reads are 5 minutes apart, so this takes about 15 minutes.

When Fleet cannot run a check, the site keeps its label and the page shows the note "Fleet could not run the last check". The note is about Fleet, not the site.

What the site page shows. The Health section lists Last check with its time and age, Answer (for example OK (200), Error (503) or No answer), Response time, Why it is down when the label is Down, and What Fleet found for the observation. A row of the last 30 days shows how many checks failed each day. When the last check is more than 30 minutes old, a banner says: "This check is out of date. Fleet checks every 5 minutes. Reload the page, and contact support if it stays this old."

What it cannot show. A green ring means the Worker answers. The health route of EmDash answers with the product name, the EmDash version and the registry setting, and its code reads nothing from the database, the storage or the plugins (source). Fleet makes no check of the encryption key, the scheduler or the storage. Open the site and its EmDash admin to confirm that content loads. Plugins and update status come from the optional site admin connection or, without it, from the site's repository.

Rules and limits

  • A site that Fleet has not yet read shows Awaiting first check. The first read runs within 5 minutes of the first deploy or the link.
  • Fleet sends no email for a health change. The Activity view of the Logs tab records each change.
  • Fleet reads these two public addresses only and never opens a page that needs a sign-in.
  • Fleet requests only a hostname that belongs to the site and refuses an address written as numbers.
  • Every status is in Site statuses and health and the status reference.

Related how-tos

Report a problem with this page