Skip to content
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

[ML] Add Lens and Discover integration to index based Data Visualizer #89471

Merged
merged 22 commits into from
Feb 5, 2021

Conversation

qn895
Copy link
Member

@qn895 qn895 commented Jan 27, 2021

Summary

Part of #86387. This PR brings:

  • A new card that will link the index to Discover
  • A way for users to directly visualize the fields in the Lens app (currently supports date, number, IP, and keyword fields)

Screen Shot 2021-01-27 at 12 50 35

lens

  • Small fix for Maps to auto zoom correctly

Checklist

Delete any items that are not applicable to this PR.

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

Good to have functional tests as part of this PR! 🎉 Left a few comments.
Additionally, we might want to add the new features to the permission tests and would also like to validate some discover and lens page content. I'll take a closer look and report back with more details.

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

I've noticed that when I open Discover in the same browser tab, it correctly applies the selected time range. But opening the Discover link in a new browser tab falls back to Last 15 minutes. Not sure if this can be fixed on our side.

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested latest edits - looks good overall. Just one more edit needed for date field types I think.

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

Great to see the added permission tests and the trial / basic license test split!

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

For the extended Discover checks:
We already validate that Discover displays the query as expected. IMO it would be good to also add a second assertion for the hit count of that discover page. That way we can be sure that data is loaded as expected. I've created an example, how this could look like.

For the Lens link validation:
I'd suggest to have a separate test file, because it would interrupt the existing index_data_visualizer tests badly. I think this would be good to have in a follow-up PR because it will require some additional work.
What do you think @peteharverson ?

@peteharverson
Copy link
Contributor

Adding the hit count assertion for the Discover drilldown looks like it is worth including in this PR @pheyos.

Adding new tests for the Lens link in a follow-up PR is sensible. Would be great to have even some basic validation that expected content is displayed in the Lens page.

import { CombinedQuery } from '../../../common';

export function getActions(
indexPattern: IndexPattern,
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it should be IIndexPattern interface instead

Copy link
Contributor

Choose a reason for hiding this comment

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

note: we should replace all IndexPattern imports with IIndexPattern later because otherwise, this class end up in our bundle

@qn895
Copy link
Member Author

qn895 commented Jan 29, 2021

I've noticed that when I open Discover in the same browser tab, it correctly applies the selected time range. But opening the Discover link in a new browser tab falls back to Last 15 minutes. Not sure if this can be fixed on our side.

Thanks! Good catch. I added timeRange as well as the refreshInterval to the link now so the time range should be consistent, even in a new tab.

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested latest edits for date fields and the Discover 'open in new tab' behavior, and LGTM

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

Open Discover in new tab works well now for me and the extended Discover checks are looking good! Just one comment around the trial/basic test split:

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

Tested and functional tests LGTM

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

LGTM

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
ml 1739 1741 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ml 6.6MB 6.6MB +9.0KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
ml 57.1KB 57.1KB +23.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants