-
Notifications
You must be signed in to change notification settings - Fork 14k
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
feat(sqllab): log error_detail on fetch failed #23377
feat(sqllab): log error_detail on fetch failed #23377
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 |
@@ -32,6 +32,8 @@ import { | |||
} 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 unknowncolumn
in sqllaband then check the network tab for the logging event data
ADDITIONAL INFORMATION