Repository navigation
feat(sqllab): log error_detail on fetch failed - #23377
justinpark merged 3 commits into
Conversation
Codecov Report
@@ Coverage Diff @@
## master #23377 +/- ##
==========================================
+ Coverage 65.91% 65.97% +0.05%
==========================================
Files 1907 1907
Lines 73453 73596 +143
Branches 7976 7982 +6
==========================================
+ Hits 48420 48552 +132
- Misses 22983 22996 +13
+ Partials 2050 2048 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| } from 'src/components/MessageToasts/actions'; | ||
| import { getClientErrorObject } from 'src/utils/getClientErrorObject'; | ||
| import COMMON_ERR_MESSAGES from 'src/utils/errorMessages'; | ||
| import { LOG_ACTIONS_SQLLAB_FETCH_QUERY } from 'src/logger/LogUtils'; |
There was a problem hiding this comment.
Could we make the event type more explicit like LOG_ACTIONS_SQLLAB_FAILED_QUERY? This would help when interpreting the event and also remove the need for the has_err attribute.
There was a problem hiding this comment.
I followed this way as LOG_ACTIONS_RENDER_CHART implemented using has_err attribute but I agree with your idea to have a dedicated logging type name.
Let me update accordingly
| errors?.forEach(({ error_type: errorType, extra }) => { | ||
| if (extra?.issue_codes) { | ||
| extra?.issue_codes.forEach(({ message }) => { | ||
| dispatch( | ||
| logEvent(LOG_ACTIONS_SQLLAB_FETCH_QUERY, { | ||
| ...eventData, | ||
| error_type: errorType, | ||
| error_details: message, | ||
| }), | ||
| ); | ||
| }); | ||
| } else { | ||
| dispatch( | ||
| logEvent(LOG_ACTIONS_SQLLAB_FETCH_QUERY, { | ||
| ...eventData, | ||
| error_type: errorType, | ||
| error_details: errorType, | ||
| }), | ||
| ); | ||
| } | ||
| }); |
There was a problem hiding this comment.
| errors?.forEach(({ error_type: errorType, extra }) => { | |
| if (extra?.issue_codes) { | |
| extra?.issue_codes.forEach(({ message }) => { | |
| dispatch( | |
| logEvent(LOG_ACTIONS_SQLLAB_FETCH_QUERY, { | |
| ...eventData, | |
| error_type: errorType, | |
| error_details: message, | |
| }), | |
| ); | |
| }); | |
| } else { | |
| dispatch( | |
| logEvent(LOG_ACTIONS_SQLLAB_FETCH_QUERY, { | |
| ...eventData, | |
| error_type: errorType, | |
| error_details: errorType, | |
| }), | |
| ); | |
| } | |
| }); | |
| errors?.forEach(({ error_type: errorType, extra }) => { | |
| const messages = extra?.issue_codes.map(code => code.message) || [errorType]; | |
| messages.forEach(message => { | |
| dispatch( | |
| logEvent(LOG_ACTIONS_SQLLAB_FETCH_QUERY, { | |
| ...eventData, | |
| error_type: errorType, | |
| error_details: message, | |
| }), | |
| ); | |
| }); | |
| }); |
|
@michael-s-molina I updated as you commented. Please take a look for updates |
This reverts commit 531ab0d.
SUMMARY
This commit adds a logging event for fetch failed in sqllab in order to measure the impact of troubleshooting.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After:
Before:
N/A
TESTING INSTRUCTIONS
Run any error query like
SELECT unknowncolumnin sqllaband then check the network tab for the logging event data
ADDITIONAL INFORMATION