-
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
Implement embeddable <LogStream />
component
#75650
Comments
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
This sounds great, thanks for spelling it out in detail. ❤️ The component API makes sense to me. I'd only prefer to call the Nice job! |
Another thought: Since you've invested the time to write this down, do we want to take the architecture description and put it into a markdown doc when we implement this? That way it might be more discoverable than in the description of a closed issue in the long term. |
Yes! I tried my best to write it as documentation for the consumers. We can copy-paste it either in a JSDoc on top of the component file or in a README.md in the same folder. |
This looks great! It sounds like the @elastic/stack-monitoring-ui team can replace our existing logs table with something like this! |
+1 would love to integrate this in the enhanced host details. cc: @hbharding |
❗ Dear reader, if you come here looking for the component documentation, the up to date version is in the repo.
We want to make easy for other Kibana plugins to embed a simple log stream. That will enable other teams to show logs in whatever context they need (see #67611)
Internally it can also be used in some places of the logs UI, like the "View logs in context".
Goals
<LogStream />
component in a shared location.startTimestamp
andendTimestamp
.query
.center
prop.Non-goals (for MVP at least)
Proposed API
On it's most basic form, the component takes a
startTimestamp
andendTimestamp
parameters.Querying data
The component accepts KQL expressions via the
query
prop. This allows consumers to show log lines in the context they need.Showing data
By default the component will show the newest entries. That is, the list will be scrolled all the way to the bottom.
Users can specify a middle point with the
center
prop. Thecenter
is aLogEntriesCursor
.The default page size is 200, and the component will not do pagination by default. To tweak this parameters, consumers can specify the
paginate
andpageSize
props.If the consumer wants to highlight a specific log line, it can do so by passing the log line ID to the
highlight
prop.Source configuration
The infra plugin has the concept of "source configuration" to store data about the logs UI, like what indices to query, or which columns to show.
The component will use this information to determine where and how to show the log data. By default it will use the
default
source configuration. Consumers of the component can specify a different source via props.Implementation details
The component will rely in the existing
/api/log_entries/entries
API to fetch the log lines.The component will reuse
<ScrollableLogTextStreamView />
. There is an example of how to use it outside the log stream in the View in context component.The component will hold its own state. We will build new hooks for this to explore possible new ways to handle the state in the log stream page.
The log stream page won't use this component. Each will use their own mechanisms to hold state. Internally, each will use the same UI components and call the same backend APIs.
Related issues
The text was updated successfully, but these errors were encountered: