Skip to content

[Discover][Traces] Showing Logs in context of the trace#232784

Merged
kpatticha merged 36 commits intoelastic:mainfrom
kpatticha:discover-add-logs
Sep 1, 2025
Merged

[Discover][Traces] Showing Logs in context of the trace#232784
kpatticha merged 36 commits intoelastic:mainfrom
kpatticha:discover-add-logs

Conversation

@kpatticha
Copy link
Contributor

@kpatticha kpatticha commented Aug 25, 2025

Summary

closes #232249

Screen.Recording.2025-08-25.at.3.59.28.PM.mov
Empty State With Data
Screenshot 2025-08-25 at 4 02 58 PM Screenshot 2025-08-25 at 4 02 14 PM

How to test

  1. Make sure nav type is observability
  2. select APM data view
  3. open any transaction/span

TODO

  • fix storybook

Notes for reviewers

  • This PR registers the log events component as feature in discover cause this circular dependency is blocking me from using the component directly in the doc_viewer
@kpatticha kpatticha requested a review from a team as a code owner August 25, 2025 13:07
@kpatticha kpatticha requested a review from a team August 25, 2025 13:07
@kpatticha kpatticha requested a review from a team as a code owner August 25, 2025 13:07
@kpatticha kpatticha added backport:skip This PR does not require backporting release_note:feature Makes this part of the condensed release notes v9.2.0 labels Aug 25, 2025
@kpatticha kpatticha requested a review from a team as a code owner August 25, 2025 15:02
@cauemarcondes
Copy link
Contributor

Screenshot 2025-08-25 at 12 38 30

@kpatticha is it possible to set a max height so we don't scroll like this covering the whole flyout content?

Another question:

  • How valuable is the empty Logs section?
Screenshot 2025-08-25 at 12 40 01

Asking because for Span links I'm not showing the section in case there's no links available.

@kpatticha
Copy link
Contributor Author

@kpatticha is it possible to set a max height so we don't scroll like this covering the whole flyout content?

Yes we can set up max-height. I will update it

Another question:

  • How valuable is the empty Logs section?
    Asking because for Span links I'm not showing the section in case there's no links available.

This is the inconsistency I was talking. The LazySavedSearchComponent handles the states and at the moment it doesn’t provide a callback for consumers to know whether data is available.

If we want to address this, it would be better to create a separate ticket.

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.

LGTM, just some nits

@kpatticha kpatticha requested a review from a team as a code owner August 27, 2025 11:26
Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

kibana.jsonc reformatted. No real changes. 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.

Code-only review, Data Discovery changes LGTM. Just one mock related request from my end.

@iblancof
Copy link
Contributor

Asking because for Span links I'm not showing the section in case there's no links available.

@cauemarcondes I wanted to try this on your Span Links PR before asking, but I still don’t know how to set up the data for it (I left a comment suggesting it could be added as a “How to test” section in the description).

So, does this mean that we see the section with a loading state and then it disappears?

@kpatticha
Copy link
Contributor Author

Asking because for Span links I'm not showing the section in case there's no links available.

@cauemarcondes I wanted to try this on your Span Links PR before asking, but I still don’t know how to set up the data for it (I left a comment suggesting it could be added as a “How to test” section in the description).

So, does this mean that we see the section with a loading state and then it disappears?

Are you asking for the Span links section ? The easiest way is to run the span_links scenario that generates some links. You can filter span.links.span.id: * in discover to see the documents that have the links . Also, some of the remote clusters have span links .

Based on the code: https://github.com/elastic/kibana/pull/232135/files#diff-741b102730d177939f71f243f6b836eb3db1104f3291eeb2e6b933066003a88bR116-R121 the section doesn't render

@kertal kertal added the Project:OneDiscover Enrich Discover with contextual awareness label Aug 29, 2025
@iblancof
Copy link
Contributor

Asking because for Span links I'm not showing the section in case there's no links available.

@cauemarcondes I wanted to try this on your Span Links PR before asking, but I still don’t know how to set up the data for it (I left a comment suggesting it could be added as a “How to test” section in the description).
So, does this mean that we see the section with a loading state and then it disappears?

Are you asking for the Span links section ? The easiest way is to run the span_links scenario that generates some links. You can filter span.links.span.id: * in discover to see the documents that have the links . Also, some of the remote clusters have span links .

Thank you @kpatticha! Apparently, I didn’t check the list of available scenarios carefully enough.

Based on the code: https://github.com/elastic/kibana/pull/232135/files#diff-741b102730d177939f71f243f6b836eb3db1104f3291eeb2e6b933066003a88bR116-R121 the section doesn't render

I decided to check it locally, and that makes sense since we don’t really show any loader for it, instead, the section just suddenly renders once the request is resolved.
I placed the section at the top to properly see the behavior:

Screen.Recording.2025-08-29.at.11.56.11.mov

It’s true that this section remains out of the user’s view unless they scroll, but I’m not sure this is the best practice.
Maybe we should consider adding a skeleton for section loading?

And sorry for hijacking this PR to talk about the other one, but I think we could decide on a unified approach for all sections.

@kpatticha
Copy link
Contributor Author

Asking because for Span links I'm not showing the section in case there's no links available.

@cauemarcondes I wanted to try this on your Span Links PR before asking, but I still don’t know how to set up the data for it (I left a comment suggesting it could be added as a “How to test” section in the description).
So, does this mean that we see the section with a loading state and then it disappears?

Are you asking for the Span links section ? The easiest way is to run the span_links scenario that generates some links. You can filter span.links.span.id: * in discover to see the documents that have the links . Also, some of the remote clusters have span links .

Thank you @kpatticha! Apparently, I didn’t check the list of available scenarios carefully enough.

Based on the code: https://github.com/elastic/kibana/pull/232135/files#diff-741b102730d177939f71f243f6b836eb3db1104f3291eeb2e6b933066003a88bR116-R121 the section doesn't render

I decided to check it locally, and that makes sense since we don’t really show any loader for it, instead, the section just suddenly renders once the request is resolved. I placed the section at the top to properly see the behavior:

Screen.Recording.2025-08-29.at.11.56.11.mov
It’s true that this section remains out of the user’s view unless they scroll, but I’m not sure this is the best practice. Maybe we should consider adding a skeleton for section loading?

And sorry for hijacking this PR to talk about the other one, but I think we could decide on a unified approach for all sections.

No prob, these are valid points. This falls under the topic I previously shared regarding the state in the flyout, and I’ve created a design ticket to address it as we move forward.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
logsShared 322 324 +2
unifiedDocViewer 377 379 +2
total +4

Async chunks

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

id before after diff
logsShared 203.2KB 203.1KB -75.0B
unifiedDocViewer 280.2KB 281.8KB +1.6KB
total +1.5KB

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
discoverShared 3 4 +1

Page load bundle

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

id before after diff
logsShared 90.5KB 91.1KB +631.0B

History

Copy link
Contributor

@achyutjhunjhunwala achyutjhunjhunwala left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼

@kpatticha kpatticha merged commit 01ccd23 into elastic:main Sep 1, 2025
12 checks passed
ymao1 pushed a commit to ymao1/kibana that referenced this pull request Sep 2, 2025
## Summary

closes elastic#232249 




https://github.com/user-attachments/assets/d83da581-fd55-40bb-a45f-aa0ef9e8f9f3


| Empty State | With Data |
|------------|-----------|
| <img width="2500" height="1340" alt="Screenshot 2025-08-25 at 4 02
58 PM"
src="https://github.com/user-attachments/assets/ec3388a5-fe21-4cb6-a8d4-061d01108d85"
/> | <img width="2500" height="1340" alt="Screenshot 2025-08-25 at 4 02
14 PM"
src="https://github.com/user-attachments/assets/621a7bbc-bd85-4654-b508-a4df1695cdb9"
/>


### How to test 
1. Make sure nav type is observability
2. select APM data view
3. open any transaction/span


### TODO

- [x] fix storybook

### Notes for reviewers
- This PR registers the log events component as feature in discover
cause this [circular
dependency](elastic#233132) is blocking
me from using the component directly in the doc_viewer

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
MichelLosier pushed a commit to MichelLosier/kibana that referenced this pull request Sep 2, 2025
## Summary

closes elastic#232249 




https://github.com/user-attachments/assets/d83da581-fd55-40bb-a45f-aa0ef9e8f9f3


| Empty State | With Data |
|------------|-----------|
| <img width="2500" height="1340" alt="Screenshot 2025-08-25 at 4 02
58 PM"
src="https://github.com/user-attachments/assets/ec3388a5-fe21-4cb6-a8d4-061d01108d85"
/> | <img width="2500" height="1340" alt="Screenshot 2025-08-25 at 4 02
14 PM"
src="https://github.com/user-attachments/assets/621a7bbc-bd85-4654-b508-a4df1695cdb9"
/>


### How to test 
1. Make sure nav type is observability
2. select APM data view
3. open any transaction/span


### TODO

- [x] fix storybook

### Notes for reviewers
- This PR registers the log events component as feature in discover
cause this [circular
dependency](elastic#233132) is blocking
me from using the component directly in the doc_viewer

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
kowalczyk-krzysztof pushed a commit to kowalczyk-krzysztof/kibana that referenced this pull request Sep 3, 2025
## Summary

closes elastic#232249 




https://github.com/user-attachments/assets/d83da581-fd55-40bb-a45f-aa0ef9e8f9f3


| Empty State | With Data |
|------------|-----------|
| <img width="2500" height="1340" alt="Screenshot 2025-08-25 at 4 02
58 PM"
src="https://github.com/user-attachments/assets/ec3388a5-fe21-4cb6-a8d4-061d01108d85"
/> | <img width="2500" height="1340" alt="Screenshot 2025-08-25 at 4 02
14 PM"
src="https://github.com/user-attachments/assets/621a7bbc-bd85-4654-b508-a4df1695cdb9"
/>


### How to test 
1. Make sure nav type is observability
2. select APM data view
3. open any transaction/span


### TODO

- [x] fix storybook

### Notes for reviewers
- This PR registers the log events component as feature in discover
cause this [circular
dependency](elastic#233132) is blocking
me from using the component directly in the doc_viewer

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Project:OneDiscover Enrich Discover with contextual awareness release_note:feature Makes this part of the condensed release notes v9.2.0

10 participants