---
title: "How to Monitor a Fly.io App: Health Checks, Alerts and Cron Jobs"
description: "Fly health checks stop routing to a bad Machine but don't restart it or alert you. What to add for uptime alerts, cron job heartbeats and private services."
url: "https://www.upti.my/blog/fly-io-app-monitoring"
---

Infrastructure·November 23, 2026·8 min read

# How to Monitor a Fly.io App: Health Checks, Alerts and Cron Jobs

Fly health checks stop routing to a bad Machine but don't restart it or alert you. What to add for uptime alerts, cron job heartbeats and private services.

✅

Short answer

-   **Fly's health checks route around problems.** A Machine that fails its service check stops getting traffic, but Fly doesn't restart it and doesn't alert you.
-   **Restarts only follow a process exit.** A hung process that never exits is never restarted. With one Machine, that's your app down until someone notices.
-   **What to add:** an [external uptime check](https://www.upti.my/uptime-monitoring) on your public hostname, a [heartbeat](https://www.upti.my/api-monitoring/cron-jobs) for each scheduled job, and alerts that reach a person. Fly's docs say it has no built-in alerting.

Fly.io gives you a lot of control: Machines in the regions you pick, a proxy in front of them, health checks, restart policies and a Prometheus endpoint with a Grafana instance. What it doesn't give you is someone to tell when things go wrong. That part is yours to set up, and it's smaller than it sounds.

## What Fly's health checks do, and what they don't

You define checks in `fly.toml`. For an HTTP service:

fly.toml

```toml
[[http_service.checks]]
  grace_period = "10s"
  interval = "30s"
  method = "GET"
  timeout = "5s"
  path = "/healthz"
```

According to Fly's [health check docs](https://fly.io/docs/reference/health-checks/), a Machine that fails a service check is marked unhealthy by Fly Proxy and gets no requests until it passes again. That's useful: with several Machines, users are routed to the healthy ones.

The same docs are explicit about the limit: failing health checks don't restart or stop the Machine. That has to be done by hand. Two more details from the [configuration reference](https://fly.io/docs/reference/configuration/) matter for monitoring:

-   **Checks run over Fly's private network,** against the service on the Machine, not against your public `appname.fly.dev` hostname. A broken certificate, a DNS change or a problem between users and Fly's edge won't show up in them.
-   **Top-level `[checks]` don't affect routing** at all. Fly describes them as being for your own monitoring and alerting, which you then have to build.

Machine checks (`machine_checks`) are different: they run a command in a temporary Machine during rolling and canary deploys, and stop the deploy if it fails. That protects deploys, not the running app.

## Restart policies react to exits, not hangs

Fly's [restart policy](https://fly.io/docs/machines/guides-examples/machine-restart-policy/) decides what happens when a Machine's main process exits. Machines created by `fly deploy` default to restarting on a non-zero exit, up to 10 times in five minutes. You can set it in `fly.toml`:

fly.toml

```toml
[[restart]]
  policy = "on-failure"   # or "always", "never"
  retries = 10
```

That covers crashes. It doesn't cover the failures that keep a process alive: a deadlocked event loop, a connection pool stuck on a dead database, memory pressure that makes every request time out. The process never exits, so nothing restarts it, and the health check only takes it out of rotation. If it's your only Machine, or every Machine hits the same bug, the app is down and Fly is behaving exactly as documented.

## Fly doesn't alert you

Fly's [metrics documentation](https://fly.io/docs/monitoring/metrics/) says it directly: there's no built-in alerting on metrics. You get a Prometheus endpoint (about 15 days of retention) and a managed Grafana at fly-metrics.net, and the suggested options are Grafana alert rules or your own Prometheus and Alertmanager. Series such as `fly_instance_exit_oom` are worth alerting on there.

That's a reasonable path if you already run Grafana alerting. If you don't, the shortest route to "someone gets told when the app is down" is a check from outside Fly.

## Check the public hostname from outside

An external uptime check requests the same URL your users do, from outside Fly's network, so it sees what they see: certificate, DNS, Fly's edge, the proxy and your app. Point it at a health endpoint that does real work (opens a database connection, reads a row) rather than one that only returns 200:

-   **URL:** your custom domain, or `https://appname.fly.dev/healthz`.
-   **Assertions:** status 200, plus a keyword in the body such as `"db":"ok"`, so a maintenance page or an error page served with 200 still fails.
-   **Regions:** check from more than one, and only alert when more than one agrees. Fly runs your app in the regions you pick, and a single probe location can't tell a regional network problem from an outage.

In Uptimy that's one HTTP check. Paid plans check every 15 to 60 seconds from up to six regions; the free plan checks every five minutes from two.

💡

When Fly itself has an incident

Some outages aren't yours. The [Fly.io status page](https://www.upti.my/status/fly-io) on Uptimy tracks Fly's platform status, so you can tell a platform incident from your own bug in a few seconds.

## Cron jobs: a heartbeat per job

Fly's [task scheduling guide](https://fly.io/docs/blueprints/task-scheduling/) lists several ways to run scheduled work: Cron Manager, which starts a Machine per job; Supercronic, a crontab inside your app; scheduled Machines, which run hourly, daily, weekly or monthly with no exact time; and in-app schedulers. None of them tells you when a run didn't happen or didn't finish.

A heartbeat does: the job pings a URL when it succeeds, and you get an alert when the ping doesn't arrive on schedule. Store the ping URL as a secret:

Terminal

```bash
fly secrets set UPTIMY_HEARTBEAT_URL="https://ping.upti.my/<your-token>"
```

### With Supercronic

Fly's guide runs Supercronic as its own process group in `fly.toml` and scales it to exactly one Machine. Add the ping to each crontab line, after the job, with `&&` so it only fires on success:

/app/crontab

```bash
# nightly report at 03:17 UTC; ping only if it succeeded
17 3 * * * /app/bin/nightly-report && curl -fsS -m 10 --retry 3 "$UPTIMY_HEARTBEAT_URL"
```

In Uptimy, set the heartbeat's schedule to _Cron_ with the same expression, in UTC, and a grace period a bit longer than the job usually takes. If the cron process stops, gets scaled to zero, or the job fails, the ping doesn't come and you're alerted.

### With scheduled Machines or Cron Manager

Make the ping the last command the Machine runs:

bin/run-job

```bash
#!/bin/sh
set -e
/app/bin/cleanup
curl -fsS -m 10 --retry 3 "$UPTIMY_HEARTBEAT_URL"
```

Scheduled Machines only promise a bucket such as "daily", not a time, so use an _Every_ schedule on the heartbeat (one day) with a generous grace period, rather than a cron expression. A job that needs to run at a precise time is better on Cron Manager or Supercronic.

## Private services: check them from inside your organization

Apps in the same Fly organization share a [private network](https://fly.io/docs/networking/private-networking/), and each app gets an `appname.internal` address. Internal APIs, workers with a health port, Postgres and Redis can be reachable there without being public, which also means an external check can't see them.

The open-source [Uptimy Agent](https://www.upti.my/agent) runs anywhere Docker runs, so it can be deployed as its own small Fly app in the same organization and check those addresses from inside: HTTP, TCP, Postgres and Redis. Connected to Uptimy Cloud, it becomes a private location in your workspace, and Cloud alerts you if the agent itself goes quiet. One requirement from Fly's docs: a service has to listen on `fly-local-6pn` (its private IPv6 address) to be reachable over the private network.

## Where the alerts go

Checks only help if someone acts on them. Route them by what broke: a failed public check or a down database goes to whoever is on call; a late nightly report can wait for Slack in the morning. [Alert routing](https://www.upti.my/alert-routing) handles that split, and an incident on a public check can update your [status page](https://www.upti.my/status-pages) so customers aren't left guessing.

## A setup checklist

1.  Add `[[http_service.checks]]` on a real health endpoint, so Fly routes around a bad Machine.
2.  Run at least two Machines for anything customer-facing, so routing around one still leaves a working app.
3.  Add an external HTTP check on the public URL, with a keyword assertion, from more than one region.
4.  Add a heartbeat to every scheduled job, pinging only on success.
5.  For private services, deploy the Agent into the same organization and check their `.internal` addresses.
6.  Send alerts to a person, with routing by severity.

### 📌Key Takeaways

-   1A failing Fly health check takes the Machine out of rotation but never restarts it or alerts anyone
-   2Restart policies fire on process exit; a hung process is never restarted
-   3Fly's own checks run over the private network, so they don't see certificate, DNS or edge problems
-   4Fly has no built-in alerting: use Grafana alerting, or an external check that alerts for you
-   5Give every scheduled job a heartbeat that pings only on success
-   6Check private .internal services from inside the organization, for example with the Uptimy Agent

Fly is doing its job when it routes around a bad Machine. The job left over is telling a person, and that takes one external check, one heartbeat per job, and somewhere for the alerts to go.
