-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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 UI] Fetch single log entries via a search strategy #81710
[Logs UI] Fetch single log entries via a search strategy #81710
Conversation
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.
I did a more functional pass today. Overall it works as intended. However I found two things.
- The first is what I commented on yesterday. When using the dev cluster it tries to load indefinitely, then it fails silently. The error seems to be on the ES side, but it's not being handled in the UI.
- The second: the fields are no longer displayed shorted.
Thank you for the review ❤️
This is caused by the
Good catch, I'll fix that. |
@afgomez, I replaced the I'd like to tackle the error display in #83906, because it completely replaces the current client-side code that calls the search strategy. Would that work for you? |
Nice! I tried the filter and it's very useful :) I noticed there are two fields missing: We added them manually in the API. I see the Maybe it makes more sense to show the ID somewhere else in the UI, like in the header: |
My comment was more related to the UI not handling the error. I'm not sure we do any error handling in |
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.
Everything works 🎉! There is the question of what to do with the added _id
and _index
fields. I'm not explicitly approving to keep track of that, but consider it virtually approved :)
Good point, I forgot about rendering The errors were indeed silent even before this change. I'm cleaning that up in #83906, which will be ready for review soon. |
@afgomez I think the header works reasonably well: What do you think? |
id="xpack.infra.logFlyout.flyoutTitle" | ||
values={{ | ||
logEntryId: flyoutItem ? <code>{flyoutItem.id}</code> : '', |
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.
Shall we use <EuiCode>
here?
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.
I considered that, but decided against it, because <EuiCode>
is a pretty complex component that performs language-specific syntax highlighting on the content. It felt like overkill here, since we're not displaying code but only want to stylize the immutable values.
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.
I think the header works reasonably well
Yeah I think so too :) I would consider using <EuiCode>
instead of <code>
, but other than that LGTM!
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Distributable file count
Page load bundle
History
To update your PR or re-run it, just comment with: |
…overy-action-group * upstream/master: (48 commits) [Lens] accessibility screen reader issues (elastic#84395) [Logs UI] Fetch single log entries via a search strategy (elastic#81710) fix: 🐛 don't add separator befor group on no main items (elastic#83166) [Security Solution][Detections] Implements indicator match rule cypress test (elastic#84323) [APM] Add APM agent config options (elastic#84678) Fixed a11y issue on rollup jobs table selection (elastic#84567) [Discover] Refactor getContextUrl to separate file (elastic#84503) [Embeddable] Export CSV action for Lens embeddables in dashboard (elastic#83654) [TSVB] [Cleanup] Remove extra dateFormat props (elastic#84749) [Lens] Migrate legacy es client and remove total hits as int (elastic#84340) Improve logging pipeline in @kbn/legacy-logging (elastic#84629) Catch @hapi/podium errors (elastic#84575) [Discover] Unskip date histogram test (elastic#84727) Rename server.xsrf.whitelist to server.xsrf.allowlist (elastic#84791) [Enterprise Search] Fix schema errors button (elastic#84842) [APM] Removes react-sticky dependency in favor of using CSS (elastic#84589) [Maps] Always initialize routes on server-startup (elastic#84806) [Fleet] EPM support to handle uploaded file paths (elastic#84708) [Snapshot Restore] Fix initial policy form state (elastic#83928) Upgrade Node.js to version 14 (elastic#83425) ...
Summary
This replaces the log item API with a single-log-entry search strategy. This is used to fetch the data for display in the details flyout. There should be no significant visual difference to the user.
Request cancellation support will be added in a follow-up PR.
closes #78001
Implementation details
I've commented inline on various aspects of the implementation.
ese
search strategy to fetch the actual data.service
directory structure to match the platform conventions regarding plugin substructure:LogEntrySearchStrategy
LogEntriesService
, which registers the above search strategytyped_search_strategy.ts
utilities are designed to be re-usable in upcoming search-strategy-related PRs.Previews
Follow-up tasks