Fly.io Machines: stopped machines, failing health checks and lost hosts as signals
Point a Pulso HTTP source at Fly.io's Machines API and turn machines that stopped, fail their health checks or sit on an unreachable host into signals, with a playbook for each.
Fly.io runs an app as Machines, and its Machines API lists them with their state, their health checks and the state of the host under them. Fly sends no webhook when one of them goes wrong, so Pulso asks instead: an HTTP source calls the API every five minutes, and each machine in the answer is a row the monitors filter.
Connect Fly.io#
Add Fly.io to Pulso to create an HTTP source called Fly.io Machines API: it asks for the app’s name and a token, and keeps them in a connection of the same name that calls https://api.machines.dev/v1/apps/<app> with the token in its Authorization header, kept encrypted. It then creates the monitors below that you pick, with their playbooks and a report. Once the account has a Fly.io connection, the form offers it under Connection, so a source added again calls through it without asking for the app or the token. A connection can also be made first, from New connection with Fly.io picked. To start from scratch instead, create a connection with that base URL and the header Authorization: <token>, and an HTTP data source on it.
- Create a read-only token for the organization that holds the app:
fly tokens create readonly --org <org> --expiry 8760h. It changes nothing, but it can read every app in the organization, as Fly has no read-only token for a single app; Pulso only calls the app you name. - Paste all it prints, starting with
FlyV1, as the API token, and the app’s name as App name. - Open a monitor and click Run under its request: the answer lists the app’s machines, one row each.
To watch another app, add the integration again with a new connection: each app gets its own connection, source and monitors, and the app’s name is in their signals’ titles and playbooks. The connection keeps the app’s name it was added with, so editing its base URL later doesn’t rename what the monitors say.
What arrives#
GET /apps/{app}/machines answers a list with one object per machine. Pulso makes each one a row and flattens the objects inside it, so the process group is config.metadata.fly_process_group. A machine, trimmed:
{
"id": "e286de4f711e86",
"name": "holy-sun-1234",
"state": "started",
"region": "cdg",
"host_status": "ok",
"updated_at": "2026-11-29T14:32:20Z",
"config": {
"metadata": { "fly_process_group": "web" }
},
"checks": [
{ "name": "servicecheck-00-http-8080", "status": "passing", "output": "Success" }
],
"events": [
{ "type": "start", "status": "started", "source": "flyd", "timestamp": 1795958540000 }
]
}
A machine at rest is created, started, stopped, suspended or archived, and failed when it couldn’t start. On its way between them it is starting, stopping, restarting, updating, replacing and the like, all ending in -ing, and launch_failed when a launch failed and it is about to be destroyed. host_status is ok, unknown or unreachable.
Monitors to build#
Machines not running#
- Request:
GET /machineson the source’s base URL, every 5 minutes. - Filters:
statedoesn’t containingand isn’tstarted,created,suspended,archived,replaced,migratedordestroyed, which leavesstopped,failedandlaunch_failed; andconfig.standbysdoesn’t contain", which leaves out a standby: it waits stopped on purpose, and only a standby has that column, the list of machines it stands in for. Filters must all match, so the states to leave out are listed one by one. For an app whose machines stop on their own when idle (auto_stop_machines), addstatenot equal tostopped, or every quiet hour raises a signal. - Uniq by:
idandupdated_at, so each time a machine changes is one signal, and a machine that stays stopped isn’t a new one every five minutes. - Playbook: a task to read the machine’s status and logs, with
{{signal.id}}and the app’s name in the commands, and one to start it again or roll back.
Failing health checks#
- Filters:
stateequalsstarted,checkscontainscritical. - Uniq by:
idandchecks. Each check keeps the time its status last changed, so every time one goes critical is a new signal; the machine’s ownupdated_atmoves only with its events, not with its checks. - Playbook: a task to read the checks’ output with
fly checks list, and one to restart the machine if it doesn’t recover.
Hosts Fly can’t reach#
- Filters:
host_statusnot equal took. - Uniq by:
idandupdated_at. - Playbook: a task to check Fly’s status page for the region in
{{signal.region}}, and one to clone the machine onto another host if it lasts.
Limits#
- Lists stay whole.
checksandeventsare lists, kept in one column each;containsfinds a word in them, so a check’s output that happens to say “critical” counts too. - A machine that hangs looks fine. A machine whose process froze but didn’t exit stays
started, with its hostok. Only a health check that calls it, or a heartbeat monitor on something it does every few minutes, notices; give every process group a check that does real work. - Watching the app that runs Pulso. Only for a self-hosted install on Fly.io: its monitors can’t watch the machines that run it, because if those stop, so do the monitors. Pulso’s hosted service runs elsewhere, so it can watch any of your apps.
- Rate limits. The Machines API allows about one request per second per action, plenty for a few monitors every five minutes.
Sources: Fly.io’s Machines API, its machines resource and machine states docs, and fly tokens create readonly.
Add Fly.io to Pulso: an HTTP source with the connection that calls its API, 3 monitors with their playbooks and a report, then the settings it asks for.
- Fly Machines not running
- Fly Machines failing health checks
- Fly Machines on an unreachable host
- Report: Fly.io