[perf_logging] Add is_cached status when chart has error (#9009)

This commit is contained in:
Grace Guo 2020-01-23 17:05:39 -08:00 committed by GitHub
parent d3d8603620
commit d0bc04fc93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -259,11 +259,12 @@ export function exploreJSON(
return dispatch(chartUpdateSucceeded(json, key));
})
.catch(response => {
const appendErrorLog = errorDetails => {
const appendErrorLog = (errorDetails, isCached) => {
dispatch(
logEvent(LOG_ACTIONS_LOAD_CHART, {
slice_id: key,
has_err: true,
is_cached: isCached,
error_details: errorDetails,
datasource: formData.datasource,
start_offset: logStart,
@ -283,7 +284,8 @@ export function exploreJSON(
return dispatch(chartUpdateStopped(key));
}
return getClientErrorObject(response).then(parsedResponse => {
appendErrorLog(parsedResponse.error);
// query is processed, but error out.
appendErrorLog(parsedResponse.error, parsedResponse.is_cached);
return dispatch(chartUpdateFailed(parsedResponse, key));
});
});