Skip to content

[8.x] [Discover / Logs] Add new "Saved Search component" (#199787)#202588

Merged
Kerry350 merged 2 commits intoelastic:8.xfrom
Kerry350:backport/8.x/pr-199787
Dec 3, 2024
Merged

[8.x] [Discover / Logs] Add new "Saved Search component" (#199787)#202588
Kerry350 merged 2 commits intoelastic:8.xfrom
Kerry350:backport/8.x/pr-199787

Conversation

@Kerry350
Copy link
Copy Markdown
Contributor

@Kerry350 Kerry350 commented Dec 2, 2024

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

## Summary

Implements
elastic/logs-dev#111 (comment).

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
👌](elastic/logs-dev#111 (comment)).

`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](https://github.com/user-attachments/assets/e43a47cd-e36e-4511-ba88-c928a4acd634)

## 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](https://github.com/user-attachments/assets/3b25d591-e3e2-4e8a-98a8-1bfc849d3bc1)
![Screenshot 2024-11-20 at 12 23
34](https://github.com/user-attachments/assets/a2d28036-98c5-4404-934e-2298cf4a66bf)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit b0122f5)

# Conflicts:
#	.github/CODEOWNERS
@Kerry350 Kerry350 added the backport This PR is a backport of another PR label Dec 2, 2024
@Kerry350 Kerry350 enabled auto-merge (squash) December 2, 2024 21:37
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. labels Dec 2, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 2, 2024

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

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Dec 2, 2024

💚 Build Succeeded

  • Buildkite Build
  • Commit: f2c3fa4
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-202588-f2c3fa4a08ff

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1888 1931 +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 100 105 +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.5MB 3.5MB +3.5KB
discover 811.3KB 811.9KB +665.0B
logsShared 424.0KB 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 24 25 +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.0KB 51.1KB +65.0B
logsDataAccess 6.7KB 6.7KB -10.0B
logsShared 175.1KB 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 148 153 +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

@Kerry350 Kerry350 merged commit 5d73f2f into elastic:8.x Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR ci:project-deploy-observability Create an Observability project Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants