[Logs] Replace log stream component#219425
Conversation
…getting truncated
…s the flyout which can be opened from hosts list view
…urce-definitions/scripts/fix-location-collection.ts'
…date LogStream Component in Category page as well
… with Saved Search
davismcphee
left a comment
There was a problem hiding this comment.
The log stream embeddable approach seems ok overall, but I'd really like to avoid special paths in the Discover embeddable to account for it. Could we please try something similar to my suggestion to avoid it instead?
src/platform/plugins/shared/discover/public/embeddable/initialize_search_embeddable_api.tsx
Show resolved
Hide resolved
| if (!dataView) { | ||
| try { | ||
| // Try to load with the "All logs" data view ID. This is faster | ||
| dataView = await dataService.dataViews.get(ALL_LOGS_DATA_VIEW_ID); |
There was a problem hiding this comment.
I wouldn't block the PR over it, but I don't really think this is necessary. It causes a 404 response whenever the cached data view doesn't exist yet, and using dataViews.create will already check the cache for a data view with a matching ID before creating one by default. The only perf hit incurred by skipping this and always calling create would be from getFlattenedLogSources, which I imagine is negligible.
There was a problem hiding this comment.
Thank you for clarifying this.
There was a problem hiding this comment.
Also the logsDataAccess pluggin is an optional dependency in Discover. Do you think it should be a requiredPluggin ? That would make certain checks easier
There was a problem hiding this comment.
That's a great question, and tbh I'm not 100% sure 🙃 All of our required plugins are outside of x-pack so maybe there's some restriction there, but some of the optional ones are actually required for Discover to work (e.g. Lens). So I think we can expect it will always be there at runtime, but your fallback logic will at least protect against it regardless. No need to wait for this PR, but now that you raised it I'm gonna ask operations.
| }); | ||
|
|
||
| // We register the saved search embeddable factory for the log stream embeddable to support old log stream panels. | ||
| plugins.embeddable.registerReactEmbeddableFactory('LOG_STREAM_EMBEDDABLE', async () => { |
There was a problem hiding this comment.
I don't love the idea of having the legacy o11y log stream embeddable registered from Discover, but I also can't think of a good alternative considering it depends on the Discover embeddable factory... We'll just be sure to ping the Logs UX team if we get any bug reports 😄
There was a problem hiding this comment.
Yeah unfortunately, i had to do this. I tried porting dependencies to Infra but it turned out to be a nightmare so i had to do it the other way.
Good part is we have Telemetry captured for the number of clusters using this Panel. Once we see this going to 0, we can plan to remove it completely may be.
There was a problem hiding this comment.
Agreed, definitely not worth trying to port it, and good to know we have telemetry on this.
src/platform/test/functional/apps/discover/embeddable/log_stream_dashboard_saved_object.ndjson
Show resolved
Hide resolved
…le not polluting Discover Saved Search embeddable
davismcphee
left a comment
There was a problem hiding this comment.
Data Discovery changes LGTM 👍 Thanks for making adjustments to the embeddable approach!
| type: LEGACY_LOG_STREAM_EMBEDDABLE, | ||
| buildEmbeddable: async ({ initialState, ...restParams }) => { | ||
| const searchSource = await discoverServices.data.search.searchSource.create(); | ||
| let fallbackPattern = 'logs-*-*'; |
There was a problem hiding this comment.
Good idea with the fallback to ensure we always have an index pattern available 👍
| if (!dataView) { | ||
| try { | ||
| // Try to load with the "All logs" data view ID. This is faster | ||
| dataView = await dataService.dataViews.get(ALL_LOGS_DATA_VIEW_ID); |
There was a problem hiding this comment.
That's a great question, and tbh I'm not 100% sure 🙃 All of our required plugins are outside of x-pack so maybe there's some restriction there, but some of the optional ones are actually required for Discover to work (e.g. Lens). So I think we can expect it will always be there at runtime, but your fallback logic will at least protect against it regardless. No need to wait for this PR, but now that you raised it I'm gonna ask operations.
| }); | ||
|
|
||
| // We register the saved search embeddable factory for the log stream embeddable to support old log stream panels. | ||
| plugins.embeddable.registerReactEmbeddableFactory('LOG_STREAM_EMBEDDABLE', async () => { |
There was a problem hiding this comment.
Agreed, definitely not worth trying to port it, and good to know we have telemetry on this.
|
Starting backport for target branches: 8.19 https://github.com/elastic/kibana/actions/runs/15756729781 |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
|
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.19`: - [[Logs] Replace log stream component (#219425)](#219425) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Achyut Jhunjhunwala","email":"achyut.jhunjhunwala@elastic.co"},"sourceCommit":{"committedDate":"2025-06-19T11:26:50Z","message":"[Logs] Replace log stream component (#219425)\n\n## Summary\n\ncloses https://github.com/elastic/logs-dev/issues/111\ncloses https://github.com/elastic/kibana/issues/200668\ncloses https://github.com/elastic/opentelemetry-dev/issues/792\ncloses https://github.com/elastic/kibana/issues/89042\ncloses https://github.com/elastic/kibana/issues/221746\ncloses https://github.com/elastic/kibana/issues/91717\ncloses https://github.com/elastic/kibana/issues/91717\n\n\nThe PR does the following\n\n- Enhances the `enableDocumentViewer` API in the Embeddable to also hide\nQuality issues and Stacktrace Columns for obs context when the expand\nicon is also hidden\n- Add a `Columns` Props the the embeddable so that a new profile is not\nrequired to be created when custom columns are required\n- Replaces Log Stream component in all remaining places\n\n- [x] APM - Transactions Details Page\n\n<img width=\"849\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/74e0469b-eecb-461f-98f5-5f0e51f30a59\"\n/>\n\n- [x] Logs tab in the hosts' view page\n\n<img width=\"1546\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/aae48330-42ca-4717-8cba-cc9974842045\"\n/>\n\n- [x] Logs Tab in Host Detail view\n\n<img width=\"2559\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c0184098-f4f7-437f-beb2-c0931ddd1a6a\"\n/>\n\n- [x] Logs Tab in the Flyout from the main Hosts page\n\n<img width=\"2547\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/3578022c-1ac2-4ad2-9968-e472926544a3\"\n/>\n\n- [x] Fleet Agent Logs\n\n<img width=\"722\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/78e66fa6-7872-482e-ba6d-80f10c5e3c4b\"\n/>\n\n- [x] Logs Categories Page\n\n<img width=\"1348\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/395e531c-f31e-4316-9604-ee08263c0083\"\n/>\n\n## What's Pending ?\n\nCode for the old Log Stream Component will be cleaned up in the\nfollowing PR\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"d9ebb93cddb9003b1f45b01682b229e4216db15a","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","Feature:Logs UI","release_note:skip","Team:Fleet","Team:obs-ux-logs","Team:obs-ux-infra_services","backport:version","v9.1.0","v8.19.0"],"title":"[Logs] Replace log stream component","number":219425,"url":"https://github.com/elastic/kibana/pull/219425","mergeCommit":{"message":"[Logs] Replace log stream component (#219425)\n\n## Summary\n\ncloses https://github.com/elastic/logs-dev/issues/111\ncloses https://github.com/elastic/kibana/issues/200668\ncloses https://github.com/elastic/opentelemetry-dev/issues/792\ncloses https://github.com/elastic/kibana/issues/89042\ncloses https://github.com/elastic/kibana/issues/221746\ncloses https://github.com/elastic/kibana/issues/91717\ncloses https://github.com/elastic/kibana/issues/91717\n\n\nThe PR does the following\n\n- Enhances the `enableDocumentViewer` API in the Embeddable to also hide\nQuality issues and Stacktrace Columns for obs context when the expand\nicon is also hidden\n- Add a `Columns` Props the the embeddable so that a new profile is not\nrequired to be created when custom columns are required\n- Replaces Log Stream component in all remaining places\n\n- [x] APM - Transactions Details Page\n\n<img width=\"849\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/74e0469b-eecb-461f-98f5-5f0e51f30a59\"\n/>\n\n- [x] Logs tab in the hosts' view page\n\n<img width=\"1546\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/aae48330-42ca-4717-8cba-cc9974842045\"\n/>\n\n- [x] Logs Tab in Host Detail view\n\n<img width=\"2559\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c0184098-f4f7-437f-beb2-c0931ddd1a6a\"\n/>\n\n- [x] Logs Tab in the Flyout from the main Hosts page\n\n<img width=\"2547\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/3578022c-1ac2-4ad2-9968-e472926544a3\"\n/>\n\n- [x] Fleet Agent Logs\n\n<img width=\"722\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/78e66fa6-7872-482e-ba6d-80f10c5e3c4b\"\n/>\n\n- [x] Logs Categories Page\n\n<img width=\"1348\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/395e531c-f31e-4316-9604-ee08263c0083\"\n/>\n\n## What's Pending ?\n\nCode for the old Log Stream Component will be cleaned up in the\nfollowing PR\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"d9ebb93cddb9003b1f45b01682b229e4216db15a"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219425","number":219425,"mergeCommit":{"message":"[Logs] Replace log stream component (#219425)\n\n## Summary\n\ncloses https://github.com/elastic/logs-dev/issues/111\ncloses https://github.com/elastic/kibana/issues/200668\ncloses https://github.com/elastic/opentelemetry-dev/issues/792\ncloses https://github.com/elastic/kibana/issues/89042\ncloses https://github.com/elastic/kibana/issues/221746\ncloses https://github.com/elastic/kibana/issues/91717\ncloses https://github.com/elastic/kibana/issues/91717\n\n\nThe PR does the following\n\n- Enhances the `enableDocumentViewer` API in the Embeddable to also hide\nQuality issues and Stacktrace Columns for obs context when the expand\nicon is also hidden\n- Add a `Columns` Props the the embeddable so that a new profile is not\nrequired to be created when custom columns are required\n- Replaces Log Stream component in all remaining places\n\n- [x] APM - Transactions Details Page\n\n<img width=\"849\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/74e0469b-eecb-461f-98f5-5f0e51f30a59\"\n/>\n\n- [x] Logs tab in the hosts' view page\n\n<img width=\"1546\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/aae48330-42ca-4717-8cba-cc9974842045\"\n/>\n\n- [x] Logs Tab in Host Detail view\n\n<img width=\"2559\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c0184098-f4f7-437f-beb2-c0931ddd1a6a\"\n/>\n\n- [x] Logs Tab in the Flyout from the main Hosts page\n\n<img width=\"2547\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/3578022c-1ac2-4ad2-9968-e472926544a3\"\n/>\n\n- [x] Fleet Agent Logs\n\n<img width=\"722\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/78e66fa6-7872-482e-ba6d-80f10c5e3c4b\"\n/>\n\n- [x] Logs Categories Page\n\n<img width=\"1348\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/395e531c-f31e-4316-9604-ee08263c0083\"\n/>\n\n## What's Pending ?\n\nCode for the old Log Stream Component will be cleaned up in the\nfollowing PR\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"d9ebb93cddb9003b1f45b01682b229e4216db15a"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
closes https://github.com/elastic/logs-dev/issues/111
closes #200668
closes https://github.com/elastic/opentelemetry-dev/issues/792
closes #89042
closes #221746
closes #91717
closes #91717
The PR does the following
Enhances the
enableDocumentViewerAPI in the Embeddable to also hide Quality issues and Stacktrace Columns for obs context when the expand icon is also hiddenAdd a
ColumnsProps the the embeddable so that a new profile is not required to be created when custom columns are requiredReplaces Log Stream component in all remaining places
APM - Transactions Details Page
What's Pending ?
Code for the old Log Stream Component will be cleaned up in the following PR