A Scrapy extension for integration of Sentry SDK to Scrapy projects.
This package provides a Scrapy extension for convenient initialization of Sentry SDK.
pip install scrapy_sentry_sdk
To use the extension add the following to you project settings.py
:
# Send exceptions to Sentry
# replace SENTRY_DSN by you own DSN
SENTRY_DSN = "XXXXXXXXXX"
# Optionally, additional configuration options can be provided
SENTRY_CLIENT_OPTIONS = {
"release": "you-project@version" # these correspond to the sentry_sdk.init kwargs
}
# Enable or disable extensions
# See https://doc.scrapy.org/en/latest/topics/extensions.html
EXTENSIONS = {
'scrapy_sentry_sdk.extensions.SentryLogging': 1, # Load SentryLogging extension before others
}
Currently, this extension uses two Scrapy settings keys:
SENTRY_DSN
: your project DSN (string, required)SENTRY_CLIENT_OPTIONS
: additional SDK options (dict, optional)
More details on configuring the SDK can be found in Sentry documentation.