Create a Health Check URL in Your Web App and Monitor Its Uptime
In this video, we'll go over how to set up a health check endpoint in Flask and use the free UptimeRobot service to monitor your uptime.
Quick Jump: Demo Video
After watching this 5 minute video you’ll know how to create a custom health check endpoint in your app that double checks your database connection and also get notified by email from a free monitoring service if your site ever happens to go down.
- 0:35 – Creating a health check endpoint in a Flask app
- 2:41 – UptimeRobot (free) monitors and notifies you by email if your site goes down
An example of creating a minimal
/healthy health check endpoint in Flask which also checks your database to make sure it’s able to be connected to.
@page.route('/healthy') def healthy(): db.engine.execute('SELECT 1') return ''
How do you have your health check endpoint set up? Let me know below.