Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a separate logger for dead links check that Sentry will ignore #4649

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/api/utils/check_dead_links/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


logger = structlog.get_logger(__name__)

head_logger = structlog.get_logger(f"{__name__}._head")

CACHE_PREFIX = "valid:"
HEADERS = {
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions api/conf/settings/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Loading