Skip to content
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

[Log Explorer] Log Flyout AI assistant #169506

Closed
Tracked by #169498
tonyghiani opened this issue Oct 23, 2023 · 2 comments · Fixed by #170658
Closed
Tracked by #169498

[Log Explorer] Log Flyout AI assistant #169506

tonyghiani opened this issue Oct 23, 2023 · 2 comments · Fixed by #170658
Assignees
Labels
Feature:LogsExplorer Logs Explorer feature Team:obs-ux-logs Observability Logs User Experience Team

Comments

@tonyghiani
Copy link
Contributor

tonyghiani commented Oct 23, 2023

📓 Summary

Similarly to the AI assistant present in the Log Stream feature, the idea is to give the user a human-friendly explanation of the log message. To achieve this we'll introduce a section for the Elastic AI assistant.

🎨 Design

ai

✔️ Acceptance criteria

  • Should display an AI assistant section to explain the log message meaning.
  • Should display an AI assistant section to learn about similar log messages.

💡 Implementation hints

The Log Entry Flyout as detail for the Log Stream page shows a good example of how to use the Message and ContextualInsight assistants.

@tonyghiani tonyghiani added Feature:Logs UI Logs UI feature Team:obs-ux-logs Observability Logs User Experience Team labels Oct 23, 2023
@tonyghiani
Copy link
Contributor Author

tonyghiani commented Oct 27, 2023

After a deeper investigation, the LogStream is already factoring out the flyout content from the infra plugin, and its content, which includes the AI assistant, is already extracted into the logs-shared plugin.

To reuse the prompts configuration and avoid parallelism between the assistants, we could extract and expose the component from the logs_shared plugin and consume it from the log explorer.
The logs-shared plugin is thought to have the minimum essential dependencies, so using it in the log-explorer plugin would be safe.

@tonyghiani tonyghiani self-assigned this Oct 27, 2023
@tonyghiani tonyghiani added Feature:LogsExplorer Logs Explorer feature and removed Feature:Logs UI Logs UI feature labels Oct 31, 2023
@tonyghiani
Copy link
Contributor Author

For the usage of the AI Assistant in the Log Explorer Flyout details, it is important to ensure that the 'log-explorer' plugin remains independent of any observability-related concepts. This will enable its use on consumer applications that have observability dependencies disabled.

After a conversation with @weltenwort, it becomes clear that it would be beneficial to implement a registration mechanism. This mechanism would allow the consumer application to inject specific features that are closely tied to a project area. The primary goal is to maintain the Log Explorer's independence from explicit dependencies.

In this specific case, introducing the ObservabilityAIAssistant would introduce a dependency on an observability concept. This could prevent other consumers, such as Security, from using it. Therefore, the idea is to expose a registration mechanism that allows the consumer to inject any custom features as needed.

tonyghiani added a commit that referenced this issue Nov 6, 2023
## 📓 Summary

Part of #169506 

The reason behind exposing this component is that we'll use the same
configuration and prompts to generate insights about log entries on
different touchpoints:
- Currently implemented, show AI insights on the LogStream flyout detail
- To implement (follow up PR), show AI insights on the Log Explorer
flyout detail

These changes expose a new LogAIAssistant component in 2 ways:
- Consume the component from the `logs-shared` plugin start contract.
- Import the component from the plugin bundle.

In both ways the component come lazy-loaded, the main difference is that
consuming it from the start contract will pre-inject the aiAssistant
dependency in the component.

```ts
// Usage from plugin contract
const {services} = useKibana()

const { LogAIAssistant } = services.logsShared
<LogAIAssistant doc={logEntry} />

// Usage from component import
import { LogAIAssistant } from '@kbn/logs-shared-plugin/public';

const {services} = useKibana()

<LogAIAssistant aiAssistant={services.observabilityAIAssistant} doc={logEntry} />
```

To avoid mixing the registration of external components into the Log
Explorer, I decided to split this work into different PRs to keep the
changes scoped.

---------

Co-authored-by: Marco Antonio Ghiani <[email protected]>
tonyghiani added a commit that referenced this issue Nov 8, 2023
## 📓  Summary

Closes #169506 

This PR introduces a mechanism to apply customizations on the
LogExplorer component.
The first necessary customization which is implemented is for the flyout
detail, allowing the consumer to display additional content on top of
what is already displayed.

This is a temporary solution which will be updated and embedded in a
more structured customization system as a result of the work done for
#165255.

The current solution creates already a context to allow granular
consumption of the customizations only for those subtrees where a
specific customization should apply.

The LogAIAssistant is used to customize the current LogExplorer as the
first usage of this customization.


https://github.com/elastic/kibana/assets/34506779/c9e6b40e-e636-456a-9e19-1778c26142db

---------

Co-authored-by: Marco Antonio Ghiani <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:LogsExplorer Logs Explorer feature Team:obs-ux-logs Observability Logs User Experience Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant