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

[ML] AIOps: Adds AI Assistant contextual insight to Log Rate Analysis page in ML plugin in Observability serverless. #186509

Merged
merged 8 commits into from
Jul 3, 2024

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Jun 20, 2024

Summary

Part of #181111.

This adds O11y AI Assistant's contextual insight to the Log Rate Analysis page in the ML plugin for O11y serverless projects..

Note the code is almost an exact copy of what's currently used in the O11y UI itself to render the contextual insight when log rate analysis gets embedded on alert details pages. As a follow up we will be able to consolidate some code.

aiops-ai-assistant-contextual-insight-0001.webm

To test this you need to set up AI Assistant in your kibana.dev.yml:

xpack.actions.preconfigured:
  my-gen-ai:
    name: Preconfigured Azure OpenAi
    actionTypeId: .gen-ai
    config:
      apiUrl: <YOUR-API-URL>
      apiProvider: 'Azure OpenAI'
    secrets:
      apiKey: <YOUR-API-KEY>

Checklist

@walterra walterra added release_note:enhancement :ml Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis v8.15.0 labels Jun 20, 2024
@walterra walterra self-assigned this Jun 20, 2024
@walterra walterra requested review from a team as code owners June 20, 2024 09:06
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiops 554.2KB 558.0KB +3.8KB
ml 4.1MB 4.1MB +106.0B
total +3.9KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
ml 80.2KB 80.2KB +52.0B
Unknown metric groups

API count

id before after diff
aiops 72 73 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @walterra

@peteharverson peteharverson changed the title [ML] AIOps: Add O11y AI Assistant contextual insight to Log Rate Analysis page in ML plugin. [ML] AIOps: Add Observability AI Assistant contextual insight to Log Rate Analysis page in ML plugin. Jun 20, 2024
onWindowParametersChange={onWindowParametersHandler}
/>
<EuiFlexItem>
<LogRateAnalysisContent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we clear this info if the brushes are reset or when a new analysis is run?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this to #181111. I think it makes sense to clear the reset AI assistant section when Reset is pressed or when a new analysis is run.

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally against a range of logs, and overall looks a great addition.

Couple of questions:

  1. Guessing this is the default behavior of the AI assistant, but is there a way to prevent this toast from appearing if a user decides to click the 'Stop generating' button:
Screenshot 2024-06-20 at 17 21 34
  1. Have you confirmed that behavior is ok with Security and Search serverless projects (assume the assistant is just silently hidden)?

@walterra
Copy link
Contributor Author

walterra commented Jun 21, 2024

@peteharverson regarding your questions:

  1. That error toast also shows up in other places for contextual insights. I contacted the o11y team to find out if we can fix this. Update: This is now tracked by an o11y issue: [Observability AI Assistant] "Stop generating" shows an error toast #186794
  2. I tested the behavior across serverless projects:
  • o11y: Log rate analysis is available in the main menu and works including the contextual insight.
  • es/security: Log rate analysis is not in the main menus but available when you search for it. The o11y AI assistant is not enabled in these projects so the contextual insights section is hidden on the log rate analysis page.
  • security: Log rate analysis is available within "Machine Learning" from the main menu. The o11y AI assistant is not enabled in this project so the contextual insights section is hidden on the log rate analysis page.

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alvarezmelissa87
Copy link
Contributor

Great addition! Overall everything works as expected except the 'Start chat' button, which doesn't seem to do anything. Maybe it can be removed if it doesn't work outside of Observability?

image

@walterra
Copy link
Contributor Author

walterra commented Jul 2, 2024

@alvarezmelissa87 I investigated the non-working "Start chat" button. The problem is: This button will trigger the AI Assistant flyout to start a chat with the assistant, but it is not available outside the o11y UI on stateful. The contextual insight on the other hand doesn't expose options to hide that button in this case. Since the AI assistant chat is only available all the time in the o11y project type for serverless, for now I had to add a flag that will show the contextual insights on the log rate analysis page on serverless too (see d7aa6f4).

@walterra walterra changed the title [ML] AIOps: Add Observability AI Assistant contextual insight to Log Rate Analysis page in ML plugin. [ML] AIOps: Add Observability AI Assistant contextual insight to Log Rate Analysis page in ML plugin in o11y serverless. Jul 3, 2024
@walterra walterra changed the title [ML] AIOps: Add Observability AI Assistant contextual insight to Log Rate Analysis page in ML plugin in o11y serverless. [ML] AIOps: Add Observability AI Assistant contextual insight to Log Rate Analysis page in ML plugin in Observability serverless projects. Jul 3, 2024
@walterra walterra changed the title [ML] AIOps: Add Observability AI Assistant contextual insight to Log Rate Analysis page in ML plugin in Observability serverless projects. [ML] AIOps: Add AI Assistant contextual insight to Log Rate Analysis page in ML plugin in Observability serverless. Jul 3, 2024
@walterra walterra requested a review from a team as a code owner July 3, 2024 08:56
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiops 559.1KB 563.0KB +3.9KB
ml 4.6MB 4.6MB +344.0B
total +4.3KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
ml 80.3KB 80.3KB +52.0B
Unknown metric groups

API count

id before after diff
aiops 72 74 +2

History

cc @walterra

@walterra walterra merged commit c60efaf into elastic:main Jul 3, 2024
17 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jul 3, 2024
@walterra walterra deleted the ml-aiops-contextual-insight branch July 3, 2024 13:15
@peteharverson peteharverson changed the title [ML] AIOps: Add AI Assistant contextual insight to Log Rate Analysis page in ML plugin in Observability serverless. [ML] AIOps: Adds AI Assistant contextual insight to Log Rate Analysis page in ML plugin in Observability serverless. Jul 12, 2024
@peteharverson peteharverson added release_note:feature Makes this part of the condensed release notes and removed release_note:enhancement labels Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis :ml release_note:feature Makes this part of the condensed release notes v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants