How healthchecks work

A brief guide to understanding and implementing our healthcheck monitoring system for your background tasks and scheduled jobs.

Healthchecks provide a way to monitor your scheduled tasks, cron jobs, and background processes. The system works on a simple principle: your task pings our endpoint when it completes successfully, and we alert you if we don't receive the expected ping.

Basic Concept

1. You register a healthcheck in your dashboard

2. We provide you with a unique URL endpoint

3. Your task or script pings this URL upon completion

4. If we don't receive a ping within the expected timeframe, we send an alert

Configuration Options

Expected Frequency

You define how often your task should run and ping our endpoint. This could be every minute, hourly, daily, or on a custom schedule.

Grace Period

The grace period is additional time allowed after the expected ping time before an alert is triggered. This accommodates tasks that might take variable amounts of time to complete.

Implementation Examples

For a bash script:

#!/bin/bash
# Your task logic here
# Ping healthcheck when done
curl https://example.com/ping/your-unique-id

For a Python script:

import requests
import time
# Your task logic here
# Ping healthcheck when done
requests.get('https://example.com/ping/your-unique-id')

Alert Notifications

When a healthcheck fails (no ping received within the expected time plus grace period), it creates an Incident on Monitodo, which can be chosen to display a notice on any status page and will alert you according to the team's chosen notification method.

Best Practices

• Set realistic frequencies and grace periods

• Implement healthchecks for all critical background processes

• Use descriptive names for your healthchecks to easily identify them

• Test your implementation by temporarily disabling the ping to ensure alerts work correctly


Did this answer your question?