diff --git a/api/api/utils/check_dead_links/__init__.py b/api/api/utils/check_dead_links/__init__.py index f9abc9de4a..ef602d5b69 100644 --- a/api/api/utils/check_dead_links/__init__.py +++ b/api/api/utils/check_dead_links/__init__.py @@ -17,7 +17,7 @@ logger = structlog.get_logger(__name__) - +head_logger = structlog.get_logger(f"{__name__}._head") CACHE_PREFIX = "valid:" HEADERS = { @@ -57,7 +57,7 @@ async def _head( status = response.status except (aiohttp.ClientError, asyncio.TimeoutError) as exception: if not isinstance(exception, asyncio.TimeoutError): - logger.error("dead_link_validation_error", e=exception) + head_logger.error("dead_link_validation_error", e=exception) status = _ERROR_STATUS else: status = _TIMEOUT_STATUS diff --git a/api/conf/settings/sentry.py b/api/conf/settings/sentry.py index 6413078610..428eb6dee3 100644 --- a/api/conf/settings/sentry.py +++ b/api/conf/settings/sentry.py @@ -30,3 +30,6 @@ # code, which can be registered by Sentry and obscure the underlying reason # why 5xx response was returned in the first place. ignore_logger("django_structlog.middlewares.request") + # These errors can occur in large volumes and so we don't want them to fill + # up in Sentry and overwhelm us with Slack notifications. + ignore_logger("api.utils.check_dead_links._head")