-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[ML] Switching to config files for serverless ML features #166477
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
Changes from all commits
3a852bd
4a10eb0
67d4864
1da14b2
68e2a89
071f773
c0b6ef3
1071942
d095a4b
157e63b
fd7fbe2
9853c46
3eb3fab
04fa7ed
9b76af2
3aa1c1d
2ebb3a1
f3fdd7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /* | ||
| * 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 { schema, type TypeOf } from '@kbn/config-schema'; | ||
|
|
||
| const enabledSchema = schema.maybe( | ||
| schema.object({ | ||
| enabled: schema.boolean(), | ||
| }) | ||
| ); | ||
|
|
||
| export const configSchema = schema.object({ | ||
| ad: enabledSchema, | ||
| dfa: enabledSchema, | ||
| nlp: enabledSchema, | ||
| }); | ||
|
|
||
| export type ConfigSchema = TypeOf<typeof configSchema>; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,13 @@ | |
| * 2.0. | ||
| */ | ||
|
|
||
| import { Logger } from '@kbn/core/server'; | ||
| import { AlertingPlugin } from '@kbn/alerting-plugin/server'; | ||
| import type { Logger } from '@kbn/core/server'; | ||
| import type { AlertingPlugin } from '@kbn/alerting-plugin/server'; | ||
| import { registerAnomalyDetectionAlertType } from './register_anomaly_detection_alert_type'; | ||
| import { SharedServices } from '../../shared_services'; | ||
| import type { SharedServices } from '../../shared_services'; | ||
| import { registerJobsMonitoringRuleType } from './register_jobs_monitoring_rule_type'; | ||
| import { MlServicesProviders } from '../../shared_services/shared_services'; | ||
| import type { MlServicesProviders } from '../../shared_services/shared_services'; | ||
| import type { MlFeatures } from '../../types'; | ||
|
|
||
| export interface RegisterAlertParams { | ||
| alerting: AlertingPlugin['setup']; | ||
|
|
@@ -19,7 +20,9 @@ export interface RegisterAlertParams { | |
| mlServicesProviders: MlServicesProviders; | ||
| } | ||
|
|
||
| export function registerMlAlerts(alertParams: RegisterAlertParams) { | ||
| registerAnomalyDetectionAlertType(alertParams); | ||
| registerJobsMonitoringRuleType(alertParams); | ||
| export function registerMlAlerts(alertParams: RegisterAlertParams, enabledFeatures: MlFeatures) { | ||
| if (enabledFeatures.ad === true) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question/suggestion: did you consider performing a check before
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm passing in the enabled features into
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To move the check out into the plugin.ts file, these register functions would need to be renamed to have |
||
| registerAnomalyDetectionAlertType(alertParams); | ||
| registerJobsMonitoringRuleType(alertParams); | ||
| } | ||
| } | ||
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.
Probably not related to the changes here, but should the Memory usage page be accessible in the Security project? There is a link to it from the ML home page, but I get the 'Access denied' 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.
The memory usage page is currently disabled in serverless.
This may be a mistake. I've pushed a fix to another WIP PR to change this. As that PR has some similar client side changes.