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

[Obs AI Assistant] register alert details context in observability plugin #181501

Merged
merged 36 commits into from
May 1, 2024

Conversation

klacabane
Copy link
Contributor

@klacabane klacabane commented Apr 23, 2024

Summary

Closes #181286

Create a AlertDetailsContextService in observability plugin. The service can be used by solutions to register data handler fetching information relevant to an alert context which is then used as an input to the ai assistant when asked to investigate an alert. While only one handler is currently registered from apm plugin, the benefits are 1. making this information available to the ai assistant connector since it can't directly call apm api and 2. extending the context with additional data in the future, for example logs.

Follow up

  • Move apm route and associated tests to observability plugin

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@klacabane
Copy link
Contributor Author

/ci

@klacabane
Copy link
Contributor Author

/ci

@klacabane
Copy link
Contributor Author

/ci

@klacabane
Copy link
Contributor Author

/ci

@klacabane
Copy link
Contributor Author

/ci

@klacabane
Copy link
Contributor Author

/ci

@klacabane
Copy link
Contributor Author

/ci

@klacabane
Copy link
Contributor Author

/ci

@klacabane
Copy link
Contributor Author

/ci

Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

obs-ux-management changes LGTM

@sorenlouv sorenlouv enabled auto-merge (squash) May 1, 2024 07:56
@sorenlouv sorenlouv removed request for a team May 1, 2024 13:17
@kibana-ci
Copy link
Collaborator

kibana-ci commented May 1, 2024

💚 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
observability 286.7KB 285.7KB -1.0KB

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
module count - 5887 +5887
total size - 6.7MB +6.7MB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
apm 125 122 -3
observability 13 15 +2
total -1

History

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

@sorenlouv sorenlouv merged commit d883196 into elastic:main May 1, 2024
21 checks passed
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.14 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.14:
- [Obs AI Assistant] Remove unneeded plugin references (#182116)

Manual backport

To create the backport manually run:

node scripts/backport --pr 181501

Questions ?

Please refer to the Backport tool documentation

@sorenlouv
Copy link
Member

💚 All backports created successfully

Status Branch Result
8.14

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

TinLe added a commit to TinLe/kibana that referenced this pull request May 1, 2024
* master: (1654 commits)
  Bump ejs from 3.1.9 to 3.1.10
  Don't render exceptions flyout if data is loading (elastic#181588)
  Enable value list modal (elastic#181593)
  skip flaky suite (elastic#181777)
  skip failing test suite (elastic#182263)
  [Mappings Editor] Disable _source field in serverless (elastic#181712)
  [data.search] Fix unhandled promise rejections (elastic#181785)
  [Fleet] Fix logic for detecting first time Elastic Agent users (elastic#182214)
  [ML] Decouple data_visualizer from MapEmbeddable (elastic#181928)
  [ES|QL] Sorting accepts expressions (elastic#181916)
  [ML] Single Metric Viewer: ensures chart displays correctly when opening from a job annotation (elastic#182176)
  Adding optional Description field to Roles APIs (elastic#182039)
  Upgrade Markdown-it to 14.1.0 (elastic#182244)
  Bump xml-crypto from 5.0.0 to 6.0.0
  [DOCS] Fix docs and screenshots for rule creation changes (elastic#181925)
  Update dependency elastic-apm-node to ^4.5.3 (main) (elastic#182236)
  [Obs AI Assistant] register alert details context in observability plugin (elastic#181501)
  Add `@typescript-eslint/no-floating-promises` (elastic#181456)
  [Playground] Propagate Error message into FE (elastic#182201)
  [ES|QL] Rename the setting to a more generic one and move to the general section (elastic#182074)
  ...
sorenlouv added a commit that referenced this pull request May 2, 2024
…lity plugin (#181501) (#182305)

# Backport

This will backport the following commits from `main` to `8.14`:
- [[Obs AI Assistant] register alert details context in observability
plugin (#181501)](#181501)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Kevin
Lacabane","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-05-01T15:50:55Z","message":"[Obs
AI Assistant] register alert details context in observability plugin
(#181501)\n\n## Summary\r\nCloses
https://github.com/elastic/kibana/issues/181286\r\n\r\nCreate a
AlertDetailsContextService in `observability` plugin. The\r\nservice can
be used by solutions to register data handler fetching\r\ninformation
relevant to an alert context which is then used as an input\r\nto the ai
assistant when asked to investigate an alert. While only one\r\nhandler
is currently registered from apm plugin, the benefits are 1.\r\nmaking
this information available to the ai assistant connector since
it\r\ncan't directly call apm api and 2. extending the context with
additional\r\ndata in the future, for example logs.\r\n\r\n#### Follow
up\r\n- Move apm route and associated tests to observability
plugin","sha":"d8831961e868587deb9e72b0c135837977ad6199","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Obs
AI
Assistant","ci:project-deploy-observability","Team:obs-knowledge","Team:obs-ux-infra_services","Team:obs-ux-management","v8.14.0","v8.15.0"],"number":181501,"url":"https://github.com/elastic/kibana/pull/181501","mergeCommit":{"message":"[Obs
AI Assistant] register alert details context in observability plugin
(#181501)\n\n## Summary\r\nCloses
https://github.com/elastic/kibana/issues/181286\r\n\r\nCreate a
AlertDetailsContextService in `observability` plugin. The\r\nservice can
be used by solutions to register data handler fetching\r\ninformation
relevant to an alert context which is then used as an input\r\nto the ai
assistant when asked to investigate an alert. While only one\r\nhandler
is currently registered from apm plugin, the benefits are 1.\r\nmaking
this information available to the ai assistant connector since
it\r\ncan't directly call apm api and 2. extending the context with
additional\r\ndata in the future, for example logs.\r\n\r\n#### Follow
up\r\n- Move apm route and associated tests to observability
plugin","sha":"d8831961e868587deb9e72b0c135837977ad6199"}},"sourceBranch":"main","suggestedTargetBranches":["8.14"],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.15.0","labelRegex":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/181501","number":181501,"mergeCommit":{"message":"[Obs
AI Assistant] register alert details context in observability plugin
(#181501)\n\n## Summary\r\nCloses
https://github.com/elastic/kibana/issues/181286\r\n\r\nCreate a
AlertDetailsContextService in `observability` plugin. The\r\nservice can
be used by solutions to register data handler fetching\r\ninformation
relevant to an alert context which is then used as an input\r\nto the ai
assistant when asked to investigate an alert. While only one\r\nhandler
is currently registered from apm plugin, the benefits are 1.\r\nmaking
this information available to the ai assistant connector since
it\r\ncan't directly call apm api and 2. extending the context with
additional\r\ndata in the future, for example logs.\r\n\r\n#### Follow
up\r\n- Move apm route and associated tests to observability
plugin","sha":"d8831961e868587deb9e72b0c135837977ad6199"}}]}]
BACKPORT-->

Co-authored-by: Kevin Lacabane <[email protected]>
sorenlouv added a commit that referenced this pull request May 2, 2024
Follow-up to #181501

This moves the alert details context used by the AI Assistant from the
apm api `GET /internal/apm/assistant/get_obs_alert_details_context` to
the Obs api
`/internal/observability/assistant/alert_details_contextual_insights`.

This also involves adding a type safe API client to the observability
API tests

### Other changes:

- Rename `synthtraceEsClient` to `apmSynthtraceEsClient` to indicate it
is specific to APM
sorenlouv added a commit to kibanamachine/kibana that referenced this pull request May 2, 2024
…2243)

Follow-up to elastic#181501

This moves the alert details context used by the AI Assistant from the
apm api `GET /internal/apm/assistant/get_obs_alert_details_context` to
the Obs api
`/internal/observability/assistant/alert_details_contextual_insights`.

This also involves adding a type safe API client to the observability
API tests

### Other changes:

- Rename `synthtraceEsClient` to `apmSynthtraceEsClient` to indicate it
is specific to APM

(cherry picked from commit 0c9a323)
kibanamachine referenced this pull request May 2, 2024
…2243) (#182375)

# Backport

This will backport the following commits from `main` to `8.14`:
- [[Obs AI Assistant] Move alert context from apm to obs api
(#182243)](#182243)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Søren
Louv-Jansen","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-05-02T14:03:23Z","message":"[Obs
AI Assistant] Move alert context from apm to obs api
(#182243)\n\nFollow-up to
https://github.com/elastic/kibana/pull/181501\r\n\r\nThis moves the
alert details context used by the AI Assistant from the\r\napm api `GET
/internal/apm/assistant/get_obs_alert_details_context` to\r\nthe Obs
api\r\n`/internal/observability/assistant/alert_details_contextual_insights`.\r\n\r\nThis
also involves adding a type safe API client to the observability\r\nAPI
tests\r\n\r\n### Other changes:\r\n\r\n- Rename `synthtraceEsClient` to
`apmSynthtraceEsClient` to indicate it\r\nis specific to
APM","sha":"0c9a323816beedaa32f928312f3cefe8ea66e316","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","ci:project-deploy-observability","Team:obs-ux-infra_services","Team:obs-ux-management","v8.14.0","v8.15.0"],"title":"[Obs
AI Assistant] Move alert context from apm to obs
api","number":182243,"url":"https://github.com/elastic/kibana/pull/182243","mergeCommit":{"message":"[Obs
AI Assistant] Move alert context from apm to obs api
(#182243)\n\nFollow-up to
https://github.com/elastic/kibana/pull/181501\r\n\r\nThis moves the
alert details context used by the AI Assistant from the\r\napm api `GET
/internal/apm/assistant/get_obs_alert_details_context` to\r\nthe Obs
api\r\n`/internal/observability/assistant/alert_details_contextual_insights`.\r\n\r\nThis
also involves adding a type safe API client to the observability\r\nAPI
tests\r\n\r\n### Other changes:\r\n\r\n- Rename `synthtraceEsClient` to
`apmSynthtraceEsClient` to indicate it\r\nis specific to
APM","sha":"0c9a323816beedaa32f928312f3cefe8ea66e316"}},"sourceBranch":"main","suggestedTargetBranches":["8.14"],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/182243","number":182243,"mergeCommit":{"message":"[Obs
AI Assistant] Move alert context from apm to obs api
(#182243)\n\nFollow-up to
https://github.com/elastic/kibana/pull/181501\r\n\r\nThis moves the
alert details context used by the AI Assistant from the\r\napm api `GET
/internal/apm/assistant/get_obs_alert_details_context` to\r\nthe Obs
api\r\n`/internal/observability/assistant/alert_details_contextual_insights`.\r\n\r\nThis
also involves adding a type safe API client to the observability\r\nAPI
tests\r\n\r\n### Other changes:\r\n\r\n- Rename `synthtraceEsClient` to
`apmSynthtraceEsClient` to indicate it\r\nis specific to
APM","sha":"0c9a323816beedaa32f928312f3cefe8ea66e316"}}]}] BACKPORT-->

Co-authored-by: Søren Louv-Jansen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Obs AI Assistant Observability AI Assistant Team:obs-knowledge Observability Experience Knowledge team Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:obs-ux-management Observability Management User Experience Team v8.14.0 v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Obs AI Assistant] Improve alert context in connector
10 participants