[Agent Builder] APM error AI insights
Closes https://github.com/elastic/obs-ai-assistant-team/issues/413
Summary
This PR handles APM error AI insights via Agent Builder.
Attachments:
AI_INSIGHTattachment type with AI Insight summaryERRORattachment witherrorIdand other params to fetch the error document.
Additions
- Adds an API to pre-fetch the error data and generate an LLM response by calling the inference client.
- Once the summary is generated it's showed inline on the page (uses the common component)
- The user can click on "Start conversation" which opens to the agent builder flyout to continue the conversation along with the
AI_INSIGHTattachment andERRORattachment. - When the user opens the agent builder flyout from an error page using the global nav button, the ERROR attachment is added to the context of the flyout.
- License check before rendering AI insights (we may want to make this part of the shared component)
To enable agent builder and the nav:
uiSettings:
overrides:
agentBuilder:navEnabled: true
agentBuilder:enabled: true
To see the AI insight, feature flag must be enabled for now. This feature will be hidden on main for now behind this flag until the Gen AI Setting is available.
feature_flags.overrides:
observabilityAgent.enabled: true
UI for AI insights
This PR consumes the common UI component in the observability-agent-builder package.
Testing
Observability test clusters were used for testing.
Testing instructions
- Connect to a Observability test cluster
- In Kibana, go to "Observability" --> "Service Inventory"
- Pick a service and visit the "Error" tab and select an error
- Click on "What's this error"
Screen recording
AI INSIGHTS:
https://github.com/user-attachments/assets/d1b0b2b2-9805-4737-8929-e27319164649
GLOBAL NAV:
https://github.com/user-attachments/assets/2e310f4b-563b-4681-83cb-fd2581936b3a
Checklist
- [x] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
- [ ] Unit or functional tests were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section, and the correct
release_note:*label is applied per the guidelines - [x] Review the backport guidelines and apply applicable
backport:*labels.
Pinging @elastic/obs-ai-team (Team:obs-ai)
Pinging @elastic/obs-presentation-team (Team:obs-presentation)
Thanks for the review @sorenlouv I've addressed all the comments. Hope you could take another look. Thank you
Flaky Test Runner Stats
🎉 All tests passed! - kibana-flaky-test-suite-runner#10052
[✅] x-pack/solutions/observability/test/api_integration_deployment_agnostic/feature_flag_configs/stateful/oblt.ai_agent.stateful.config.ts: 50/50 tests passed.
Your serverless tests will fail because they need to be registered sync https://github.com/elastic/kibana/pull/244023/files#diff-31fd5a7a673266714e7b4d8b96c619111a6f01f3d4642e24622787b6b7082cc4 . I went ahead and made the change in my PR since we're removing that feature flag async call in https://github.com/elastic/kibana/pull/245299
Your serverless tests will fail because they need to be registered sync https://github.com/elastic/kibana/pull/244023/files#diff-31fd5a7a673266714e7b4d8b96c619111a6f01f3d4642e24622787b6b7082cc4 . I went ahead and made the change in my PR since we're removing that feature flag async call in #245299
Thanks @neptunian Updated
:green_heart: Build Succeeded
- Buildkite Build
- Commit: 07507329cba579c9965201cb3b15aca8f395280a
Metrics [docs]
Module Count
Fewer modules leads to a faster build time
| id | before | after | diff |
|---|---|---|---|
apm |
2044 | 2065 | +21 |
Public APIs missing comments
Total count of every public API that lacks a comment. Target amount is 0. Run
node scripts/build_api_docs --plugin [yourplugin] --stats commentsfor more detailed information.
| id | before | after | diff |
|---|---|---|---|
observabilityAgentBuilder |
24 | 29 | +5 |
Async chunks
Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app
| id | before | after | diff |
|---|---|---|---|
apm |
2.8MB | 2.9MB | +9.4KB |
History
- :green_heart: Build #371418 succeeded 85effd2f4ca6d6e86ddfe276c5eeec02b2312180
- :broken_heart: Build #371300 failed 9f5cb647b12ad948582eb2f6b8921dbf45104914
- :broken_heart: Build #371181 failed 7a2ea8adb9cdbacd31f722aa5e0f079798e48215
- :yellow_heart: Build #370565 was flaky a97b9215afc5f2d90f71a1ca12e3cfb24604a242
- :green_heart: Build #370246 succeeded 5361f13c12bf5296020628196485fb18a645e2d4
- :broken_heart: Build #370212 failed 5ba1642ecdafbeb78d60afe7c972ef420fbfc9c4
cc @viduni94