Contentful is the leading headless CMS powering thousands of Jamstack and enterprise sites. When your Contentful Content Delivery API goes down or slows down, your website renders blank content, your SSR responses time out, and your users see broken pages.
This guide shows you how to monitor your Contentful-backed site with Vigilmon—a free external uptime monitor that catches API problems before your users do.
What Can Go Wrong with Contentful?
Contentful is reliable, but here's what can still break:
- Content Delivery API (CDA) outages — your site's main data source goes dark
- Content Preview API issues — your preview environments stop working
- GraphQL API timeouts — complex queries time out under load
- Webhook delivery failures — your build system never gets notified of content changes
- CDN edge node problems — content loads from origin instead of edge (much slower)
- Rate limiting — spikes in traffic hit CDA rate limits, causing 429 errors
None of these show up on your Contentful dashboard—they need to be caught from the outside.
Creating a Contentful Health Check Endpoint
The cleanest approach is a dedicated health check on your application that probes Contentful:
Next.js API Route
// pages/api/health.js or app/api/health/route.js
import { createClient } from 'contentful';
const client = createClient({
space: process.env.CONTENTFUL_SPACE_ID,
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
});
export default async function handler(req, res) {
try {
// Lightweight check: fetch a single entry
const response = await client.getEntries({
content_type: 'blogPost', // use your content type
limit: 1,
});
res.status(200).json({
status: 'healthy',
contentful: 'connected',
entryCount: response.total,
timestamp: new Date().toISOString(),
});
} catch (error) {
res.status(500).json({
status: 'unhealthy',
error: error.message,
timestamp: new Date().toISOString(),
});
}
}
Gatsby / Static Site Health Check
For static Gatsby sites, add a serverless function:
// netlify/functions/health.js
const { createClient } = require('contentful');
exports.handler = async (event, context) => {
const client = createClient({
space: process.env.CONTENTFUL_SPACE_ID,
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
});
try {
await client.getSpace();
return {
statusCode: 200,
body: JSON.stringify({ status: 'healthy', contentful: 'connected' }),
};
} catch (error) {
return {
statusCode: 500,
body: JSON.stringify({ status: 'unhealthy', error: error.message }),
};
}
};
Monitoring the Contentful API Directly
You can also monitor the Contentful Content Delivery API directly (for public content):
https://cdn.contentful.com/spaces/{SPACE_ID}/environments/master/entries?limit=1
Add your access token as a query param:
https://cdn.contentful.com/spaces/abc123/environments/master/entries?limit=1&access_token=YOUR_TOKEN
Set up a Vigilmon HTTP check:
- URL: The endpoint above
- Method: GET
- Expected status: 200
-
Keyword check:
"sys"(present in every Contentful response) - Timeout: 10 seconds
Setting Up Vigilmon Monitors for Contentful
- Go to vigilmon.online and create a free account
-
Create Monitor 1: Your Website
- URL:
https://yoursite.com - Type: HTTP
- Method: GET
- Keyword: Something from your homepage content
- URL:
-
Create Monitor 2: Health Check Endpoint
- URL:
https://yoursite.com/api/health - Type: HTTP
- Expected status: 200
- Keyword:
"healthy"
- URL:
-
Create Monitor 3: Contentful CDA (optional)
- URL:
https://cdn.contentful.com/spaces/YOUR_SPACE/entries?limit=1&access_token=YOUR_TOKEN - Type: HTTP
- Expected status: 200
- URL:
-
Set up alerts:
- Email for immediate notification
- Slack webhook for team notification
Monitoring Contentful Webhooks
Contentful webhooks trigger your build pipeline when content changes. If webhooks fail silently, your content updates never reach production.
To monitor webhook reliability, add a webhook endpoint that logs receipt and exposes a recent-activity check:
// pages/api/contentful-webhook.js
import { appendFileSync } from 'fs';
export default function handler(req, res) {
if (req.method === 'POST') {
// Log webhook receipt
const timestamp = new Date().toISOString();
appendFileSync('/tmp/webhook-log.txt', `${timestamp}\n`);
res.status(200).json({ received: true, timestamp });
} else {
// Health check - show last webhook time
res.status(200).json({ status: 'webhook endpoint active' });
}
}
Contentful-Specific Alert Thresholds
| Scenario | Recommended Setting |
|---|---|
| CDA API timeout | 10 seconds |
| GraphQL queries | 15 seconds |
| Check frequency | 1 minute |
| Alert after | 2 consecutive failures |
| Multi-region | Yes (US, EU required) |
What Breaks When Contentful Is Down
Understanding the impact helps you prioritize monitoring:
| App Type | Contentful Down Impact |
|---|---|
| Next.js ISR | Stale content served from cache |
| Next.js SSR | Every page request fails with 500 |
| Gatsby static | Build fails, stale content served |
| React SPA (client-fetch) | White screen on load |
| Nuxt SSR | 500 errors on page load |
For SSR applications, Contentful outages = immediate user-facing errors. Vigilmon will alert you within 60 seconds.
Monitor Your Whole Contentful Stack
Vigilmon Monitors:
├── Main Website
│ └── https://yoursite.com → HTTP 200, keyword check
├── API Health Check
│ └── https://yoursite.com/api/health → JSON "healthy"
├── Preview Environment
│ └── https://preview.yoursite.com → HTTP 200
└── Contentful CDA (direct)
└── https://cdn.contentful.com/spaces/... → HTTP 200
Get started free at vigilmon.online — 5 monitors free, no credit card required.
Top comments (0)