Learn how to continuously make sure that your Actors and tasks perform as expected and retrieve correct results. Receive alerts when your jobs or their metrics are not as you expect.
The web is continuously evolving, and so are the websites you interact with. If you implement Apify Actors or the data they provide into your daily workflows, you need to make sure that everything runs as expected.
Monitoring allows you to track and observe how the software works. It enables you to measure and compare your programs' performance over time and to be notified when something goes wrong.
Also, you can use the data you gain from monitoring to optimize your software and maximize its potential.
Built in monitoring
Monitoring is an option you can find on any Actor or saved task in Apify Console. It allows you to display metric statistics about your solution's runs and set up alerts for when your solution behaves differently than you expect.
The monitoring system is free for all users. You can use it to monitor as many Actors and tasks as you want, and it does not use any additional resources on top of your usage when running them.
Currently, the monitoring option offers the following features:
Chart showing statuses of runs of the Actor or saved task over last 30 days.
Chart displaying metrics of the last 200 runs of the Actor or saved task.
Option to set up alerts with notifications based on the run metrics.
Both charts can also be added to your Apify Console home page so you can quickly see if there are any issues every time you open Apify Console.
When you set up an alert, you have two choices for how you want the metrics to be evaluated. And depending on your choices, the alerting system will behave differently:
Alert, when the metric is lower than - This type of alert is checked after the run finishes. If the metric is lower than the value you set, the alert will be triggered and you will receive a notification.
Alert, when the metric is higher than - This type of alert is checked both during the run and after the run finishes. During the run, we do periodic checks (approximately every 5 minutes) so that we can notify you as soon as possible if the metric is higher than the value you set. After the run finishes, we do a final check to make sure that the metric does not go over the limit in the last few minutes of the run.
You can get notified by email, Slack, or in Apify Console. If you use Slack, we suggest using Slack notifications instead of email because they are more reliable, and you can also get notified quicker.
- Email - You can set up one or more emails to receive alert notifications. To do that, you just have to separate them by commas. You can also disable email notifications if you don't want to receive them.
- Slack - To set up Slack notifications, you first need to connect your Slack workspace to Apify. To do that, go to your account integration settings and click on the + Add workspace button in the Slack section. Once you have your workspace connected, you can choose the workspace when setting up alert notifications and then pick a channel to which you want the notifications to be delivered.
- In Console - You can also get notified in Apify Console. This is useful if you access Apify Console often, and you do not need to be notified as soon as possible.
The email and Slack alert notifications both contain the same information. You will receive a notification with the following information:
- Alert name
- Condition - The condition that was violated.
- Value - The value of the metric violating the condition and triggering the alert.
- Run ID - The ID of the run that triggered the alert, which links directly to the run detail in Apify Console.
- Actor - The full name of the Actor that triggered the alert which links to the Actor detail in Apify Console.
- Task - If the monitoring alert was set up for a task, then this field will contain the name of the task which links to the task detail in Apify Console.
While the in-app notification will contain less information, it will point you directly to the Actor or task that triggered the alert:
What should I monitor when scraping?
There are many metrics you might want to monitor when you are scraping the web. Here are some examples:
- Number of results returned by your solution. This is useful if you are scraping a list of products, for example. You can set up an alert to notify you if the number of results is lower than expected. Which indicates that something changed on the website you are scraping.
- Number of fields returned. This is something that indicates a change in the website. For example, the manufacturer name moved to another place.
- Duration of the run. If your solution is taking longer than usual to finish, you can set up an alert to notify you. This will help you prevent your solution from being stuck and from wasting resources.
Usage and cost:
- Usage cost may change when the robot blocking solution gets implemented. An increase of the cost may indicate that many URLs are being retried.
- Proxy usage. Seeing how your solution uses a proxy and if there are any changes can help you optimize your usage and prevent increased costs if your solution starts behaving differently than expected.
These are just a few examples of what you can monitor. It's always recommended to start small, iterate, and get more complex over time based on your experience.
For more complex monitoring, you can use the monitoring suite, which is a collection of Apify Actors that allows you to automate the monitoring of jobs you have running on the Apify platform. The monitoring suite offers some features that are not currently available in Apify Console, such as:
- Schema validation of the output
- Duplicate checks in the output
- Dashboards with data grouping
- Daily/weekly/monthly monitoring instead of after every run
Please note that this solution is more complex and requires more time to set up. Also, it uses schedules, Actors, tasks, and webhooks, so using it will increase your overall usage on the Apify platform.