You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZyteJobsComparisonMonitor is a monitor that compares item_scraped_count from the current job against past jobs from ScrapyCloud.
By default, it will grab #SPIDERMON_JOBS_COMPARISON past jobs, and these jobs can be filtered using:
SPIDERMON_JOBS_COMPARISON_STATES (only keep jobs that have those states)
SPIDERMON_JOBS_COMPARISON_TAGS (only keep jobs with those tags if they are present in the current job too)
This works, but it's common to need more filtering options in practice.
The spider arguments usually affect the item's job count. It's common practice in Scrapy projects to use them to modify what's being crawled. Because of this, it would be nice to support comparing the current jobs against past jobs with the same spider arguments.
Proposal
Add a new SPIDERMON_JOBS_COMPARISON_ARGUMENTS setting to allow ZyteJobsComparisonMonitor to filter by those spider arguments.
This setting's value would be a list of argument names. ZyteJobsComparisonMonitor would then only keep past jobs that have the same argument=value pairs as the current job for all argument names listed in SPIDERMON_JOBS_COMPARISON_ARGUMENTS.
Additionally, there could be a way to compare past jobs with the exact same spider arguments, no more no less, without needing to list them, but that could probably be implemented later.
The text was updated successfully, but these errors were encountered:
Background
ZyteJobsComparisonMonitor is a monitor that compares item_scraped_count from the current job against past jobs from ScrapyCloud.
By default, it will grab
#SPIDERMON_JOBS_COMPARISON
past jobs, and these jobs can be filtered using:SPIDERMON_JOBS_COMPARISON_STATES
(only keep jobs that have those states)SPIDERMON_JOBS_COMPARISON_TAGS
(only keep jobs with those tags if they are present in the current job too)This works, but it's common to need more filtering options in practice.
The spider arguments usually affect the item's job count. It's common practice in Scrapy projects to use them to modify what's being crawled. Because of this, it would be nice to support comparing the current jobs against past jobs with the same spider arguments.
Proposal
Add a new
SPIDERMON_JOBS_COMPARISON_ARGUMENTS
setting to allow ZyteJobsComparisonMonitor to filter by those spider arguments.This setting's value would be a list of argument names. ZyteJobsComparisonMonitor would then only keep past jobs that have the same
argument=value
pairs as the current job for allargument
names listed inSPIDERMON_JOBS_COMPARISON_ARGUMENTS
.Additionally, there could be a way to compare past jobs with the exact same spider arguments, no more no less, without needing to list them, but that could probably be implemented later.
The text was updated successfully, but these errors were encountered: