-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Lens][TSVB][Agg based] TSDB warning handling support for Lens, Agg based and TSVB #136833
Conversation
…pported functions
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
@flash1293 thanx a ton for the guidelines! I have selected median but the warning displays percentiles Update: If I select percentile_ranks though the warning is correct 🤔 |
@stratoula that's expected - if you check the request then you'll see that Elasticsearch doesn't have a special "median" agg - it was a percentiles agg with a single percentage 50 the whole time:
|
Hahaha got it! Thanx Joe! Finishing some more tests and approving (I love the image btw :D ) |
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.
Code LGTM! This works great! I have tested all the editors following the steps. Love the bonus too ;)
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.
@flash1293: I've left you some comments below for your review.
Additionally, I was curious about that shard failure modal you showed. Is this modal something that we created/control? If so, why the decision to put this content in an EuiModal
versus an EuiFlyout
? I imagine that a flyout is far more scalable for this sort of content content, which has the potential to get fairly lengthy (since flyouts natively support scrolling).
Also, I found the contents of that modal to be a bit confusing. It almost looks as though "Reason" is being listed multiple times for each entry (table column, bold text in open accordion, row in open accordion), with the last being a different message than the first two. Are they supposed to all be the same? If so, why are we showing it three times?
.../plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/warnings_popover.scss
Outdated
Show resolved
Hide resolved
Thanks for the review @MichaelMarcialis . Shard failure modalThis component existed before and wasn't changed on this PR. I see your point about turning it into a flyout, but I would like to split this out. The component is owned by the app services team. Inline warningThe notification badge was just some random idea - I like your suggestion. This is how it looks: Could you review again? |
…-ref HEAD~1..HEAD --fix'
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.
Thanks for making those changes, @flash1293. Left one additional question/comment for you, but nothing earth-shattering. Approving now so I don't hold you up further.
<div style={{ maxWidth: 512 }}> | ||
{warnings.map((w, i) => ( | ||
<React.Fragment key={i}> | ||
{w} | ||
<br /> | ||
</React.Fragment> | ||
))} | ||
</div> |
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.
Are these warnings just being nested in a div
in the warning popover, and using a br
to space them out? If so, would it be better to house each warning item in something like an EuiText and use some CSS padding and borders to separate each warning in the list? That way it looks similar to how warnings were intended to look in the Lens warning menu.
Old warning popover mockup:
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
History
To update your PR or re-run it, just comment with: |
…ased and TSVB (elastic#136833) * start integrating TSDB into Lens * current state * make new type filter work * fix translations * handle warnings * clean up and make warnings better * split function list for referenced fields too and extend list of unsupported functions * improve warnings * fix a bug * add todo for utc timezone * adding TSDB support to DataViews * adding test * date_histogram: force fixed interval for tsdb rollups * fixing types * fixing types * fixing types * fixing types * handling edge cases * removing undefined entries from FieldSpec * renaming .meta property * enforce UTC timezone * isRolledUpField helper * updating snapshot * adjust fixed interval and utc timezone for timelion and tsvb * fixed interval mapping * fixing test * add showWarning to search service * add comments * add unit tests * test foo * cleanup * add s to property name in test * comments for api items * fixing test * use the warnings when calling showWarnings * change showWarning to just show a single warning * put handleWarnings on the request adapter * comment * simplify 1 * fix lens unit test * fix PR * remove duplicate identifier * remove underscoring for unused variables * revert inspector changes, extract the response warnings in the search service * fix bug * remove console.log * re-apply typescript fixes to app test code * declutter * add test, improve comments * fix some unexported public api items * include rawResponse in the warning structure * fix lint * tweak clean up example app * SearchResponseWarnings and SearchResponseWarningNotification * fix export bug * not include shardStats if there are no warnings * Update src/plugins/data/common/search/types.ts * fix duplicated entries * remove empty line * simplify SearchResponseWarnings interface * remove array copying * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * comments for api_docs * simplify per feedback * Pass callback to handleResponse in showWarnings * export more public types * update example to make possible to show shard failure * pr cleanup * eslint fix * allow example app to not show default warnings * move extractWarning and related types to inspector plugin * wip functional test of example app * fix test references * finish functional test * relocate extractWarnings back to search/fetch * fix test * remove need for isTimeout, isShardFailure * ts fix * improve test * Change showWarnings to accept the RequestAdapter * use showWarnings in vis_types/timeseries * more tests * use handle_warning name * fix ts * add reason field to SearchResponseWarning * fix component snapshot * update comments * test cleanup * fix test * ensure notification appears only once * fix and cleanup * fix ts * fix response.json bug * use top-level type, and lower-level reason.type * cleanup * change warning structure * change warning infrastructure * fix * allows to disable automatic handling of shard warnings on expressions * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * fix tests * fix tsconfig json * allows to disable automatic handling of shard warnings on expressions * fix tests * allows to disable automatic handling of shard warnings on expressions * disable warnings the right way * fix stuff and clean up * random cleanup * fix test * remove unused function * review comments * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * style warnings and switch to real error message Co-authored-by: ppisljar <[email protected]> Co-authored-by: Timothy Sullivan <[email protected]> Co-authored-by: Tim Sullivan <[email protected]> Co-authored-by: kibanamachine <[email protected]>
Fixes #132045
Bonus (because it's very easy to do with the new warning handling): Do not show warnings anymore for suggestions. In almost all cases they are just repeating the warnings from the main chart, rendering the config panel unusable and not adding any meaningful information.
How to test
sample-01
for testing TSDB without rollups and a data viewsample-01,sample-01-rollup
for testing TSDB with rollupsBehavior
In the Lens editor, rollup errors are shown as warnings in the existing warning menu. Lens warnings get a nice message explaining what's going on.
On dashboard, a warning indicator is rendered in the bottom right of the vis
For TSVB and agg based, the warning indicator is rendered both in the editor and on the dashboard. The error message coming from Elasticsearch is not rewritten in the context of the chart.
If there are other shard failures than rollup related ones, the existing warning toast is still shown (in this case the shard failures modal is also including the failures originating from rollup if both are happening at the same time)
To cause the other shard failures, extend the data view to include another index name besides
sample-01
andsample-01-rollup
, then index a document which auto-sets a used number field to text, e.g. like this:This will cause a generic illegal argument exception which should not be handled locally.
Implementation details
Previously the warning toasts would be shown by the esaggs function implementation automatically. This PR changes this in the following way:
disableShardWarnings
to the search contextshowWarnings
with the adapters and pass a callback which filters out rollup-related warningsDue to this, the way shard failure warnings can be suppressed for TSVB needs to be changed:
handleWarnings
from within the TSVB request handler anymore - the visualize embeddable does that alreadysuppressWarnings
function to the vis type definition which is checked in the embeddable whether the warning should be shown or not