Put simply, it works like this:
- You configure the pulse with a period and expected parameters.
- The periodic task of any kind sends an HTTP GET request to WebGazer when the task completes.
- You get alerted when the task doesn't send the HTTP request (meaning the task didn't complete), or sends invalid parameters.
For example, let's say you have a database backup cron job, which takes the dump of the database, uploads it to some reliable place (e.g. AWS S3). You can utilize WebGazer's pulse to ensure database backups are done as they are supposed to, and get alerted when the backup somehow fails. Assume this backup task;
- Runs with a 24 hours interval
- Supposed to complete in less than 10 seconds
To monitor the cron job, you just add an HTTP request to be sent to WebGazer at the end of the script. This way, WebGazer gets informed if the script is successfully run, or not. And notifies you when it is not.
For this database backup case, there might be 3 cases:
Script is run, and process is completed successfully in a period shorter than 10 seconds. This is the expected case.
Backup somehow didn't run, or an error happened in the script, and it didn't come up to the HTTP request sending part. So in 24 hours period the request is not delivered, at all.
In this case, WebGazer marks the pulse as down, and triggers alerts.
Script is run, backup successfully happened, but it took more than the anticipated 10 seconds.
In this case, again, WebGazer marks the pulse as down, and triggers alerts.