DEV Community

Vigilmon
Vigilmon

Posted on

How to Monitor Your Fly.io Application with Vigilmon

How to Monitor Your Fly.io Application with Vigilmon

Fly.io is a popular platform for deploying containers close to your users. It handles networking, TLS, and deployment — but you still need to monitor whether your app is actually up and responding. Here's how to set up production monitoring for your Fly.io app with Vigilmon.

What Fly.io Provides vs. What You Still Need

Fly.io gives you:

  • Automatic TLS certificates (via Let's Encrypt)
  • Health checks for instance restart (but not external alerting)
  • Deployment rollouts
  • Multi-region deployment

What Fly.io does NOT give you:

  • External uptime monitoring with alerts — if your app crashes and restarts slowly, users experience downtime; Fly's internal health checks restart the machine but don't alert your team
  • Response time tracking across regions
  • SSL expiry warnings (Let's Encrypt auto-renews but can fail)
  • Heartbeat monitoring for background jobs
  • Incident history for SLA reporting

Vigilmon fills these gaps.

Step 1: Add a Health Endpoint

Fly.io already uses health checks for traffic routing. Make a public endpoint that Vigilmon can check:

Go:

http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
    w.WriteHeader(http.StatusOK)
    w.Write([]byte("OK"))
})
Enter fullscreen mode Exit fullscreen mode

Node.js:

app.get('/health', (req, res) => res.json({ status: 'ok' }));
Enter fullscreen mode Exit fullscreen mode

Python (FastAPI):

@app.get("/health")
def health():
    return {"status": "ok"}
Enter fullscreen mode Exit fullscreen mode

Rust (Axum):

async fn health() -> &'static str { "OK" }
Enter fullscreen mode Exit fullscreen mode

Step 2: Configure Fly Health Checks (fly.toml)

For Fly.io's own traffic routing, make sure your fly.toml has health checks configured:

[[services.http_checks]]
  interval = "10s"
  timeout = "2s"
  grace_period = "5s"
  method = "GET"
  path = "/health"
  protocol = "http"
  tls_skip_verify = false
Enter fullscreen mode Exit fullscreen mode

This tells Fly to route traffic away from unhealthy instances. But it doesn't alert your team — that's Vigilmon's job.

Step 3: Set Up Vigilmon

  1. Create an account at vigilmon.online
  2. Click New MonitorHTTP Monitor
  3. URL: https://yourapp.fly.dev/health (or your custom domain)
  4. Check interval: 1 minute
  5. Expected Status: 200
  6. Add alert channels (email, Slack, PagerDuty)
  7. Save

Step 4: SSL Certificate Monitoring

Fly.io auto-renews Let's Encrypt certs, but renewals can fail. Add SSL monitoring as a safety net:

  1. New Monitor → SSL Certificate
  2. Domain: yourapp.fly.dev (or your custom domain)
  3. Alert threshold: 30 days before expiry

Let's Encrypt certificates expire every 90 days. If auto-renewal fails, you'll know 30 days early.

Step 5: Monitor Fly Machines (Multi-Region)

If you run Fly.io machines in multiple regions (e.g., iad, lhr, sin), Vigilmon's multi-region monitoring catches regional problems:

  • Your iad machine is up but lhr is down
  • A specific Fly region has network issues
  • One machine is restarting due to crashes

Vigilmon checks from multiple locations simultaneously — if your EU users can't reach lhr but US users are fine, you'll know immediately.

Step 6: Heartbeat Monitoring for Fly Workers

If you run background workers on Fly.io (Fly Machines in worker mode, cron jobs via Fly's scheduler), add heartbeat monitors:

In Vigilmon, create a Heartbeat Monitor and get a ping URL. In your worker:

Go:

func runJob() {
    // ... job logic ...

    // Ping Vigilmon
    http.Get("https://vigilmon.online/ping/your-heartbeat-id")
}
Enter fullscreen mode Exit fullscreen mode

Node.js:

async function runJob() {
    // ... job logic ...
    await fetch('https://vigilmon.online/ping/your-heartbeat-id');
}
Enter fullscreen mode Exit fullscreen mode

Step 7: Monitor Your Fly Postgres Cluster

If you use Fly Postgres, add a monitor that checks your app's database-dependent endpoint:

GET https://yourapp.fly.dev/api/status
Expected: 200 with {"database":"ok"}
Enter fullscreen mode Exit fullscreen mode

If your Fly Postgres cluster has issues, this catches it via your app's database health check.

Fly.io Failure Modes

Failure Vigilmon Detects?
Machine crash / OOM Yes — HTTP check fails during restart
Fly platform incident Yes — checks from outside Fly's network
SSL renewal failure Yes — SSL monitor alerts early
Worker job stopped Yes — heartbeat monitor
Regional network issue Yes — multi-region checks
Bad deploy (500 errors) Yes — immediate HTTP check failure
Fly Postgres down Yes — app's DB health endpoint

Fly.io Deployment Monitoring

After deploying with fly deploy, verify your Vigilmon dashboard shows green. A common pattern:

fly deploy
# Wait for deploy to finish
curl -s https://yourapp.fly.dev/health
# Verify in Vigilmon dashboard
Enter fullscreen mode Exit fullscreen mode

Vigilmon's incident history also lets you correlate incidents with deployment times.

Summary

Fly.io is a great platform, but you still need external monitoring:

  1. Add /health endpoint to your app
  2. Create HTTP monitor in Vigilmon
  3. Add SSL certificate monitor
  4. Add heartbeat monitors for background workers
  5. Configure team alerts

Vigilmon catches what Fly.io's internal health checks can't: real user-facing downtime, regional issues, and certificate problems.


Monitor your Fly.io application with Vigilmon — free to start.

Top comments (0)