-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Logs Explorer] Add customisation for virtual columns and add the 1st virtual column #173732
[Logs Explorer] Add customisation for virtual columns and add the 1st virtual column #173732
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
/ci |
/ci |
/ci |
/ci |
Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs) |
I am not sure how the filter action on the Table would look like for the message field.
|
Visually these just would be the data grid hover and popover actions. For what happens when the user clicks two options come to mind:
We can split this discussion and change into a follow-up PR to get this one merged soon if you like. |
@gbamparop That was intentional. The idea was to distinguish the keys and values similar to what Discover does when no column is added. What alternative would you suggest? |
Since Content is a smart field created from the grouping of many fields, the initial thought was to allow users to be able to filter by log.level, and rely on the 'Insights' area to filter from message patterns (5 most common / least common), as shown below. I am aware though this doesn't exactly address the scenarios listed above, so if we want to at least keep the original behaviour (described by Felix in point 1), of being able to filter by the message/error.message/event.orignal, I will need to dedicate some time to understand how this can be done visually. This might imply a complete change in the cell filtering design. I was also made aware today that the Discover team is slightly changing the data grid cell actions, as described in elastic/eui#7343. Worth it giving a look. |
@weltenwort @isaclfreire Given the size, complexity of the PR and next week being On-Week, i am in favour of splitting the task of how we handle Filtering behavior for Message Field in the Table separately outside the scope of this PR. On the contrary, i also like Isa's approach that we can leave the message field like that in the table as this is a special column in the table. This way irrespective of the message, fallback or whole document, we keep consistency. But yes, let's move this to separate discussion. @isaclfreire Thanks for sharing the Datagrid EUI changes. Looking at their changes on a high level, it seems we will auto inherit those features. |
Ok, let's tackle the cell actions in a follow-up. Even if we don't want to support the filter actions, the "copy" action would probably be quite useful for users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I left a few minor points of feedback, but assuming those get addressed, the Discover changes LGTM.
I didn't do extensive testing on the Logs Explorer side, so my review is primarily on the Discover changes, but I poked around a bit and noticed a couple things worth mentioning. I'll approve once the Discover feedback has been addressed though, and leave it to your team to decide what to do with this feedback.
It looks like removing a column from the sidebar causes Logs Explorer to crash with a React hooks related error:
remove.mp4
After opening a log level badge popover, clicking on the badge again to close it causes the popover to get stuck open. This is most often caused by using onClick={() => setIsPopoverOpen(true)}
instead of onClick={() => setIsPopoverOpen(!isPopoverOpen)}
:
popover.mp4
These next ones aren't necessarily bugs, just some UX feedback.
Unfortunately it looks like the EUI upgrade broke the vertical alignment on the log level badge:
I agree with @kertal about the column based approach to the content cell. For example, it causes the cell layout to look odd IMO when setting the row height to auto:
It also feels like by default there's too little space available for the content cell compared to the service.name and host.name cells. This can be improved by collapsing the sidebars, but it might be worth reconsidering the defaults here IMO:
src/plugins/discover/public/application/main/components/layout/discover_documents.tsx
Show resolved
Hide resolved
src/plugins/discover/public/customizations/customization_types/data_table_customisation.ts
Outdated
Show resolved
Hide resolved
@davismcphee Thank you for the detailed review. Looks like i introduced some regressions while fixing other code reviews. I have fixed most of them, answering them here,
Good catch, fixed it now.
Fixed
I didn't understand this one. I see this as expected. The text and the arrow is center aligned to the badge. Which means they will not be vertically aligned with each other.
I am not sure if we are setting row height as Auto in Log Explorer for the data table. Or is it some user level setting ?
We have more user stories coming in where the regular columns like UPDATE@davismcphee We had an internal discussion b/w myself, @isaclfreire and @weltenwort. |
For the Logs Explorer the row height defaults to "single". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the PR feedback, the Data Discovery changes LGTM 👍 And I confirmed the sidebar and popover issues are working as expected now too.
I didn't understand this one. I see this as expected. The text and the arrow is center aligned to the badge. Which means they will not be vertically aligned with each other.
Sorry, I should have been a bit more specific with what I meant here. It looks like originally the badge was vertically aligned to the center of the row, but after the last EUI upgrade it's aligned to the bottom of the row instead.
I am not sure if we are setting row height as Auto in Log Explorer for the data table. Or is it some user level setting ?
By default it seems to be set to single, but this can be changed by users through the display options button above the grid:
We have more user stories coming in where the regular columns like
service.name
andhost.name
will be replaced by a single column calledresource
column. This should create more space for the content column.
This makes sense, and I agree it would likely improve the current situation with limited space.
We would want to keep the Log Level as part of the Content column for the moment. The table would already limit the number of columns when it loads initially to provide enough space for the Content column.
Oops, my feedback here was also a bit vague. I didn't mean that I think a separate data table column would be better for the log level, just that the current use of flex columns results in a lot of whitespace when the content wraps. Placing the badge inline with the content so the text can wrap around it might make better use of the available space.
That said, none of this feedback is blocking or anything, so no need for me to hold up this PR 🙂
@davismcphee Thank you for the approval
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! 👏 Thanks for all the attention to detail!
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
… virtual column (elastic#173732) ## Summary - Closes elastic#171844 - Closes elastic#171726 - Closes elastic#173825 This PR does 4 things - Customisation point to inject customCellRenderers in the Data Table. - Adding the 1st virtual column - Content and removal of Message column - Add cell actions for virtual columns so that the custom fields can be filtered for - Renders similar content on the Flyout instead of Message ### To make this PR easy to review #### Why Kibana Operations - This PR initially increased the bundle size causing the values to go beyond the boundaries set in `limits.yml`. This has been fixed now after suggestion from Kibana Ops team #### For Kibana Data Discovery Team - Changes done on Unified Data Table - Moving around types to make them more generic and reusable - Split the 2 components SourceDocument and SourceDocumentPopover out of the 1 single large file `ger_render_cell_value.tsx` they were in. This allows me to export them and lazy load the components in my plugin. - Passed additional parameters to `externalCustomRenderers` function #### For Kibana Data Discovery Team - Changes done on Discover Plugin - Currently the discover plugin was not passing the registered customisation for `externalCustomRenderers`. Simply added the hook to retrieve the registered customisation and pass it as props. - Added new customisation type for `CellRendererCustomisation` #### For Logs UX Team - Changes done on Log Explorer - Registered a new customisation for custom Virtual columns. - Rendering logic for Log Level and Message with fallbacks - When Message and its fallbacks are not present, we must render the whole document. Used extracted logic to display complete document as it appears in current Discover. - When a JSON column is expanded (expandCellAction), it should render a JSON viewer as it currently does in Discover - Items like Log Level which are rendered inside a Chip should allow contextual actions like Filter In, Filter Out and Copy ## Want to run this PR locally ``` // Checkout this PR gh pr checkout 173732 // Start Kibana locally yarn start // Start ES locally yarn es snapshot // Generate dummy data node scripts/synthtrace simple_logs.ts --clean ``` ## Live Demo can be seen [here](https://achyutjhunjhunwala-d-pr173732.kb.us-west2.gcp.elastic-cloud.com/app/observability-log-explorer/?pageState=(breakdownField:log.level,columns:!((field:service.name,width:240),(field:host.name,width:320),(field:content)),controls:(data_stream.namespace:(mode:include,selection:(selectedOptions:!(),type:options))),datasetSelection:(selectionType:all),filters:!(),query:(language:kuery,query:%27%27),refreshInterval:(pause:!t,value:5000),rowHeight:0,rowsPerPage:100,time:(from:%272024-01-05T14:39:41.024Z%27,to:%272024-01-05T14:54:43.378Z%27),v:1)) ## Demo ![Virtual Column - Content](https://github.com/elastic/kibana/assets/7416358/db5977cd-1342-4dce-bfe9-bad3ee42487b) ## What's pending - Basically why is the PR still in Draft Stage - [x] Fix colors for logs levels after confirmation from Isa and hide level when not present - [x] Fix JSON rendering on the content cell when message field is not present so that it looks like exactly how it looks in Discover - [x] Add E2E tests - [x] Update DEMO with a gif rather than a screenshot --------- Co-authored-by: kibanamachine <[email protected]>
Summary
This PR does 4 things
To make this PR easy to review
Why Kibana Operations
limits.yml
. This has been fixed now after suggestion from Kibana Ops teamFor Kibana Data Discovery Team - Changes done on Unified Data Table
ger_render_cell_value.tsx
they were in. This allows me to export them and lazy load the components in my plugin.externalCustomRenderers
functionFor Kibana Data Discovery Team - Changes done on Discover Plugin
externalCustomRenderers
. Simply added the hook to retrieve the registered customisation and pass it as props.CellRendererCustomisation
For Logs UX Team - Changes done on Log Explorer
Want to run this PR locally
Live Demo can be seen here
Demo
What's pending - Basically why is the PR still in Draft Stage