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

[data views] Allow data views created on hidden and system indices #168174

Merged
merged 14 commits into from
Oct 13, 2023

Conversation

mattkime
Copy link
Contributor

@mattkime mattkime commented Oct 6, 2023

Summary

Previously, the 'Allow hidden and system indices' advanced option when creating a data view was only a UI convenience. It allowed you to see which hidden and system indices you were matching but they would be would be selected just the same once the data view was loaded. At some point something changed and now there are system and hidden indices that require expandWildcards: hidden to be passed to field caps in order to see anything. allowHidden: boolean is added to the DataView and DataViewSpec and passed through when field caps requests are made.

This is primarily a tool for troubleshooting. For instance, instead of hitting a full data stream across a number of data tiers you can select a specific index to compare its performance.

Closes: #164652

@mattkime mattkime self-assigned this Oct 10, 2023
@mattkime mattkime changed the title allow hidden seems to be working, still needs tests [data views] Allow data views created on hidden and system indices Oct 10, 2023
@mattkime mattkime added Feature:Data Views Data Views code and UI - index patterns before 8.0 Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. release_note:skip Skip the PR/issue when compiling release notes labels Oct 10, 2023
@mattkime mattkime marked this pull request as ready for review October 10, 2023 01:50
@mattkime mattkime requested review from a team as code owners October 10, 2023 01:50
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Code changes LGTM and it worked well when testing, although I encountered something strange when running the functional test. For some reason the test didn't seem to check the "Allow hidden" toggle, but it was still able to find the index and save the data view. I couldn't reproduce while testing though, hidden indices were only showing when the toggle was enabled:

func_test_2.mp4

The test also still succeeded for me when I changed the allowHidden param of PageObjects.settings.createIndexPattern to false, which didn't seem like it should work either.

I also noticed while I was testing that when editing, the advanced settings menu was collapsed, the "Allow hidden" toggle was off, and the index wasn't found in the sources, but I think maybe that's a known issue and unrelated to this PR?
hidden

Approving now since the approach looks good and it worked locally, but might be worth following up on the functional test thing to see if you can reproduce.

@mattkime mattkime enabled auto-merge (squash) October 12, 2023 02:20
@mattkime mattkime requested a review from a team as a code owner October 12, 2023 04:02
Copy link
Contributor

@Ikuni17 Ikuni17 left a comment

Choose a reason for hiding this comment

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

limits.yml

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
data 2549 2554 +5
dataViews 257 262 +5
total +10

Async chunks

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

id before after diff
dataViewEditor 47.7KB 47.8KB +26.0B

Page load bundle

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

id before after diff
dataViews 46.0KB 46.2KB +197.0B
Unknown metric groups

API count

id before after diff
data 3284 3290 +6
dataViews 1041 1048 +7
total +13

History

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

cc @mattkime

@mattkime mattkime merged commit 85d8231 into elastic:main Oct 13, 2023
@kibanamachine kibanamachine added v8.12.0 backport:skip This commit does not require backporting labels Oct 13, 2023
@sorenlouv
Copy link
Member

@mattkime Would it be possible to backport this to 8.11.0?

@mattkime
Copy link
Contributor Author

@sqren Unfortunately due to changes in data view persistence and field caps calls, I think it would be too risky

mattkime added a commit that referenced this pull request Oct 13, 2023
mattkime added a commit that referenced this pull request Oct 16, 2023
…dices" (#168855)

Reverts #168174

Reverting the previous PR - tests passed and the PR appeared to work
because ES is doesn't always enforce 'allowHidden' on hidden indices.
dej611 pushed a commit to dej611/kibana that referenced this pull request Oct 17, 2023
…lastic#168174)

## Summary

Previously, the 'Allow hidden and system indices' advanced option when
creating a data view was only a UI convenience. It allowed you to see
which hidden and system indices you were matching but they would be
would be selected just the same once the data view was loaded. At some
point something changed and now there are system and hidden indices that
require `expandWildcards: hidden` to be passed to field caps in order to
see anything. `allowHidden: boolean` is added to the DataView and
DataViewSpec and passed through when field caps requests are made.

This is primarily a tool for troubleshooting. For instance, instead of
hitting a full data stream across a number of data tiers you can select
a specific index to compare its performance.

Closes: elastic#164652
dej611 pushed a commit to dej611/kibana that referenced this pull request Oct 17, 2023
…dices" (elastic#168855)

Reverts elastic#168174

Reverting the previous PR - tests passed and the PR appeared to work
because ES is doesn't always enforce 'allowHidden' on hidden indices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Data Views Data Views code and UI - index patterns before 8.0 release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data views] support hidden / system indices in data views
8 participants