Your Node.js cron job ran at 3am. Or did it? Your Express API is returning 500s to production users right now. Do you know?
Most developers only find out their Node.js app went down when a user files a support ticket — hours after the fact. By then, you have lost trust, revenue, and a weekend.
In this tutorial, you will set up free uptime monitoring for your Node.js/Express app using Vigilmon in under 10 minutes. We will cover:
- HTTP uptime checks for your Express API endpoints
- Heartbeat monitoring for Node.js cron jobs
- SSL certificate expiry alerts
- Slack and email notifications
No credit card required.
1. The Problem: Silent Failures Kill Trust
Node.js apps fail in two distinct ways:
Loud failures — your app crashes, PM2 restarts it, you get an error log. These are annoying but visible.
Silent failures — your cron job silently stops running. Your API returns 500s but never crashes. Your SSL cert expires and Chrome starts showing warnings. These are the killers.
For Express APIs, a silent 500 means users see an error but your server is technically "up." For cron jobs — things like sending emails, syncing data, or processing queues — the job just stops. No crash, no log entry, no alert.
You need external monitoring that checks from outside your infrastructure.
2. What Vigilmon Monitors
Vigilmon offers three types of monitoring that directly address Node.js failure modes:
HTTP Checks — Vigilmon pings your API endpoints every minute and alerts you if they return non-2xx status codes or take too long to respond. Perfect for Express routes.
Heartbeat Monitoring — Your cron job sends a "heartbeat" ping to Vigilmon after each successful run. If Vigilmon does not receive a ping within the expected window, it fires an alert. This catches silent cron failures.
SSL Expiry — Vigilmon warns you 30, 14, and 7 days before your SSL certificate expires. No more unexpected "connection not secure" warnings for your users.
All of this is free on the free tier — no credit card needed.
3. Set Up HTTP Monitoring for Express
Step 1: Add a health check endpoint
Add a /health endpoint to your Express app. This gives Vigilmon a reliable endpoint that does not require auth:
// app.js
app.get('/health', (req, res) => {
res.json({ status: 'ok', timestamp: new Date().toISOString() });
});
If you want to verify database connectivity too:
app.get('/health', async (req, res) => {
try {
await db.query('SELECT 1');
res.json({ status: 'ok', db: 'connected' });
} catch (err) {
res.status(503).json({ status: 'error', db: 'disconnected' });
}
});
Step 2: Create an HTTP monitor in Vigilmon
- Sign up at vigilmon.online (free, no card)
- Click Add Monitor → HTTP Check
- Enter your endpoint URL:
https://yourdomain.com/health - Set the check interval (1 minute on the free tier)
- Set an alert threshold — e.g., alert if response time > 3000ms or status is not 2xx
Vigilmon will start pinging your endpoint immediately and alert you the moment it goes down.
4. Heartbeat Monitoring for Node.js Cron Jobs
This is the killer feature for Node.js backends. Here is how it works:
- You create a heartbeat monitor in Vigilmon with an expected interval (e.g., every 5 minutes)
- At the end of each successful cron job run, your code sends a GET request to Vigilmon's ping URL
- If Vigilmon does not receive a ping within the expected interval plus a grace period, it fires an alert
Setting it up with node-cron
First, create the heartbeat monitor in Vigilmon:
- Click Add Monitor → Heartbeat
- Name it (e.g., "Email digest job")
- Set the expected interval (e.g., 5 minutes)
- Copy the ping URL — it will look like
https://vigilmon.online/api/heartbeat/ping/abc123
Then wire it into your cron job:
const cron = require('node-cron');
const https = require('https');
// Store your ping URL in .env
const VIGILMON_HEARTBEAT_URL = process.env.VIGILMON_HEARTBEAT_URL;
function pingVigilmon() {
https.get(VIGILMON_HEARTBEAT_URL, () => {}).on('error', (err) => {
console.error('Vigilmon ping failed:', err.message);
});
}
cron.schedule('*/5 * * * *', async () => {
try {
// Your actual job logic
await processEmailQueue();
await syncDataFromAPI();
// Only ping after successful completion
pingVigilmon();
console.log('Job done, heartbeat sent');
} catch (err) {
console.error('Job failed:', err);
// No ping = Vigilmon alerts after the grace period
}
});
The key principle: only ping after successful completion. If your job throws, skip the ping. Vigilmon will notice the missed heartbeat and fire an alert.
Using axios instead
const axios = require('axios');
async function pingVigilmon() {
try {
await axios.get(process.env.VIGILMON_HEARTBEAT_URL);
} catch (err) {
console.error('Vigilmon ping failed:', err.message);
}
}
Store the URL in .env:
VIGILMON_HEARTBEAT_URL=https://vigilmon.online/api/heartbeat/ping/YOUR_ID_HERE
Monitoring multiple cron jobs
For multiple jobs, create a separate heartbeat monitor for each one — this gives you per-job failure visibility:
const monitors = {
emailQueue: process.env.VIGILMON_EMAIL_HEARTBEAT_URL,
dataSync: process.env.VIGILMON_SYNC_HEARTBEAT_URL,
reports: process.env.VIGILMON_REPORTS_HEARTBEAT_URL,
};
async function runEmailJob() {
await processEmails();
await axios.get(monitors.emailQueue);
}
async function runSyncJob() {
await syncFromAPI();
await axios.get(monitors.dataSync);
}
5. Configure Slack and Email Alerts
Email alerts
Vigilmon sends alerts to your account email by default. Add extra recipients under Settings → Notifications.
Slack alerts
- Go to Settings → Integrations → Slack
- Click Connect to Slack and authorize the app
- Choose which channel receives alerts (e.g.,
#incidentsor#ops)
When your Express API goes down or a cron job misses its heartbeat, you get a Slack message within the minute. The alert includes the monitor name, failure type, timestamp, and a direct link to investigate.
When the issue resolves, Vigilmon sends a recovery notification automatically — no manual clear required.
6. Optional: Public Status Page
If you want your users or team to see uptime history without logging into Vigilmon, you can publish a public status page in one click.
Go to Settings → Status Page, toggle it on, and Vigilmon generates a public URL that shows:
- Current status of all your monitors
- Uptime percentage over the last 30 and 90 days
- Incident history
Zero extra configuration needed — it reflects the monitors you have already set up.
Recap
Here is what you now have in place:
| Scenario | What happens |
|---|---|
| Express API returns 500s or goes offline | HTTP monitor alerts within 1 minute |
| Cron job silently stops running | Heartbeat monitor alerts after missed ping |
| SSL cert approaching expiry | 30/14/7-day advance warnings |
| Alert fires | Instant Slack message and email |
| Users want to check status | Public status page URL |
Free tier includes:
- Up to 10 monitors
- 1-minute check intervals
- Email and Slack notifications
- Public status page
- No credit card required
Get started at vigilmon.online — it takes less time to set up than it took to read this article.
Also worth reading: Monitor your Laravel app with Vigilmon
Top comments (0)