Netlify deploys your JAMstack, Next.js, and static sites globally in seconds — but a successful deploy does not mean your app is healthy. A broken serverless function, a failed form submission handler, edge middleware that silently rewrites requests into a 404, or a scheduled function that stopped firing after a timeout — these failures are invisible on Netlify's dashboard until users complain. Vigilmon gives you the external HTTP monitors, heartbeat monitors, and public status page that Netlify doesn't provide out of the box.
This tutorial wires a Netlify-deployed app into Vigilmon end-to-end.
What You'll Build
- A
/.netlify/functions/healthserverless function that checks your app's dependencies - Vigilmon HTTP monitors for your main site and your functions endpoint
- A Netlify scheduled function that pings a Vigilmon heartbeat on each successful run
- A public Vigilmon status page you can embed in your README or app
Prerequisites
- A Netlify-deployed site with at least one Netlify Function
- Node.js 18+ (for the function code)
- A free account at vigilmon.online
Step 1: Create a Health Check Serverless Function
Netlify Functions run as AWS Lambda-backed serverless functions at /.netlify/functions/<name>. Create a health check function that probes your downstream dependencies.
netlify/functions/health.ts
import type { Handler, HandlerEvent, HandlerContext } from "@netlify/functions";
const handler: Handler = async (event: HandlerEvent, context: HandlerContext) => {
const checks: Record<string, string> = {};
let ok = true;
// Check your primary API or database endpoint
try {
const resp = await fetch(
process.env.DATABASE_HEALTH_URL ?? "https://example.com/ping",
{ signal: AbortSignal.timeout(3000) }
);
checks.database = resp.ok ? "ok" : `http_${resp.status}`;
if (!resp.ok) ok = false;
} catch (err) {
checks.database = `error: ${(err as Error).message}`;
ok = false;
}
// Check a secondary upstream (e.g. auth provider or CMS)
try {
const resp = await fetch(
process.env.CMS_HEALTH_URL ?? "https://example.com/cms-ping",
{ signal: AbortSignal.timeout(2000) }
);
checks.cms = resp.ok ? "ok" : `http_${resp.status}`;
if (!resp.ok) ok = false;
} catch (err) {
checks.cms = `error: ${(err as Error).message}`;
ok = false;
}
return {
statusCode: ok ? 200 : 503,
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
status: ok ? "ok" : "degraded",
checks,
region: process.env.AWS_REGION ?? "unknown",
}),
};
};
export { handler };
Deploy and verify:
curl https://<your-site>.netlify.app/.netlify/functions/health
# {"status":"ok","checks":{"database":"ok","cms":"ok"},"region":"us-east-1"}
Step 2: Add Vigilmon HTTP Monitors
With your health function live, add two monitors in Vigilmon: one for the main site and one for the function endpoint.
Main site monitor
- Log in to Vigilmon → Add Monitor → HTTP.
- URL:
https://<your-site>.netlify.app/ - Check interval: 60 seconds
- Expected status: 200
- Label: "Netlify — main site"
Serverless function monitor
- Add Monitor → HTTP.
- URL:
https://<your-site>.netlify.app/.netlify/functions/health - Check interval: 60 seconds
- Response timeout: 10 seconds (cold-start budget for Lambda-backed functions)
- JSON assertion:
status=ok - Label: "Netlify — health function"
Set alert threshold to 2 consecutive failures before firing an alert to reduce noise from transient cold-start delays.
Step 3: Monitor a Netlify Scheduled Function with a Heartbeat
Netlify Scheduled Functions run your code on a cron schedule using @netlify/functions. If the schedule silently stops (quota, deployment regression, runtime crash), you won't know without an external heartbeat monitor.
Install the dependency
npm install @netlify/functions
netlify/functions/daily-sync.ts
import { schedule } from "@netlify/functions";
const handler = schedule("0 6 * * *", async () => {
try {
// Your actual scheduled work
await syncDailyData();
// Ping Vigilmon heartbeat on success
await fetch(process.env.VIGILMON_HEARTBEAT_URL!, { method: "POST" });
return { statusCode: 200 };
} catch (err) {
// Do NOT ping heartbeat — let Vigilmon fire the alert
console.error("Daily sync failed:", err);
return { statusCode: 500 };
}
});
export { handler };
Add to your Netlify environment variables (Site Settings → Environment Variables):
VIGILMON_HEARTBEAT_URL=https://vigilmon.online/api/heartbeat/<your-heartbeat-id>
In Vigilmon, create a Heartbeat monitor and set the grace period to 30 hours (for a daily job). Vigilmon fires an alert if no ping arrives within the grace window.
Step 4: Monitor Edge Middleware
Netlify Edge Functions (Deno-based) run globally before your pages render. A broken middleware rule can silently redirect every request. Add a dedicated monitor for a route that passes through your middleware:
- Add Monitor → HTTP.
- URL:
https://<your-site>.netlify.app/api/protected-route - Expected status: 200 (or the redirect target — verify what a healthy request returns)
- Response timeout: 5 seconds (edge functions warm instantly)
- Label: "Netlify — edge middleware"
Step 5: Embed the Status Page
Vigilmon generates a public status page for all your monitors. Go to Status Pages → Create, add your Netlify monitors, then embed the badge in your README.md:
[](https://vigilmon.online/status/<status-page-slug>)
Or embed the live widget in your app's footer:
<script
src="https://vigilmon.online/embed.js"
data-page="<status-page-slug>"
data-theme="light"
async
></script>
Key Metrics to Monitor on Netlify
| Metric | Monitor type | Vigilmon feature | |---|---|---| | Main site availability | HTTP uptime | HTTP monitor, 60 s interval | | Serverless function health | HTTP uptime | HTTP monitor with JSON assertion | | Scheduled function runs | Heartbeat | Heartbeat monitor, 30 h grace | | Edge middleware correctness | HTTP uptime | HTTP monitor on middleware route | | Build pipeline (deploy hook) | Heartbeat | Heartbeat from post-deploy script | | Core Web Vitals regressions | Real-user monitoring | Vigilmon external check + Lighthouse |
Alerting Recommendations
- Slack webhook — post to
#incidentswith the monitor name and failure reason - Email — on-call address for P0 function outages
- PagerDuty webhook — for high-severity monitors covering revenue-critical flows
Set re-notification to every 5 minutes while a monitor is down so alerts don't get buried in a busy Slack channel.
Netlify handles your deploy pipeline. Vigilmon handles the question "is my app actually working right now?" — from the outside, the way your users experience it.
Start monitoring your Netlify app today — register free at vigilmon.online.