DEV Community

Vigilmon
Vigilmon

Posted on

How to Monitor Your Payload CMS v3 Application with Vigilmon

Payload CMS v3 is a headless CMS built on Next.js that runs the admin panel, REST API, and GraphQL API all in one Node.js process. When it goes down, your editors can't work and your front-end content API breaks. Here's how to monitor Payload CMS v3 with Vigilmon.

Payload CMS v3 Architecture

Payload v3 runs as a Next.js app. That means:

  • Admin panel/admin
  • REST API/api/{collection-slug}
  • GraphQL/api/graphql
  • Health — no built-in health route (but easy to add)

The cleanest approach is to add a dedicated health route and monitor that.

Adding a Health Route

Create a simple route handler in your Payload Next.js app:

// app/api/health/route.ts
import { NextResponse } from 'next/server'
import { getPayload } from 'payload'
import configPromise from '@payload-config'

export async function GET() {
  try {
    const payload = await getPayload({ config: configPromise })
    // Optionally do a simple DB check
    await payload.count({ collection: 'users', where: {} })
    return NextResponse.json({ status: 'ok', timestamp: Date.now() })
  } catch (err) {
    return NextResponse.json({ status: 'error' }, { status: 503 })
  }
}
Enter fullscreen mode Exit fullscreen mode

This health check verifies both the Next.js server and the database connection are alive.

Simpler Alternative: Monitor the Admin Panel

If you don't want to add code, just monitor the admin login page:

URL: https://your-payload-app.com/admin
Expected status: 200
Enter fullscreen mode Exit fullscreen mode

If /admin returns 200, Payload is running. This works well for quick setup.

Configuring Vigilmon

  1. Sign up at vigilmon.online
  2. Create a new monitor:
Setting Value
URL https://your-payload-app.com/api/health
Method GET
Interval 60 seconds
Expected status 200
Keyword check "ok"
  1. Add your alert email.
  2. Hit Save.

Monitoring the REST API Directly

For content-critical apps, add a second monitor to check the actual content API:

URL: https://your-payload-app.com/api/posts?limit=1
Method: GET
Expected status: 200
Keyword: "docs"
Enter fullscreen mode Exit fullscreen mode

The REST API returns { "docs": [...], "totalDocs": N }. If the keyword docs appears, your content API is serving.

Environment-Specific Monitoring

Self-hosted (VPS/Docker):

HEALTHCHECK --interval=30s --timeout=10s \
  CMD curl -f http://localhost:3000/api/health || exit 1
Enter fullscreen mode Exit fullscreen mode

Vercel or cloud deployment:
Use the public URL directly — no changes needed. Vigilmon hits your production URL from external servers.

What Breaks When Payload Goes Down

  • Editorial team can't publish, edit, or approve content
  • Front-end apps using the REST or GraphQL API start returning stale or empty content
  • If using Payload for authentication, login breaks for end users
  • Scheduled tasks and hooks stop firing

Alerting Strategy

For a content team:

  • Email alert to the tech lead (free on Vigilmon)
  • Slack webhook to #cms-alerts so editors can report it themselves

Set a 2-minute alert delay to avoid false positives from brief restarts during deploys.

Summary

Payload CMS v3 monitoring in 3 steps:

  1. Add /api/health route (or use /admin as a proxy check)
  2. Create Vigilmon monitor pointing at it
  3. Set up email or Slack alert

Your editorial team stays productive and you catch outages before they become content emergencies.

Start monitoring Payload CMS free on Vigilmon →

Top comments (0)