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] Hide insight components when license is incorrect or there are no configured connectors #181519

Merged

Conversation

sorenlouv
Copy link
Member

@sorenlouv sorenlouv commented Apr 24, 2024

Closes #181435

@sorenlouv sorenlouv requested a review from a team as a code owner April 24, 2024 07:20
@botelastic botelastic bot added the Team:Obs AI Assistant Observability AI Assistant label Apr 24, 2024
@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!)

} = useKibana();

const license = useObservable<ILicense | null>(licensing.license$);
const hasEnterpriseLicense = license?.hasAtLeast('enterprise');
if (isEmpty(connectors.connectors) || !hasEnterpriseLicense) {
Copy link
Member

Choose a reason for hiding this comment

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

should we do this in the consumer component? this might create some weird margins if the consumer component renders it in a flex item

Copy link
Member Author

Choose a reason for hiding this comment

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

I initially added the checks outside the component together with the isEnabled flag. However, that made the component async, so the consumer would have to await the component.

https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/observability_ai_assistant/public/plugin.tsx#L100

What alternatives do you see?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah... You mean, every consumer should be responsible for doing the check?

Copy link
Member Author

Choose a reason for hiding this comment

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

I could add a helper to make that easier though.

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm I see your point. We can add an useAvailability() hook that takes care of the licensing. we already have a useGenAIConnectors() so maybe we can combine those two. Or we can leave it for now, do you have a screenshot of how this looks in the places where we use contextual insights?

Copy link
Member Author

Choose a reason for hiding this comment

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

I check a few different ones, and even when wrapped in flex they still look fine to me.

Log rate analysis

image
image

APM error

image


image

@sorenlouv sorenlouv added release_note:skip Skip the PR/issue when compiling release notes v8.14.0 labels Apr 24, 2024
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observabilityAIAssistant 89 91 +2

Async chunks

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

id before after diff
observabilityAIAssistant 16.9KB 17.5KB +612.0B

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

@sorenlouv sorenlouv merged commit 67a2eb5 into elastic:main Apr 24, 2024
26 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 24, 2024
…or there are no configured connectors (elastic#181519)

Closes elastic#181435

(cherry picked from commit 67a2eb5)
@kibanamachine
Copy link
Contributor

💚 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

@sorenlouv sorenlouv deleted the hide-insight-components-when-unavailable branch April 24, 2024 11:03
kibanamachine added a commit that referenced this pull request Apr 24, 2024
…orrect or there are no configured connectors (#181519) (#181545)

# Backport

This will backport the following commits from `main` to `8.14`:
- [[Obs AI Assistant] Hide insight components when license is incorrect
or there are no configured connectors
(#181519)](#181519)

<!--- 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-04-24T10:36:41Z","message":"[Obs
AI Assistant] Hide insight components when license is incorrect or there
are no configured connectors (#181519)\n\nCloses
https://github.com/elastic/kibana/issues/181435","sha":"67a2eb54c98678b546b08bf6f810f44bd31e1055","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Obs
AI Assistant","v8.14.0","v8.15.0"],"title":"[Obs AI Assistant] Hide
insight components when license is incorrect or there are no configured
connectors","number":181519,"url":"https://github.com/elastic/kibana/pull/181519","mergeCommit":{"message":"[Obs
AI Assistant] Hide insight components when license is incorrect or there
are no configured connectors (#181519)\n\nCloses
https://github.com/elastic/kibana/issues/181435","sha":"67a2eb54c98678b546b08bf6f810f44bd31e1055"}},"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/181519","number":181519,"mergeCommit":{"message":"[Obs
AI Assistant] Hide insight components when license is incorrect or there
are no configured connectors (#181519)\n\nCloses
https://github.com/elastic/kibana/issues/181435","sha":"67a2eb54c98678b546b08bf6f810f44bd31e1055"}}]}]
BACKPORT-->

Co-authored-by: Søren Louv-Jansen <[email protected]>
kpatticha pushed a commit to kpatticha/kibana that referenced this pull request Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Obs AI Assistant Observability AI Assistant v8.14.0 v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Obs AI Assistant] Hide contextual insights if it won't work
5 participants