
Learn how to set up Better Stack uptime monitoring for your production web apps, configure alerts, and track incidents effectively.
When you deploy a web application or a SaaS product, keeping it online is only half the battle. You also need to know immediately when something breaks. As a full-stack developer, I have set up various monitoring tools over the years, and lately, Better Stack has become one of my favorite choices for clear uptime monitoring and incident management.
In this guide, I will show you how to configure Better Stack uptime monitoring for your web apps, set up meaningful status checks, and route alerts so you never miss critical downtime.
Traditional uptime monitors often just ping a URL every five minutes and send an email if it returns a 500 error. Modern web applications require more nuance:
Better Stack combines uptime checks, log management, and incident response into a single interface that is fast to set up and pleasant to look at.
To get started, log into your Better Stack dashboard and create a new monitor.
{
"url": "https://api.example.com/health",
"check_frequency": 30,
"expected_status_code": 200,
"timeout_seconds": 10
}
Make sure you point your monitor to a dedicated health check route rather than just your root domain. A good health check route should verify that your database connection is active and that your primary cache layer is responding.
Here is a simple Node.js and Express health check endpoint pattern that I often implement in my client projects:
app.get('/health', async (req, res) => {
try {
// Check database connection
await db.raw('SELECT 1');
res.status(200).json({
status: 'healthy',
timestamp: new Date().toISOString(),
database: 'connected'
});
} catch (error) {
res.status(500).json({
status: 'unhealthy',
error: error.message
});
}
});
If your database goes down, this endpoint returns a 500 status code, and Better Stack triggers an alert immediately. This is far more effective than just checking if the server is running.
An alert is only useful if it reaches the right person at the right time. Better Stack allows you to set up escalation policies.
When building client projects like JobsiteX or custom SaaS applications, keeping stakeholders informed during rare maintenance windows is crucial for maintaining trust.
Transparency builds confidence. Better Stack makes it very easy to publish a status page linked to your monitors.
Proper uptime monitoring takes very little time to configure, but it saves hours of stress when unexpected issues arise. By combining fast polling intervals, proper database health checks, and clear escalation policies, you can ensure your web applications remain reliable and your users stay informed.
Need help setting up robust monitoring, CI/CD pipelines, or scaling your next web application? Feel free to get in touch.
Tagged with
Leave a comment