[Logs UI] Custom rendering for <LogStream /> columns#85148
[Logs UI] Custom rendering for <LogStream /> columns#85148afgomez merged 11 commits intoelastic:masterfrom
<LogStream /> columns#85148Conversation
|
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Distributable file count
History
To update your PR or re-run it, just comment with: |
weltenwort
left a comment
There was a problem hiding this comment.
I was able to make use of the new feature by modifying the way agent logs are rendered on first try. Well done on the implementation and documentation, which are both very readable. 👍
As I said before, a storybook story that showcases it would make reviewing new features such as these even easier.
| return messageSegment.constant; | ||
| } | ||
| if (isFieldSegment(messageSegment)) { | ||
| return messageSegment.value.toString(); |
There was a problem hiding this comment.
💭 This might make messages with complex values impossible to render correctly. But that's hard to avoid short of exposing the segment abstraction to the render() method.
What do you think about passing the constants and unstringified values as an array instead? Would that complicate the API too much?
There was a problem hiding this comment.
Do you remember on the top of your head any cases where one of the parts is a complex object? (Otherwise I will check the message formation rules myself tomorrow).
An option can be to test for the type of the value, and if it's anything other than a string use JSON.stringify() on it.
There was a problem hiding this comment.
I scanned all the test cases for the custom message formatters but didn't find anything where a complex field value was embedded in the message. 🤷 So maybe my concern was not justified.
…#85598) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Closes #82748
This PR adds rendering options to the
<LogStream/>column definition. This will allow consumers of the API to modify how the columns render.Example
We have applied the following configuration to the
page_view_log_in_context.tsxThis is the result: