Skip to content
gateweavehqPublic

About

Gateweave Cloud's status page: every service checked each minute, on Cloudflare Workers and D1

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Gateweave Status

A status page for the services your team runs, on your own Cloudflare account. One Worker checks each service you list every minute, keeps the results in D1, opens and closes incidents, emails an alert when a service goes down or turns slow and when it recovers, can file each incident as an issue in Track, and serves a public page with the last 90 days. There is no server and no database to look after. Add your services to wrangler.jsonc and deploy.

See it live: status.gateweave.com, Gateweave Cloud's own page, which runs this code.

Gateweave Status showing eight services and their check history

  • A check fetches a service's URL and expects a status (200 by default) within 10 seconds, and, where set, a piece of text in the body. A redirect counts as an answer, not something to follow. A failed check is tried once more after two seconds, so one dropped request is not an outage.
  • An incident starts with the first failed check of two in a row and ends with the first check that passes.
  • A slow spell is an incident of its own kind: a service that still answers, but took more than 3 seconds for five checks in a row. Three answers in time end it, and so does an outage, which then does the telling. On 2026-11-12 one of Gateweave's services took 3 to 6 seconds a page for ten minutes while every check passed; this is for that.
  • Alerts go by email through Email Service's binding to ALERT_TO. One that couldn't go is tried again each minute for three days, and an outage that ended before its alert went is told once.
  • The error watch catches what a health check can't: a page or API that broke while the service still answers. Every 15 minutes it asks Cloudflare's GraphQL analytics how often each watched host answered 5xx, each watched Worker had execution errors or response stream disconnects, and its Durable Objects had execution errors, over the 15 minutes that ended two minutes before. The next run reads the previous window again by minute, so analytics that arrive late still count, and count only in their own window. An object's stream disconnects aren't counted: its caller is one of our Workers, and the Agents SDK's MCP servers make one for every request they answer. It emails when the count and share reach minErrors and minShare. Execution errors, stream disconnects, and a spike that crosses the threshold only in combination each have their own six-hour quiet time. It needs ERROR_WATCH and the secret ANALYTICS_TOKEN: a token with Account Analytics Read on the account and Analytics Read on the zone. If the analytics can't be read, that is emailed too.
  • Track issues are the record of an incident. When one opens, the Worker files an issue in your Track workspace, and when it ends it adds one comment with the end time and the length. It never changes the issue's status: a person closes it with the cause. An outage is filed at once, a slow spell once it has lasted 15 minutes (priority high and medium). The incident keeps the issue's key, so it is filed once; the description carries status-incident:<id>, and a retry that may follow a lost answer looks for the issue by its title before making another. Filing comes after the alert and never holds it back or fails the run: a filing or comment that fails is tried again with a growing wait (a minute, up to half an hour), for three days, then given up and logged once. It needs the settings below. Incidents from before they were turned on are not filed.
  • Manual entries are posted to the signed /api/manual endpoint with the MANUAL_KEY secret: a manual incident makes its service down until it is ended, and a maintenance window is shown for its planned time without changing the health. Manual incidents alert as incidents do; maintenance windows do not, and neither is filed in Track.
  • The page shows each service's state, the last 90 days, and up to 20 incidents for configured services from the last 30 days or still open. It notes when more qualify. It loads nothing else and reloads every minute unless you pause auto-refresh. /api/status has the same data as JSON, with incidentTotal giving the number that qualify before the display cap.
  • What it keeps: each check for a week, each day's counts and the incidents for good. No answer's body is kept or shown, only its status and how long it took.

It runs on Cloudflare, like what it checks, so it can't report an outage of Cloudflare itself. It reports the failures of one product: a bad deploy, a broken database, an expired certificate. For the rest, point a monitor outside Cloudflare at /api/fresh: it answers 200 while the checks run and 503 once none has run for five minutes, to GET and HEAD alike, so the monitor learns both that the page is down and that the checks behind it stopped.

Running it

Requirements: Node.js 24 and pnpm 12.

Command Purpose
pnpm install Install dependencies
pnpm verify Lint, type-check and test, as CI does
pnpm dev Run it locally; --test-scheduled runs checks
pnpm run deploy Apply migrations, then deploy
pnpm run deploy:cloud Gateweave Cloud's cloud environment: apply migrations, then deploy

See architecture for how checks and incidents work, and self-hosting for running your own copy.

To deploy your own, follow self-hosting: create the database, replace the placeholders in wrangler.jsonc with your services, route and sender, then pnpm run deploy, which applies the migrations and deploys. The top level of wrangler.jsonc is that template. Gateweave Cloud's own page (status.gateweave.com) is the environment cloud of the same file, deployed with pnpm run deploy:cloud; the account comes from CLOUDFLARE_ACCOUNT_ID, and the file names no account or zone.

Filing incidents in Track is off until these are set, and nothing else changes without them:

Setting Kind What
TRACK_URL var Track's address, such as https://track.example.com
TRACK_WORKSPACE var The workspace's slug
TRACK_TEAM var The team the issues go to, such as WEB, unless a service names a team
TRACK_LABELS var Label names, comma-separated, such as Operations; they must exist
TRACK_KEY secret An agent member's key (gwt_ and 43 characters), made in Track's settings

Make the agent member in the workspace's settings, under Agents, and put its key in:

npx wrangler secret put TRACK_KEY

The agent is a member of the workspace like any other, so it needs no more than that. Set the variables in wrangler.jsonc. If only some of the four required settings are there, or one is wrong, nothing is filed and each run logs misconfigured. A label that doesn't exist makes Track refuse the issue, which is retried until it is given up. The Worker talks to Track's /mcp with plain JSON-RPC (tools/call for create_issue, search_issues and add_comment) and never logs the key or what Track answered.

The sender's domain must be set up for Email Sending. A service on a Custom Domain in the same zone can be checked; one on a route can't be fetched from a Worker on that zone.

License

AGPL-3.0.

About

Gateweave Cloud's status page: every service checked each minute, on Cloudflare Workers and D1

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages