Prompt
How do I set up synthetic uptime checks for my site
Latest observation
Synthetic uptime checks are automated tests that periodically hit your website from outside your infrastructure to verify it’s reachable and behaving correctly. A good setup usually checks more than just “is the site up?”—it also validates key user flows.
1) Decide what to monitor
Start with 3–5 critical checks:
- Homepage availability:
GET / - Login page loads:
GET /login - Core API endpoint:
GET /api/healthor a lightweight endpoint - Critical user flow: e.g. sign-in, search, checkout
- TLS/domain check: certificate validity, DNS resolution
If your site depends on third-party services, decide whether you want checks to fail when those fail too.
2) Pick a monitoring approach
You have two main types:
HTTP checks
Simple and cheap. They verify:
- DNS resolves
- TLS works
- Response code is correct
- Response body contains expected text
Good for:
- Most uptime monitoring
- APIs and static sites
Browser/synthetic journey checks
Run a real browser (Playwright, Puppeteer, Selenium) to simulate a user:
- Open site
- Click login
- Search for something
- Add to cart, etc.
Good for:
- Complex apps
- JavaScript-heavy sites
- Checking real user flows
3) Choose a tool
You can use:
- Managed services: Pingdom, UptimeRobot, Datadog Synthetics, New Relic Synthetics, Checkly, Better Stack, StatusCake
- Self-hosted: a cron job + script, Prometheus Blackbox Exporter, custom Playwright scripts
If you want the easiest setup, managed monitoring is usually best.
4) Configure the checks
For each check, define:
- URL
- Method: usually
GET - Expected status:
200(or301/302if expected) - Timeout: e.g. 5–15 seconds
- Interval: e.g. every 1 minute
- Regions: multiple geographic locations if possible
- Assertions:
- response contains a string
- JSON field matches expected value
- page title matches
- specific UI element exists
Example assertions:
- Homepage contains “Welcome”
/healthreturns JSON with"ok": true- Login page loads and includes “Sign in”
5) Set up alerting
Make sure alerts go to the right place:
- Slack
- PagerDuty/Opsgenie
- SMS for critical systems
Best practices:
- Alert on sustained failures, not one-off blips
- Use escalation rules
- Send alerts to a shared channel plus on-call person
6) Avoid false positives
Common ways uptime checks fail incorrectly:
- Short timeouts
- Single-region monitoring only
- Checking a page that depends on flaky third-party services
- Hitting a rate-limited or protected endpoint
- Monitoring from inside your own network only
To reduce false alarms:
- Use multiple regions
- Add retries
- Check a lightweight health endpoint
- Exclude noncritical dependencies from the “site is down” definition if needed
7) Add a health endpoint
A dedicated endpoint like /health or /ready is useful.
Example:
- Returns
200 OK - Includes basic app status
- Avoids heavy database queries unless you specifically want to check DB connectivity
For example:
{
"ok": true,
"service": "web",
"version": "1.2.3"
}
8) Create a runbook
When a check fails, your team should know what to do:
- Verify the alert is real
- Check logs and metrics
- Confirm whether the issue is global or regional
- Roll back recent deploys if needed
- Document common failure causes
9) Test your monitoring
After setup:
- Temporarily point a check to a bad URL
- Bring down a test endpoint
- Confirm you receive alerts
- Confirm the alert contains enough detail to diagnose the issue
Example simple setup
If you want a very basic start:
- Create a
/healthendpoint - Use UptimeRobot or Better Stack
- Check it every 1 minute from 3 locations
- Alert via Slack and email
- Add a browser check for your login flow
If you want to DIY
A simple cron + script approach:
- Use
curlor a small Python/Node script - Run every minute from a server outside your production environment
- Log failures
- Send alerts via email or Slack webhook
Example curl check:
curl -fsS --max-time 10 https://example.com/health
If you want, I can help you set this up for a specific stack like AWS, Cloudflare, Kubernetes, Prometheus, or a Node/Python app.