# Cron Monitoring

Source: https://instatus.com/help/monitoring/cron

Cron monitors give each scheduled job (a backup, batch process or recurring script) a unique URL to ping, and alert you when a ping is late or missing. The job is marked degraded when it misses its period and down when it also misses the grace time.

Just like with [other monitors](https://instatus.com/help/monitoring), when a cron job fails, you can collaborate with your team to [resolve the incident](https://instatus.com/help/incident-response) and optionally update your [status page](https://instatus.com/help/status-page).

| At a glance | Details |
| :-- | :-- |
| [How it works](https://instatus.com/help/monitoring/cron#monitor-type) | Your job pings a unique URL each time it runs |
| [Period time](https://instatus.com/help/monitoring/cron#monitor-is-successful-if) | How often the job should run |
| [Grace time](https://instatus.com/help/monitoring/cron#monitor-is-successful-if) | Extra time before a late job is marked down |
| [Late ping](https://instatus.com/help/monitoring/cron#monitor-is-successful-if) | Degraded after the period, down after the grace time |
| [Failure signal](https://instatus.com/help/monitoring/cron#signaling-a-failure) | Request the URL with /fail appended |
| [Execution time](https://instatus.com/help/monitoring/cron#measuring-job-execution-time) | Ping /start when the job begins, the URL when it ends |

Here’s an example of how your cron monitor list looks:

![List of cron monitors](https://instatus.com/help/monitors/cron-list.png)

## What does a cron monitor do?

- Verify that your cron jobs run on time (using pings from your jobs).
- Get alerted if a job is late or doesn't finish.
- Integrate with Slack, email, SMS, phone calls, and more for alerts.

When you click on a cron monitor, you can see more details:

![Cron monitor details](https://instatus.com/help/monitors/cron-item.png)

## How do I add a cron monitor?

Go to your project → Monitors → Add monitor, choose **Cron/Heartbeat**, then point your job at the generated URL and set its period and grace time.

![Add monitor](https://instatus.com/help/monitors/cron-add.png)

### Monitor type

Select **Cron/Heartbeat** as the monitor type.

![Cron monitor type](https://instatus.com/help/monitors/type-cron.png)

A unique URL will be generated for you. Your cron job should send an HTTP request (`HEAD`, `GET` or `POST`) to this URL each time it runs.

### Monitor is successful if

A cron monitor succeeds when your job pings the generated URL on schedule. You can configure:

- **Period time:** How often the job should run (e.g. every 15 minutes).
- **Grace time:** Extra time allowed before the job is considered down.

If the period time is reached and the job doesn't ping, the monitor will be marked as degraded.

If the grace time is reached and the job doesn't ping, the monitor will be marked as down.

You can set up [alerts](https://instatus.com/help/monitoring/alerts) to get notified when a job fails, degrades or recovers.

## Signaling a failure

Send a request to the monitor’s URL with `/fail` appended to mark the job as failed, even if it ran and pinged the monitor.

This is useful if your script encounters an error and you want Instatus to record the job as failed right away.

- **Success ping**: `https://cron.instatus.com/your-unique-url`
- **Failure ping**: `https://cron.instatus.com/your-unique-url/fail`

When a failure signal is received, the monitor will be marked as down, and alerts will be sent immediately according to your [alert settings](https://instatus.com/help/monitoring/alerts).

## Measuring job execution time

Send two requests, `/start` when your job begins and the success or failure ping when it ends, and Instatus records the time between them as the job's execution time:

1. **Start signal**: Send a request to `/start` when your job begins
2. **Success/Failure signal**: Send a request to the base URL when your job completes or fails

- **Start ping**: `https://cron.instatus.com/your-unique-url/start`
- **Success ping**: `https://cron.instatus.com/your-unique-url`
- **Failure ping**: `https://cron.instatus.com/your-unique-url/fail`

The time between the start and success signals will be recorded as the job's execution time. This helps you track performance and identify jobs that are taking longer than expected.

If your job fails after sending the start signal, send a failure signal instead of the success signal to mark it as failed while still recording the execution time.

Congrats, you've added your first cron monitor!

- [Ping Monitors](https://instatus.com/help/monitoring/ping): Learn how to monitor your ping endpoints for uptime and performance
