All work

Entry 03 of 03

Work

Uptime Monitoring

Check a service on a schedule and report failures

  • Python
  • Requests
  • Cron
Read the walkthrough
  1. Check the health endpoint
  2. Detect a failed response
  3. Send an alert

Overview

I set up a scheduled request to a health endpoint and compare the response with what a healthy service should return. An alert identifies the affected endpoint so the person looking after it knows where to investigate.

What it covers

  • Scheduled health checks
  • Response validation
  • Failure alerts
  • Check history

Monitor a health endpoint

  1. Choose a health endpoint and record the status code and response you expect when the service is working.
  2. Use a scheduled Python request with a timeout to check the endpoint and log the time and result.
  3. Run the check against a deliberately unhealthy test endpoint and verify that the alert identifies the failing service.