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

[Discover / Logs] Add new "Saved Search component" #199787

Merged
merged 9 commits into from
Nov 29, 2024

Conversation

Kerry350
Copy link
Contributor

@Kerry350 Kerry350 commented Nov 12, 2024

Summary

Implements https://github.com/elastic/logs-dev/issues/111#issuecomment-2446470635.

This adds a new "Saved Search component". The component is a wrapper around the current Saved Search Embeddable, but uses ReactEmbeddableRenderer directly to render the embeddable outside of Dashboard contexts. It monitors changes to things like index, filters etc and communicates these changes through the embeddable API.

For this PoC two locations were changed to use this component 1) Logs Overview flyout 2) APM Logs tab (when the Logs Overview isn't enabled via advanced settings).

The component itself is technically beyond a PoC, and resides in it's own package. I'd like to get eyes from the Discover folks etc on the approach, and if we're happy I can fix the remaining known issues (apart from the mixing of columns point as I believe this exists on the roadmap anyway) and we can merge this for the initial two replacement points. Thanks Davis 👌.

nonPersistedDisplayOptions is added to facilitate some configurable options via runtime state, but without the complexity of altering the actual saved search saved object.

On the whole I've tried to keep this as clean as possible whilst working within the embeddable framework, outside of a dashboard context.

Known issues

  • "Flyout on flyout" in the logs overview flyout (e.g. triggering the table's flyout in this context). Fixed with enableFlyout option.

  • Filter buttons should be disabled via pills (e.g. in Summary column). Fixed with enableFilters option.

  • Summary (_source) column cannot be used alongside other columns, e.g. log level, so column customisation isn't currently enabled. You'll just get timestamp and summary. This requires changes in the Unified Data Table. Won't be fixed in this PR

  • We are left with this panel button that technically doesn't do anything outside of a dashboard. I don't think there's an easy way to disable this. Won't be fixed in this PR
    Screenshot 2024-11-20 at 11 50 43

Followups

  • The Logs Overview details state machine can be cleaned up (it doesn't need to fetch documents etc anymore). The state machine no longer fetches it's own documents. Some scaffolding is left in place as it'll be needed for showing category details anyway.

Example

Screenshot 2024-11-20 at 12 20 08
Screenshot 2024-11-20 at 12 23 34

@Kerry350 Kerry350 force-pushed the obs-saved-search-embeddable-poc branch 2 times, most recently from 45ae4a7 to c1b0411 Compare November 12, 2024 15:39
@Kerry350 Kerry350 force-pushed the obs-saved-search-embeddable-poc branch from 2cd148a to e6fd5f5 Compare November 20, 2024 12:27
@Kerry350 Kerry350 self-assigned this Nov 20, 2024
@Kerry350 Kerry350 added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team:obs-ux-logs Observability Logs User Experience Team v8.17.0 labels Nov 20, 2024
@Kerry350 Kerry350 marked this pull request as ready for review November 20, 2024 12:34
@Kerry350 Kerry350 requested review from a team as code owners November 20, 2024 12:34
@elasticmachine
Copy link
Contributor

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

@Kerry350 Kerry350 added the backport:version Backport to applied version labels label Nov 20, 2024
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team labels Nov 20, 2024
@elasticmachine
Copy link
Contributor

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

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!)

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

APM changes LGTM

@tonyghiani tonyghiani self-requested a review November 21, 2024 08:32
Copy link
Contributor

@tonyghiani tonyghiani left a comment

Choose a reason for hiding this comment

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

Overall looks good, nice job! I left some minor comments, but it works and I can see there are some pending issues to address in the PR description! I'll give it a second pass once more changes will be added.

@Kerry350 Kerry350 force-pushed the obs-saved-search-embeddable-poc branch from ab8f032 to 5b05acf Compare November 21, 2024 23:08
@Kerry350
Copy link
Contributor Author

@tonyghiani Thanks for the review, I've responded to your feedback 👍

Regarding followups in this PR, there's nothing more to come. The mixing of columns will be handled by the Discover folks, and the top-right panel button was something I just wanted to point out. So this should be considered "done" 👍

Copy link
Contributor

@tonyghiani tonyghiani left a comment

Choose a reason for hiding this comment

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

Thanks for the changes Kerry, 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 overall! I left a few comments, but the only blocking one is related to a new prop on SavedSearchAttributes.

@Kerry350
Copy link
Contributor Author

@davismcphee Thanks for the review 🙏 I've responded to all the feedback, this is ready for another look.

@@ -37,7 +37,8 @@
"lens",
"maps",
"uiActions",
"logsDataAccess"
"logsDataAccess",
"savedSearch",
Copy link
Contributor

Choose a reason for hiding this comment

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

savedSearch is platform shared so does not impact solution independence ✅

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.

Thanks for the updates, and with that this LGTM on the Data Discovery side 👍 Great work, @Kerry350! I'm excited we've gotten to a point where we can rely on Discover directly for these things 🙂

@gbamparop gbamparop added v8.18.0 and removed v8.17.0 labels Nov 29, 2024
@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 29, 2024

💚 Build Succeeded

  • Buildkite Build
  • Commit: 8cd281e
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-199787-8cd281ec855b

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1880 1923 +43
logsShared 703 363 -340
total -297

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/presentation-publishing 192 193 +1
@kbn/saved-search-component - 14 +14
discover 161 166 +5
logsShared 285 287 +2
total +22

Async chunks

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

id before after diff
apm 3.4MB 3.4MB +3.5KB
discover 812.1KB 812.8KB +665.0B
logsShared 423.9KB 334.8KB -89.1KB
total -84.9KB

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/observability-logs-overview 4 5 +1
discover 29 30 +1
total +2

Page load bundle

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

id before after diff
discover 51.1KB 51.1KB +65.0B
logsDataAccess 6.7KB 6.7KB -10.0B
logsShared 175.0KB 174.8KB -255.0B
total -200.0B
Unknown metric groups

API count

id before after diff
@kbn/presentation-publishing 228 229 +1
@kbn/saved-search-component - 15 +15
discover 209 214 +5
logsShared 314 316 +2
total +23

async chunk count

id before after diff
apm 54 55 +1
logsShared 17 16 -1
total -0

History

cc @Kerry350

@Kerry350 Kerry350 removed the request for review from a team November 29, 2024 19:01
@Kerry350
Copy link
Contributor Author

Manually removing obs-knowledge-team for review after the merging of #202010 (for context).

@Kerry350 Kerry350 merged commit b0122f5 into elastic:main Nov 29, 2024
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12091493576

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [Streams] App plugin (#200060)

Manual backport

To create the backport manually run:

node scripts/backport --pr 199787

Questions ?

Please refer to the Backport tool documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:obs-ux-logs Observability Logs User Experience Team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants