A step-by-step monitoring tutorial that shows how you can receive notifications when an actor or task run fails or does not return enough results.
You want to be notified when an actor / task does not finish successfully.
This means the notification will be sent whenever the actor or task:
- Fails (finishes with the status FAILED).
- Times out (finishes with status TIMED OUT).
- There are no results or there are fewer results than expected.
For this example, we will use an Instagram Scraper (jaroslavhejlek/instagram-scraper) task which gets a fresh batch of
#puppies photos every day.
Let us say you have created a task named puppies-from-instagram and run it regularly (manually or using a schedule).
If you haven't already, add the monitoring suite to your account.
If you have already added the task, under its Settings tab, give it a name. For example, monitoring-puppies-are-ok, since we're monitoring the puppies-from-instagram task.
We recommend prefixing your monitoring task names with
monitoring-so you could identify them easier.
Next, we will configure the monitoring suite.
Under your task's Input tab, set the Mode dropdown to Create configuration.
Next, open the What you want to monitor section. Give the monitoring suite a name in the Monitoring suite name field, e.g.
In the Type of target: dropdown, select Task, since you will be monitoring an Instagram Scraper task.
Target name patterns should be the name of your task,
Select the Notify me whenever actor/task does not succeed option to receive a report when a run finishes unsuccessfully.
Each of your monitoring suites must have a unique name.
The configuration should look like this:
Let's say you need a minimum number of 100 results.
Open the Validating by a schema section and select the Enable schema validation option.
In the Validation options field, create an object containing a
100as its value. You can also set this number to
1if you want to be notified only when there are no items.
Finally, click the Save & Run button, and you're done.
From now on, you will get a notification to your account's email every time your
puppies-from-instagram task doesn't succeed or returns fewer than 100 items.