-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[ML] AIOps: Adding ability to disable AIOps in kibana #221286
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
Open
jgowdyelastic
wants to merge
34
commits into
elastic:main
Choose a base branch
from
jgowdyelastic:adding-ablility-to-disable-aiops-in-kibana
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+309
−219
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
4b1fdda
[ML] AIOps: Adding ability to disable AIOps in kibana
jgowdyelastic cd02e46
updating jsonc files
jgowdyelastic 4db48ca
Merge branch 'main' into adding-ablility-to-disable-aiops-in-kibana
jgowdyelastic 111a6d0
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine 0076366
Merge branch 'main' into adding-ablility-to-disable-aiops-in-kibana
jgowdyelastic 0e11a2a
Merge branch 'main' into adding-ablility-to-disable-aiops-in-kibana
jgowdyelastic 48980c4
switching to ui.enabled
jgowdyelastic bdbcf1f
updating test
jgowdyelastic 96213c9
Merge branch 'adding-ablility-to-disable-aiops-in-kibana' of github.c…
jgowdyelastic 67bb42b
fixing test
jgowdyelastic 934ae28
reverting config change
jgowdyelastic c75808d
fixing discover
jgowdyelastic 180d0b9
Merge branch 'main' into adding-ablility-to-disable-aiops-in-kibana
jgowdyelastic 51706c2
fixing types
jgowdyelastic 285a2b3
Merge branch 'adding-ablility-to-disable-aiops-in-kibana' of github.c…
jgowdyelastic bda3f08
Merge branch 'main' into adding-ablility-to-disable-aiops-in-kibana
jgowdyelastic 7a61e90
removing exposing to browser
jgowdyelastic 5968b25
Merge branch 'main' into adding-ablility-to-disable-aiops-in-kibana
jgowdyelastic 1420876
updating capability path
jgowdyelastic 7dc8ae0
Merge branch 'adding-ablility-to-disable-aiops-in-kibana' of github.c…
jgowdyelastic 4c24a8a
reverting auto lint change
jgowdyelastic 675b92e
reverting auto linting change
jgowdyelastic 800f5ec
reverting auto linting change
jgowdyelastic 94311ec
Merge branch 'main' into adding-ablility-to-disable-aiops-in-kibana
jgowdyelastic e4f20d2
fixing discover check
jgowdyelastic d67e715
Merge branch 'main' into adding-ablility-to-disable-aiops-in-kibana
jgowdyelastic 4b06489
improving capabilities check
jgowdyelastic 5761ed2
Merge branch 'adding-ablility-to-disable-aiops-in-kibana' of github.c…
jgowdyelastic 922e83b
Merge branch 'main' into adding-ablility-to-disable-aiops-in-kibana
jgowdyelastic 2f62baf
fixing aiops links in ml
jgowdyelastic a2cfe60
reverting auto lint change
jgowdyelastic b3b212d
Merge branch 'main' into adding-ablility-to-disable-aiops-in-kibana
jgowdyelastic eaa61c5
adding license check to switcher
jgowdyelastic e650afe
reinstating getPatternAnalysisAvailable
jgowdyelastic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
x-pack/platform/plugins/shared/aiops/server/config_schema.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import type { TypeOf } from '@kbn/config-schema'; | ||
import { schema } from '@kbn/config-schema'; | ||
import type { PluginConfigDescriptor } from '@kbn/core/server'; | ||
|
||
export const configSchema = schema.object({ | ||
ui: schema.maybe( | ||
schema.object({ | ||
enabled: schema.maybe(schema.boolean()), | ||
}) | ||
), | ||
}); | ||
|
||
export type ConfigSchema = TypeOf<typeof configSchema>; | ||
|
||
export const config: PluginConfigDescriptor<ConfigSchema> = { | ||
schema: configSchema, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
x-pack/platform/plugins/shared/aiops/server/lib/capabilities.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { CoreSetup } from '@kbn/core/server'; | ||
import { firstValueFrom } from 'rxjs'; | ||
import type { AiopsPluginStartDeps } from '../types'; | ||
|
||
export const setupCapabilities = (core: CoreSetup<AiopsPluginStartDeps>, enabled: boolean) => { | ||
core.capabilities.registerProvider(() => { | ||
return { | ||
aiops: { | ||
enabled, | ||
}, | ||
}; | ||
}); | ||
|
||
core.capabilities.registerSwitcher( | ||
async (request, capabilities, useDefaultCapabilities) => { | ||
const [, { licensing }] = await core.getStartServices(); | ||
const lic = await firstValueFrom(licensing.license$); | ||
if (lic.hasAtLeast('platinum') === false) { | ||
return { | ||
aiops: { | ||
enabled: false, | ||
}, | ||
}; | ||
} | ||
|
||
return {}; | ||
}, | ||
{ | ||
capabilityPath: 'aiops.*', | ||
} | ||
); | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would expose this config option to on-prem users which I think is unintentional, I think we should at least wrap it in a
offeringBasedSchema
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be a problem to also allow this for on-prem users?
We have ML feature flags which are similar e.g.
xpack.ml.ad.enabled
and in a recent security issue they've come in useful as we've suggested disablingad
as a possible solution until a fix is available.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should carefully consider what we expose and weigh it up against the benefit on-prem users could get.
Config exposed to on-prem is a public API contract that we cannot break until the next major. Every config option adds to the possible permutations that should be tested. When we only allow this to be set for a specific serverless tier, we can treat the combination of config flags as a single permutation.
So in the absence of a strong use case for an on-prem user and assuming we're only doing this because of essentials tier, I would not expose this to on-prem users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify in case I've missed something,
offeringBasedSchema
doesn't appear to be able to specify a serverless tier, you can just specify that the setting is serverless or not (or traditional or not)?I'm happy to make
xpack.aiops.ui.enabled
serverless only, but I think it should be a product decision. cc @arisonl @peteharverson @sophiec20