Skip to content

feat(sqllab): log error_detail on fetch failed - #23377

Merged
justinpark merged 3 commits into
apache:masterfrom
justinpark:feat--add-logging-for-sqllab-fetch-query
Mar 20, 2023
Merged

justinpark merged 3 commits into
apache:masterfrom
justinpark:feat--add-logging-for-sqllab-fetch-query

Conversation

@justinpark

Copy link
Copy Markdown
Member

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:

Screenshot 2023-03-14 at 1 50 16 PM

Before:
N/A

TESTING INSTRUCTIONS

Run any error query like SELECT unknowncolumn in sqllab
and then check the network tab for the logging event data

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov

codecov Bot commented Mar 15, 2023 •

Copy link
Copy Markdown

Codecov Report

Merging #23377 (7e0dba6) into master (db95a93) will increase coverage by 0.05%.
The diff coverage is 78.99%.

❗ Current head 7e0dba6 differs from pull request most recent head 3faa852. Consider uploading reports for the commit 3faa852 to get more accurate results

@@            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     
Flag Coverage Δ
javascript 53.84% <80.26%> (+0.09%) ⬆️
sqlite ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...-core/src/hooks/useChangeEffect/useChangeEffect.ts 100.00% <ø> (ø)
...hooks/useComponentDidMount/useComponentDidMount.ts 100.00% <ø> (ø)
...oks/useComponentDidUpdate/useComponentDidUpdate.ts 100.00% <ø> (ø)
...src/hooks/useElementOnScreen/useElementOnScreen.ts 100.00% <ø> (ø)
...erset-ui-core/src/hooks/usePrevious/usePrevious.ts 100.00% <ø> (ø)
...re/src/hooks/useTruncation/useCSSTextTruncation.ts 100.00% <ø> (ø)
...c/hooks/useTruncation/useChildElementTruncation.ts 100.00% <ø> (ø)
...chart-echarts/src/Timeseries/Area/controlPanel.tsx 40.00% <ø> (ø)
...charts/src/Timeseries/Regular/Bar/controlPanel.tsx 35.71% <ø> (ø)
...harts/src/Timeseries/Regular/Line/controlPanel.tsx 33.33% <ø> (ø)
... and 72 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';

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

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

Comment on lines +277 to +297
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,
}),
);
}
});

@michael-s-molina michael-s-molina Mar 17, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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,
}),
);
});
});

@justinpark

Copy link
Copy Markdown
Member Author

@michael-s-molina I updated as you commented. Please take a look for updates

@michael-s-molina michael-s-molina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@justinpark
justinpark merged commit 3277ea8 into apache:master Mar 20, 2023
justinpark added a commit to airbnb/superset-fork that referenced this pull request Mar 23, 2023
justinpark added a commit to airbnb/superset-fork that referenced this pull request Mar 31, 2023
justinpark added a commit to airbnb/superset-fork that referenced this pull request Apr 5, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 First shipped in 3.0.0 labels Mar 13, 2024
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 3.0.0 First shipped in 3.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants