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

treestatus: convert logging of Treestatus API errors to info level (Bug 1897044) #204

Merged
merged 2 commits into from
May 16, 2024

Conversation

cgsheeh
Copy link
Member

@cgsheeh cgsheeh commented May 16, 2024

The error and exception level logging calls cause Sentry to treat
expected states as new issues. Lower the level to info to quiet down
Sentry. Issues experienced by the Treestatus API will still show up in
the LandoAPI logs, and at the info level we can still debug which
code paths are taken by various requests.

…(Bug 1897044)

The `error` and `exception` level logging calls cause Sentry to treat
expected states as new issues. Lower the level to `info` to quiet down
Sentry. Issues experienced by the Treestatus API will still show up in
the LandoAPI logs, and at the `info` level we can still debug which
code paths are taken by various requests.
@cgsheeh cgsheeh requested a review from zzzeid May 16, 2024 01:56
@@ -227,13 +227,13 @@ def treestatus_tree(tree: str):
raise

error = f"Error received from LandoAPI: {exc.detail}"
logger.error(error)
logger.info(error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for this one, given that we've identified that there are lots of 404s due to spam, we should probably just return a 404 immediately (and not redirect or flash a message) in that case. Otherwise we may still be flooding the logs with useless data.

@cgsheeh cgsheeh requested a review from zzzeid May 16, 2024 13:27
Copy link
Contributor

@zzzeid zzzeid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think the abort(404) could work better for that particular instance, since we can stop the code early and we don't really know what the referrer is necessarily. I don't think it's very important in this case though, as we are porting this soon to Django.

@cgsheeh cgsheeh merged commit 80abbcb into mozilla-conduit:main May 16, 2024
1 check passed
@cgsheeh cgsheeh deleted the treestatus-info-log branch May 16, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants