tutorial

How to Monitor Sanity Headless CMS Deployments 2026

Sanity is a hosted headless CMS with a real-time content API. This guide shows you how to monitor your Sanity GROQ API, CDN delivery, webhook pipelines, and any self-hosted Sanity Studio instances with Vigilmon.

Sanity is a headless CMS that stores structured content and exposes it via a hosted GROQ API and CDN. Most teams also deploy a Sanity Studio (the content editing UI) as a standalone web app. When either the API or the Studio goes down, editors can't publish and frontends can't fetch fresh content — but your site keeps serving stale CDN-cached pages, masking the outage until something breaks at deploy time. Vigilmon monitors each layer so you know about failures before your editors or readers do.

What You'll Set Up

  • HTTP uptime monitoring for Sanity's hosted API and CDN
  • Monitoring for your self-hosted Sanity Studio deployment
  • Webhook delivery monitoring for content pipeline integrations
  • Heartbeat monitoring for content sync or preview workers
  • SSL certificate alerts for Studio deployments

Prerequisites

  • A Sanity project with a dataset (hosted on api.sanity.io or cdn.sanity.io)
  • A deployed Sanity Studio (Vercel, Netlify, or custom host)
  • A free Vigilmon account

Step 1: Monitor the Sanity Content API

Sanity's hosted GROQ API is the read path for all your frontends. Add a synthetic query monitor to verify it's returning content.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Use a lightweight GROQ query as the URL. The Sanity API accepts GET requests with query parameters:
https://YOUR_PROJECT_ID.api.sanity.io/v2024-01-01/data/query/production?query=*[_type%3D%3D%22sanity.imageAsset%22]%7B_id%7D%5B0%5D

Replace YOUR_PROJECT_ID with your Sanity project ID and production with your dataset name.

  1. Set Check interval to 5 minutes.
  2. Set Expected HTTP status to 200.
  3. Optionally add a keyword check for "result" — every successful Sanity API response includes this key.
  4. Click Save.

This query fetches a single image asset record — cheap to run, but it validates the API server, authentication routing, and dataset availability.


Step 2: Monitor the Sanity CDN

cdn.sanity.io is a separate CDN layer that caches query results. The API and CDN can fail independently — API issues affect live content writes; CDN issues affect read performance. Add a second monitor for the CDN endpoint:

  1. Add another HTTP / HTTPS monitor using cdn.sanity.io instead of api.sanity.io:
https://YOUR_PROJECT_ID.cdn.sanity.io/v2024-01-01/data/query/production?query=*[_type%3D%3D%22sanity.imageAsset%22]%7B_id%7D%5B0%5D
  1. Set Check interval to 5 minutes.
  2. Set Expected HTTP status to 200.

You now have separate monitors for the API origin and the CDN edge, so a CDN cache purge or edge outage doesn't mask API health.


Step 3: Monitor Your Sanity Studio Deployment

The Sanity Studio is a React SPA that editors use to create and publish content. It's typically deployed to Vercel, Netlify, or a custom host as a static site.

  1. Add an HTTP / HTTPS monitor for your Studio URL: https://studio.yourdomain.com.
  2. Set Check interval to 5 minutes.
  3. Add a keyword check for "Sanity Studio" or any text in your custom Studio title — this catches cases where the host returns 200 but serves an error page.

If your Studio is deployed to Sanity's own hosting (https://YOUR_PROJECT_ID.sanity.studio), add a monitor for that URL instead. Sanity-hosted Studios don't require any configuration on your side.


Step 4: Monitor Webhook Delivery for Content Pipelines

Sanity webhooks fire when documents are created, updated, or deleted. Common consumers include:

  • Revalidation endpoints on Next.js or Nuxt frontends
  • Algolia or Meilisearch indexers
  • Image processing pipelines
  • Slack notifications for editorial workflows

Add an HTTP / HTTPS monitor for each webhook consumer endpoint:

  1. Add a monitor for your Next.js revalidation handler: https://yoursite.com/api/revalidate.
  2. Set Expected HTTP status to 200.
  3. Repeat for each consumer URL.

To verify Sanity is actually delivering webhooks, set up a listener in your Sanity project dashboard under API → Webhooks and check the delivery log. A backlog of failed deliveries means consumers are down — Vigilmon's endpoint monitors should catch this first.

For critical pipelines, you can use the Sanity webhook payload to ping Vigilmon directly:

// pages/api/revalidate.ts (Next.js)
import type { NextApiRequest, NextApiResponse } from 'next';

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
  // ... your revalidation logic ...
  await res.revalidate('/');

  // Ping Vigilmon heartbeat to confirm pipeline is healthy
  const heartbeatUrl = process.env.VIGILMON_HEARTBEAT_URL;
  if (heartbeatUrl) {
    await fetch(heartbeatUrl).catch(() => {});
  }

  res.status(200).json({ revalidated: true });
}

Step 5: Heartbeat Monitoring for Preview and Sync Workers

If you run a live preview server (using Sanity's @sanity/preview-kit) or a content sync worker (exporting to a database or search index), add a Vigilmon heartbeat:

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set the expected interval to match your sync frequency.
  3. Copy the heartbeat URL.

In your sync worker, ping after each successful run:

const VIGILMON_URL = process.env.VIGILMON_HEARTBEAT_URL;

async function syncContent() {
  const client = createClient({ projectId, dataset, apiVersion, token });
  const docs = await client.fetch('*[_type == "post"]');
  await writeToDatabase(docs);

  if (VIGILMON_URL) {
    await fetch(VIGILMON_URL).catch(() => {});
  }
}

If the worker crashes or the Sanity listener connection drops, Vigilmon alerts after the expected interval passes.


Step 6: SSL Certificate Alerts

  1. Open the Vigilmon monitors for your Studio and any custom domain endpoints.
  2. Enable Monitor SSL certificate on each.
  3. Set Alert when certificate expires in less than 21 days.

Sanity-hosted APIs (api.sanity.io, cdn.sanity.io) manage their own certificates — focus your SSL alerts on your own deployments.


Step 7: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add Slack, email, or PagerDuty.
  2. Set Consecutive failures before alert to 2 on all monitors — CDN and API endpoints occasionally return errors during deploys or cache invalidation.
  3. Route Studio alerts to your editorial team's Slack channel and API alerts to your engineering channel.

Summary

| Monitor | Target | What It Catches | |---|---|---| | API endpoint | api.sanity.io/... | API server failure, dataset unavailable | | CDN endpoint | cdn.sanity.io/... | CDN edge failure, cache issues | | Studio deployment | studio.yourdomain.com | Studio host down, broken deploy | | Webhook consumers | /api/revalidate, indexer | Downstream pipeline failures | | Sync heartbeat | Heartbeat URL | Content sync worker crash | | SSL certificates | Studio domain | Certificate expiry |

Sanity's hosted API means you rely on a third-party SLA for the content layer — separate from your own infrastructure. Vigilmon monitors both the Sanity-side endpoints and your own downstream consumers, giving you complete visibility whether the issue is in Sanity's infrastructure or your own deployment pipeline.

Monitor your app with Vigilmon

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

Start free →