Next.js application monitoring showing SSR response times and API route health checks
# web development

Monitoring Next.js Applications: A Practical Uptime and Performance Guide

Next.js has become one of the most popular frameworks for building production web applications. Its hybrid rendering model — combining server-side rendering (SSR), static site generation (SSG), and API routes — gives teams incredible flexibility. But it also creates a monitoring challenge: your app can fail in different ways depending on which rendering mode is running.

This guide covers everything you need to know about monitoring Next.js applications effectively, whether you're deployed on Vercel, a Node.js server, or Docker.

What Makes Next.js Monitoring Unique

Unlike a purely static site or a simple REST API, a Next.js application has multiple layers that can independently fail:

  • Static pages — pre-built HTML served from a CDN
  • Server-side rendered pages — generated on each request by a Node.js process
  • API routes — serverless functions (on Vercel) or Node.js handlers handling backend logic
  • Edge middleware — lightweight code running at the CDN edge

Each of these has different failure modes, different performance characteristics, and requires different monitoring approaches.

Monitoring SSR vs Static Pages

Static Pages (SSG/ISR)

Static pages are pre-rendered at build time and served directly from a CDN. They're extremely reliable — there's no server to crash, no Node.js process to block. Monitoring static pages is straightforward: check that the URL returns a 200 status code and the content looks correct.

The main failure mode for static pages is a broken build — if your Next.js build fails during deployment, the old static files remain (good) or the deployment breaks entirely (bad).

Server-Side Rendered Pages

SSR pages are generated fresh on each request. They depend on your Node.js server being healthy, your database being responsive, and any external APIs you call during rendering being available.

SSR pages can fail because:

  • The Node.js server is down or overloaded
  • A database query in getServerSideProps times out
  • An external API call during rendering fails
  • Memory usage has grown too large

Monitoring tip: Create a dedicated monitoring endpoint or a lightweight SSR page that makes minimal external calls. This gives your external monitor a reliable page to check without triggering expensive operations.

API Routes

Next.js API routes behave like serverless functions on Vercel or like Express route handlers on a self-hosted Node.js server. They're critical — they often handle form submissions, authentication, payment processing, and data fetching.

Monitor your most important API routes directly:

  • GET /api/health — basic health check
  • POST /api/checkout — check your payment flow works (with synthetic transactions)
  • GET /api/[key-data-endpoint] — verify data is loading correctly

Cold Starts on Vercel and Serverless Deployments

If you deploy Next.js on Vercel, your API routes run as serverless functions. This means they spin up on demand and can experience cold starts — a delay of 100ms to several seconds when a function hasn't been called recently.

Cold starts are not downtime, but they can look like slow responses in your monitoring data. Understanding this helps you interpret your metrics correctly:

  • Cold start spikes are typically short (under 2 seconds) and occur after periods of inactivity
  • Sustained slow responses indicate a real performance problem

To minimize cold start impact:

  1. Keep your API route code small — avoid large imports
  2. Use edge functions where possible (they have near-zero cold start times)
  3. Configure minimum instance counts if Vercel's plan allows it
  4. Set up a monitoring ping every few minutes to keep functions warm (be careful — this adds cost)

Setting Up Health Check Endpoints in Next.js

Every Next.js application should have a /api/health route. Here's a production-ready example:

// pages/api/health.js
export default async function handler(req, res) {
  const checks = { status: 'ok', timestamp: new Date().toISOString() };

  try {
    // Test database connection
    await db.query('SELECT 1');
    checks.database = 'connected';
  } catch (e) {
    checks.database = 'error';
    checks.status = 'degraded';
  }

  const statusCode = checks.status === 'ok' ? 200 : 503;
  res.status(statusCode).json(checks);
}

Point your external uptime monitor at https://yourdomain.com/api/health. When this endpoint stops returning 200, you'll be alerted immediately.

External Uptime Monitoring for Next.js

Regardless of where you deploy Next.js, external monitoring is non-negotiable. External monitoring:

  • Checks your app from outside your infrastructure
  • Verifies the full request path — DNS, SSL, CDN, server, app code
  • Alerts you within minutes of any outage
  • Tracks response time trends so you can spot degradation early

With Domain Monitor, you can add multiple monitors:

  1. Main site monitor — check your homepage or a lightweight page
  2. API health monitor — check your /api/health endpoint
  3. Critical page monitor — check your most important SSR page
  4. SSL monitor — get alerted before your certificate expires

This layered approach means you'll know immediately whether it's your whole site that's down, just your API, or just a specific page.

For more on why external monitoring is essential, read what is website monitoring and the benefits of uptime monitoring.

Monitoring Vercel Deployments

Vercel provides its own built-in analytics and monitoring — but it's important to understand what Vercel monitors and what it doesn't.

Vercel monitors:

  • Function execution duration
  • Function errors
  • Build success/failure
  • Edge network availability

Vercel does NOT monitor:

  • Whether your app is responding correctly from an end-user perspective
  • SSL certificate validity from an external view
  • Response times as experienced by users in different regions
  • Whether a specific page or API route returns correct data

Use Vercel's built-in tools alongside an independent external monitor. Vercel's status page at vercel-status.com tells you about platform-wide issues, but it won't tell you if your specific deployment is broken.

Performance Monitoring for Next.js

Core Web Vitals

Next.js has built-in support for reporting Core Web Vitals. You can capture these metrics and send them to an analytics endpoint:

// pages/_app.js
export function reportWebVitals(metric) {
  console.log(metric);
  // Send to your analytics service
}

Key metrics to track:

  • LCP (Largest Contentful Paint) — how fast the main content loads. Target: under 2.5s
  • FID/INP (Interaction to Next Paint) — responsiveness. Target: under 200ms
  • CLS (Cumulative Layout Shift) — visual stability. Target: under 0.1

Response Time Baselines

Establish response time baselines for each type of page:

  • Static pages served from CDN: typically 50-200ms
  • SSR pages: typically 200-800ms depending on data fetching
  • API routes: varies widely by function

Alert when response times exceed 2x your baseline. Read more about response time monitoring for guidance on setting thresholds.

Common Next.js Outage Scenarios

Here are the most common ways Next.js apps go down — and what to watch for:

  1. Failed deployment — a broken build deploys broken code. Monitor after every deployment.
  2. Database connection exhaustion — SSR pages hammer your DB. Watch for 503 errors and slow response times.
  3. Third-party API failure — if you call an API in getServerSideProps, its outage becomes your outage.
  4. Memory leak in custom server — if you run Next.js with a custom Express server, memory leaks will crash it eventually.
  5. SSL certificate expiry — Next.js apps need valid SSL like any other site. Set up SSL monitoring to catch this early.

Checklist: Next.js Monitoring Setup

  • /api/health endpoint that tests your database connection
  • External uptime monitor on your health endpoint (check every 1-2 minutes)
  • SSL certificate monitor with 30-day expiry alert
  • Domain expiry monitor
  • Response time alerting thresholds configured
  • Deployment notification webhook to your monitoring tool
  • Public status page so users know when there are issues

The full website monitoring checklist for 2026 covers all of these and more.

Wrapping Up

Monitoring Next.js applications effectively means covering all the layers: static pages, SSR routes, API endpoints, and the infrastructure they run on. Start with a /api/health endpoint and an external uptime monitor — these two things alone will catch the majority of real-world outages.

As your app grows, layer in response time tracking, deployment monitoring, and Core Web Vitals reporting. The goal is to know about problems before your users do.

Domain Monitor makes Next.js monitoring easy — add your site in minutes and get instant alerts when anything breaks.

More posts

What Is Generative AI? How It Works and What It Creates

Generative AI creates new content — text, images, code, and more. This guide explains how it works, what tools are available, and where it's genuinely useful versus overhyped.

Read more
What Is Cursor AI? The AI Code Editor Explained

Cursor AI is an AI-powered code editor built on VS Code. Learn what it does, how it works, and whether it's the right tool for your development workflow.

Read more
What Is Claude Opus? Anthropic's Most Powerful Model Explained

Claude Opus is Anthropic's most capable AI model, built for complex reasoning and demanding tasks. Learn what it does, how it compares, and when to use it.

Read more

Subscribe to our PRO plan.

Looking to monitor your website and domains? Join our platform and start today.