kibana icon indicating copy to clipboard operation
kibana copied to clipboard

[Agent Builder] APM error AI insights

Open viduni94 opened this issue 1 month ago • 4 comments

Closes https://github.com/elastic/obs-ai-assistant-team/issues/413

Summary

This PR handles APM error AI insights via Agent Builder.

Attachments:

  • AI_INSIGHT attachment type with AI Insight summary
  • ERROR attachment with errorId and 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_INSIGHT attachment and ERROR attachment.
  • 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

  1. Connect to a Observability test cluster
  2. In Kibana, go to "Observability" --> "Service Inventory"
  3. Pick a service and visit the "Error" tab and select an error
  4. 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

viduni94 avatar Nov 20 '25 21:11 viduni94

Pinging @elastic/obs-ai-team (Team:obs-ai)

elasticmachine avatar Dec 04 '25 01:12 elasticmachine

Pinging @elastic/obs-presentation-team (Team:obs-presentation)

elasticmachine avatar Dec 04 '25 01:12 elasticmachine

Thanks for the review @sorenlouv I've addressed all the comments. Hope you could take another look. Thank you

viduni94 avatar Dec 08 '25 20:12 viduni94

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.

see run history

kibanamachine avatar Dec 10 '25 19:12 kibanamachine

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

neptunian avatar Dec 10 '25 19:12 neptunian

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

viduni94 avatar Dec 10 '25 20:12 viduni94

:green_heart: Build Succeeded

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 comments for 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
Unknown metric groups

API count

id before after diff
observabilityAgentBuilder 24 29 +5

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

elasticmachine avatar Dec 11 '25 02:12 elasticmachine