tutorial

How to Monitor Devbox Environments with Vigilmon

Devbox by Jetify gives development teams reproducible, isolated environments powered by Nix — no Docker required, no system-wide dependency pollution. But re...

Devbox by Jetify gives development teams reproducible, isolated environments powered by Nix — no Docker required, no system-wide dependency pollution. But reproducibility doesn't mean invulnerability. When a Devbox-managed service or API gateway goes down, your team's builds, local integrations, and CI pipelines can all stall silently.

In this tutorial you'll add external uptime monitoring to services running inside or alongside Devbox using Vigilmon — free tier, no credit card required.


Why monitor Devbox environments?

Devbox is most often used during local development, but teams increasingly run Devbox-managed services in CI runners, staging environments, and even lightweight production deployments. In those contexts the usual failure modes apply:

  • Process crashes without alerts — a Devbox-started service exits or restarts and nobody notices until someone reports a broken page
  • Port binding silently drops — the process is listed as running but the port is no longer reachable
  • Health degradation before a crash — slow responses, intermittent 5xx errors, or database timeouts that precede an outage
  • CI environment drift — a Nix package version upgrade quietly changes runtime behavior, breaking dependent services

External monitoring from Vigilmon catches all of these from outside your machine or runner, giving you visibility that process supervisors and internal health checks can't provide.


What you'll need

  • A service started via Devbox that exposes an HTTP or TCP endpoint
  • A free Vigilmon account

Step 1: Add a health endpoint to your Devbox service

Before monitoring anything, give Vigilmon a reliable signal to check. Add a /health route to whatever service Devbox is running.

For a Node.js/Express app:

app.get('/health', (req, res) => {
  res.json({ status: 'ok', uptime: process.uptime() });
});

For a Python/FastAPI app:

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

For a Go HTTP server:

http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
    w.Header().Set("Content-Type", "application/json")
    w.WriteHeader(http.StatusOK)
    w.Write([]byte(`{"status":"ok"}`))
})

You can also define a process start script in devbox.json that verifies the service is healthy before returning:

{
  "shell": {
    "scripts": {
      "start": "node server.js",
      "check-health": "curl -sf http://localhost:3000/health || exit 1"
    }
  }
}

Run it with devbox run check-health to confirm the endpoint works before connecting Vigilmon.


Step 2: Set up HTTP monitoring in Vigilmon

Once your service exposes a /health endpoint at a reachable URL (either on a VPS, CI runner with a public IP, or via a tunnel like ngrok during development), point Vigilmon at it:

  1. Log in to vigilmon.online and go to Monitors → New Monitor
  2. Choose HTTP / HTTPS as the type
  3. Set the URL to your health endpoint, e.g. https://staging.example.com/health
  4. Set the check interval to 1 minute
  5. Under Expected response, configure:
    • Status code: 200
    • (Optional) Response body contains: "status":"ok"
  6. Save the monitor

Vigilmon will now probe your endpoint every minute from multiple regions. Any non-200 response or timeout triggers an incident.


Step 3: Monitor key Devbox process ports with TCP checks

If your Devbox environment runs services that don't speak HTTP — a Redis instance, a PostgreSQL database, or a gRPC server — add TCP port monitors:

  1. Go to Monitors → New Monitor
  2. Choose TCP Port
  3. Enter your server hostname and the port, e.g. staging.example.com / 6379
  4. Save

This verifies port reachability independently of your application logic. If the process exits or the port binding drops, Vigilmon fires an alert within a minute.


Step 4: Track key metrics

For a service running under Devbox, the metrics worth monitoring through Vigilmon are:

| Metric | What it catches | |---|---| | HTTP response code | Application crashes, bad deploys | | HTTP response time | Latency regressions from dependency changes | | TCP port reachability | Process exits, port binding failures | | Response body content | Silent logical failures returning wrong data |

Vigilmon tracks response time history automatically. Set a response-time alert threshold (e.g. alert if p95 > 2s) to catch performance regressions before users notice.


Step 5: Configure alerts for Devbox service downtime

  1. Go to Alert Channels → Add Channel
  2. Choose Webhook (for Slack, Discord, or PagerDuty) or Email
  3. For a Slack webhook, paste your Slack incoming webhook URL
  4. Assign the alert channel to your Devbox monitors
  5. Set the alert trigger to fire after 1 failed check for immediate notification

Vigilmon sends a structured payload to your webhook:

{
  "monitor_name": "staging /health",
  "status": "down",
  "url": "https://staging.example.com/health",
  "started_at": "2024-06-01T09:14:00Z",
  "duration_seconds": 62
}

Parse this in your Slack bot or PagerDuty integration to route alerts to the right team.


Step 6: Create a status page for your Devbox-backed services

If your team shares a staging or integration environment built on Devbox, a status page lets everyone check service health without pinging you directly:

  1. In Vigilmon, go to Status Pages → New Status Page
  2. Name it (e.g. "Dev Environment Status")
  3. Add your HTTP and TCP monitors
  4. Publish the page

Share the URL in your team's Slack channel or README. Anyone can check whether the shared environment is healthy before reporting a bug.


Putting it all together

A minimal devbox.json with process scripts and a matching Vigilmon setup looks like this:

{
  "packages": ["nodejs@20", "postgresql@15"],
  "shell": {
    "scripts": {
      "start-api": "node api/server.js",
      "start-db": "pg_ctl start -D $PGDATA",
      "health": "curl -sf http://localhost:3000/health && pg_isready"
    }
  }
}

Pair this with:

  • An HTTP monitor on https://your-host/health (checks the API)
  • A TCP monitor on your-host:5432 (checks the database port)
  • A Slack alert channel assigned to both monitors
  • A shared status page for your team

With Vigilmon handling external verification, you'll know the moment any Devbox-managed service goes down — whether it's a Nix package upgrade that silently broke a dependency or a process that crashed during a CI run.


Conclusion

Devbox makes development environments reproducible; Vigilmon makes them observable. Adding HTTP and TCP monitors to your Devbox-backed services takes under five minutes and gives you the external, multi-region visibility that local health checks and process supervisors can't provide. Start with a single /health endpoint and a one-minute Vigilmon monitor — you'll have a signal before your users do.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →