[Logs UI] Fetch single log entries via a search strategy#81710
[Logs UI] Fetch single log entries via a search strategy#81710weltenwort merged 37 commits intoelastic:masterfrom
Conversation
afgomez
left a comment
There was a problem hiding this comment.
👀 I did a first pass on the code. I like it overall! It has taught me a lot about RxJS.
I found an issue where loading an entry fails silently, so there might be a problem in how errors are handled. I'll dig a bit more into it tomorrow.
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| // import type { CoreSetup, CoreStart } from 'kibana/public'; |
There was a problem hiding this comment.
I think this can be removed ✂️
x-pack/plugins/infra/server/services/log_entries/log_entry_search_strategy.ts
Show resolved
Hide resolved
afgomez
left a comment
There was a problem hiding this comment.
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 |
afgomez
left a comment
There was a problem hiding this comment.
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? |
| defaultMessage="Details for log entry {logEntryId}" | ||
| id="xpack.infra.logFlyout.flyoutTitle" | ||
| values={{ | ||
| logEntryId: flyoutItem ? <code>{flyoutItem.id}</code> : '', |
There was a problem hiding this comment.
Shall we use <EuiCode> here?
There was a problem hiding this comment.
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.
afgomez
left a comment
There was a problem hiding this comment.
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.
esesearch strategy to fetch the actual data.servicedirectory structure to match the platform conventions regarding plugin substructure:LogEntrySearchStrategyLogEntriesService, which registers the above search strategytyped_search_strategy.tsutilities are designed to be re-usable in upcoming search-strategy-related PRs.Previews
Follow-up tasks