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

[One Discover] Fix document comparison mode and the field statistics tab when using Smart Fields #184172

Merged
merged 13 commits into from
Jun 3, 2024

Conversation

Kerry350
Copy link
Contributor

@Kerry350 Kerry350 commented May 23, 2024

Summary

This addresses the bugs listed in #181674 (#181621 and #178970).

Smart Fields are compound fields, as such there is no "real" backing field for them. In these scenarios where we can't use them directly we fall back to the fallbackFields configured for them.

@amyjtechwriter please could you check the copy. I think derived from... would have sounded better, but it felt at odds with the scenario where you might specifically pick a field that is also a fallback field for a smart field.

Reviewer notes

  • There were quite a lot of cross cutting concerns here between the unified-field-list, unified-data-table, core Discover code, discover-utils, and the data_vizualizer plugin for the field statistics table. Where I'd have liked to potentially put more things in the discover-utils it wasn't possible due to circular project references.

  • I've not added any functional tests for now as we'd be adding them to the Observability Logs Explorer which is going to be deprecated in due course. This ties in with part three of [Discover] Smart Fields #181674.

  • A renderFieldName prop has been added to the field statistics table, this seemed to be the least intrusive way forward rather than a new / comprehensive cell rendering change (similar to the external cell renderers).

  • I've used the original fallbackFields configurations but the virtual column components actually render a bit extra. Am I missing anything with regards to potentially extending the fallbackFields definitions?

Screenshots

Screenshot 2024-05-23 at 20 25 57 Screenshot 2024-05-23 at 20 26 21

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@Kerry350
Copy link
Contributor Author

/ci

@Kerry350
Copy link
Contributor Author

/ci

@Kerry350 Kerry350 self-assigned this May 24, 2024
@Kerry350 Kerry350 added Team:obs-ux-logs Observability Logs User Experience Team release_note:fix labels May 24, 2024
@Kerry350 Kerry350 marked this pull request as ready for review May 24, 2024 17:36
@Kerry350 Kerry350 requested review from a team as code owners May 24, 2024 17:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs)

@darnautov darnautov requested a review from qn895 May 27, 2024 12:33
@kertal kertal added the Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. label May 28, 2024
@elasticmachine
Copy link
Contributor

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

@kertal kertal added the Project:OneDiscover Enrich Discover with contextual awareness label May 28, 2024
@Kerry350
Copy link
Contributor Author

Thanks for reviewing @qn895, I think I've actioned all your feedback 🙏

@Kerry350
Copy link
Contributor Author

@elasticmachine merge upstream

@qn895
Copy link
Member

qn895 commented May 29, 2024

Tested and field stats change LGTM 🎉 I recommend investigating why the async chunks increase so much (+17.1KB overall and +7.2KB for Discover) to verify if that's normal/expected before merging.

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.

The changes look good to me overall! I left a couple of minor points of feedback, but nothing major. I agree with @qn895 that we should investigate the bundle size increase a bit since at a glance it doesn't feel like it should have increased by as much as it did 🤔

Also for some reason I'm still getting no results when switching to the field statistics tab in Logs Explorer, but I see that it was working for you. Any idea why?

tabs.mp4

/**
* An optional prop to provide awareness of additional field groups when paired with the Unified Field List.
*/
additionalFieldGroups?: AdditionalFieldGroups;
Copy link
Contributor

Choose a reason for hiding this comment

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

I see what you mean about the cross cutting concerns. It would be great it we didn't have to pass info like this around so much, but I unfortunately don't have a better suggestion either atm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I couldn't really think of anything without introducing some sort of new package / plugin and that seemed rather heavy. I think by at least having the type source of truth in one place it makes future changes pretty easy.

packages/kbn-unified-field-list/src/types.ts Outdated Show resolved Hide resolved
@qn895
Copy link
Member

qn895 commented May 30, 2024

Also for some reason I'm still getting no results when switching to the field statistics tab in Logs Explorer, but I see that it was working for you. Any idea why?

@davismcphee I have a theory why and the fix for it. It should be fixed with this PR #180849. I tested this PR with the changes there and verified it works correctly 👍

@Kerry350
Copy link
Contributor Author

Kerry350 commented Jun 1, 2024

@qn895 @davismcphee Thank you both for looking at this 🙏 I've actioned all of your feedback, and this should be good to go.

I'm on PTO next week (and back on the 12th June), I'd love to get this approved and merged on Monday if possible (as I fly on Tuesday). But, if there's any big blockers I can look when I'm back.

The only thing I haven't been able to look at in detail is the async chunk size increase, but I'll add a task to #181674 for when I return.

Copy link
Member

@qn895 qn895 left a comment

Choose a reason for hiding this comment

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

Field stats change LGTM 🎉

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.

Data Discovery changes LGTM 👍 The bundle size increase isn't too significant, so we can definitely follow up on that later to avoid blocking this PR. Thanks for the great work on this, and enjoy your PTO!

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
cloudSecurityPosture 450 678 +228
discover 907 911 +4
eventAnnotationListing 606 610 +4
lens 1471 1475 +4
logsExplorer 594 597 +3
securitySolution 5491 5494 +3
slo 843 846 +3
total +249

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
@kbn/unified-field-list 269 284 +15

Async chunks

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

id before after diff
cloudSecurityPosture 450.5KB 455.5KB +5.0KB
dataVisualizer 757.6KB 757.7KB +61.0B
discover 811.0KB 818.2KB +7.2KB
securitySolution 15.2MB 15.2MB +2.4KB
slo 866.2KB 868.4KB +2.2KB
total +16.8KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/unified-field-list 9 8 -1
Unknown metric groups

API count

id before after diff
@kbn/unified-data-table 151 152 +1
@kbn/unified-field-list 293 313 +20
total +21

async chunk count

id before after diff
cloudSecurityPosture 6 7 +1
discover 23 24 +1
securitySolution 97 98 +1
slo 26 27 +1
total +4

ESLint disabled line counts

id before after diff
@kbn/unified-field-list 16 17 +1

Total ESLint disabled count

id before after diff
@kbn/unified-field-list 16 17 +1

History

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

cc @Kerry350

@Kerry350 Kerry350 merged commit 105ba94 into elastic:main Jun 3, 2024
17 checks passed
@kibanamachine kibanamachine added v8.15.0 backport:skip This commit does not require backporting labels Jun 3, 2024
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 Project:OneDiscover Enrich Discover with contextual awareness release_note:fix Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. Team:obs-ux-logs Observability Logs User Experience Team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants