fix(screenshots): downgrade screenshot timeout logs from ERROR to WARNING#38130
fix(screenshots): downgrade screenshot timeout logs from ERROR to WARNING#38130aminghadersohi wants to merge 1 commit intoapache:masterfrom
Conversation
…NING Selenium timeout exceptions during screenshot generation are expected operational behavior (slow-loading dashboards, network latency, etc.) and not actual server errors. These were being logged at ERROR level via logger.exception(), creating noise in log aggregators like Datadog. Changes: - webdriver.py: Change logger.exception() to logger.warning() for all three timeout scenarios (page load, dashboard draw, chart load) - webdriver.py: Fix bare except clause to use except Exception - webdriver.py: Reorder outer except blocks so specific exceptions (TimeoutException, StaleElementReferenceException, WebDriverException) are caught before the generic Exception handler (previously unreachable) - dashboards/api.py: Downgrade logger.error() to logger.warning() in the thumbnail endpoint's catch-all handler that returns 404 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review Agent Run #3711ceActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #38130 +/- ##
===========================================
+ Coverage 0 66.43% +66.43%
===========================================
Files 0 670 +670
Lines 0 51441 +51441
Branches 0 5803 +5803
===========================================
+ Hits 0 34177 +34177
- Misses 0 15869 +15869
- Partials 0 1395 +1395
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
SUMMARY
Selenium timeout exceptions during screenshot generation are expected operational behavior (slow-loading dashboards, network latency, etc.) and not actual server errors. These were being logged at ERROR level via
logger.exception(), creating significant noise in log aggregators like Datadog.Changes:
webdriver.py: Changelogger.exception()tologger.warning(..., exc_info=True)for all three timeout scenarios (page load, dashboard draw, chart load)webdriver.py: Fix bareexcept:clause to useexcept Exception:webdriver.py: Reorder outer except blocks so specific exceptions (TimeoutException,StaleElementReferenceException,WebDriverException) are caught before the genericExceptionhandler — previously these were unreachable dead codedashboards/api.py: Downgradelogger.error()tologger.warning()in the thumbnail endpoint's catch-all handler that returns 404 (inconsistent to log ERROR for a 404 response)BEFORE/AFTER SCREENSHOTS OR COVERAGE URL
N/A - logging level changes only, no UI impact.
TESTING INSTRUCTIONS
ScreenshotImageNotAvailableExceptionstill returns 404 properlypytest tests/unit_tests/utils/webdriver_test.py(16/17 pass - the 1 failure is pre-existing in Playwright test, unrelated to these changes)ADDITIONAL INFORMATION
[remove]exclusion filters for selenium timeout errorsexcept Exceptioncaught everything before the more specific handlers, making them dead codelogger.warning(..., exc_info=True)preserves the full stack trace for debugging while correctly classifying the severity🤖 Generated with Claude Code