DEV Community

Vigilmon
Vigilmon

Posted on

How to Monitor Your Vercel Deployment with Vigilmon (Node.js, Edge, and Preview Deployments)

Vercel makes deployment easy — but easy deployments do not mean zero outages. Edge functions timeout. Environment variables are missing. Builds succeed but the app fails at runtime.

This guide covers how to monitor your Vercel deployment with Vigilmon so you know when something breaks.

Why Vercel Apps Need External Monitoring

Vercel handles the infrastructure, but your code still runs on it. Common Vercel failure modes:

  • Runtime crashes — your serverless function exceeds memory or time limits
  • Missing environment variables — a deploy succeeds but the app cannot connect to the database
  • Edge runtime errors — using a Node.js-only package in an edge function
  • Cold start timeouts — serverless functions take too long to initialize
  • Build caching issues — stale build output serves to users
  • Vercel outages — the platform itself has occasional incidents

External monitoring from Vigilmon catches all of these from the user perspective.

Step 1: Add Health Check Routes

For Next.js on Vercel, add health routes for both Node.js and Edge runtimes:

// app/api/health/route.ts — Node.js runtime
import { NextResponse } from "next/server";

export async function GET() {
  const checks: Record<string, string> = {};

  // Check environment variables
  if (!process.env.DATABASE_URL) {
    checks.env = "DATABASE_URL missing";
  } else {
    checks.env = "ok";
  }

  // Optionally check database connectivity
  try {
    // await db.query("SELECT 1")
    checks.database = "ok";
  } catch (e) {
    checks.database = "error";
  }

  const isHealthy = Object.values(checks).every(v => v === "ok");
  return NextResponse.json(
    { status: isHealthy ? "ok" : "degraded", checks },
    { status: isHealthy ? 200 : 503 }
  );
}
Enter fullscreen mode Exit fullscreen mode
// app/api/health/edge/route.ts — Edge runtime
export const runtime = "edge";

export async function GET() {
  return Response.json({
    status: "ok",
    runtime: "edge",
    region: (globalThis as any).VERCEL_REGION || "unknown",
  });
}
Enter fullscreen mode Exit fullscreen mode

Step 2: Expose Critical Routes

Beyond health checks, add monitors for your most important user-facing routes:

  • Homepage: https://yourapp.com/ — must return 200
  • Core API: https://yourapp.com/api/data — must return 200
  • Auth endpoint: https://yourapp.com/api/auth/session — must return 200

Step 3: Set Up Vigilmon Monitoring

  1. Sign up at vigilmon.online — free for 50 monitors, 1-minute checks
  2. Add monitors for each endpoint:
    • Node.js health: https://yourapp.vercel.app/api/health
    • Edge health: https://yourapp.vercel.app/api/health/edge
    • Homepage: https://yourapp.vercel.app/
  3. Set check interval: 1 minute
  4. Set timeout: 15 seconds (accounts for cold starts)
  5. Set regions: US East, EU West, Asia Pacific
  6. Configure Slack or email alerts

Monitoring Preview Deployments

Vercel creates preview deployments for every pull request. You can monitor them too:

  • Add the preview URL to Vigilmon temporarily during review
  • Remove it after the PR is merged
  • This catches regressions before they reach production

For automated preview monitoring, add a GitHub Action that creates a Vigilmon monitor when a preview URL is generated and removes it when the PR closes.

Monitoring Vercel Edge Config and KV

If your app uses Vercel Edge Config or Vercel KV, add a health route that tests them:

import { get } from "@vercel/edge-config";

export const runtime = "edge";

export async function GET() {
  try {
    const testValue = await get("health_check_key");
    return Response.json({ status: "ok", edgeConfig: "reachable" });
  } catch (e) {
    return Response.json({ status: "degraded", edgeConfig: "error" }, { status: 503 });
  }
}
Enter fullscreen mode Exit fullscreen mode

Setting Up SSL Certificate Monitoring

Vercel handles SSL automatically, but your custom domain's certificate can still expire if the DNS configuration changes. Add an SSL expiry monitor in Vigilmon:

  • Enable "SSL certificate check" in your monitor settings
  • Set alert threshold: 30 days before expiry

Vercel vs Your Own Infrastructure

If you have a hybrid setup (Vercel for frontend, your own VPS or cloud for backend API), monitor both independently:

  • Vercel deployment: https://app.yourapp.com/api/health
  • Backend API: https://api.yourapp.com/health

The frontend and backend can fail independently, and you want to know which is down.

Common Vercel Monitoring Gotchas

  1. Cold start timeouts — set Vigilmon timeout to 15-20 seconds for serverless functions
  2. Edge vs Node runtime confusion — monitor both separately; they can fail independently
  3. DNS propagation — after adding a custom domain, wait for DNS to propagate before trusting monitor results
  4. Vercel function timeout limit — hobby plan functions timeout at 10s; pro at 60s. Size your timeout monitor accordingly

Setting Up a Status Page

Enable Vigilmon's public status page at status.yourapp.com and link it from your app footer. During incidents, direct users there instead of handling one-by-one support questions.

Start monitoring your Vercel deployment at vigilmon.online — free, 5-minute setup.

Top comments (0)