chore(issues): Log warning instead of exception#101368
Merged
Merged
Conversation
We raise an exception when failing to parse a Snuba response, there is no need to also log an exception here since it otherwise results in 2 separate errors being logged for the same problem. Fixes SENTRY-5AGR
Contributor
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: src/sentry/utils/snuba.py
|
JoshFerge
approved these changes
Oct 10, 2025
| except ValueError: | ||
| if response.status != 200: | ||
| logger.exception( | ||
| logger.warning( |
Contributor
There was a problem hiding this comment.
Bug: Log Level Downgrade Masks Parsing Errors
Changing logger.exception() to logger.warning() for Snuba JSON parsing ValueErrors loses the original traceback and error details. This also downgrades the log level from ERROR to WARNING, potentially breaking monitoring and making these parsing failures much harder to debug.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #101368 +/- ##
===========================================
+ Coverage 80.86% 81.01% +0.15%
===========================================
Files 8696 8696
Lines 385725 385736 +11
Branches 24381 24381
===========================================
+ Hits 311898 312509 +611
+ Misses 73459 72859 -600
Partials 368 368 |
chromy
pushed a commit
that referenced
this pull request
Oct 17, 2025
We raise an exception when failing to parse a Snuba response, there is no need to also log an exception here since it otherwise results in 2 separate errors being logged for the same problem. Fixes SENTRY-5AGR See also SENTRY-5AGQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We raise an exception when failing to parse a Snuba response, there is no need to also log an exception here since it otherwise results in 2 separate errors being logged for the same problem.
Fixes SENTRY-5AGR
See also SENTRY-5AGQ