[ML] Switching to config files for serverless ML features#166477
Conversation
| registerAnomalyDetectionAlertType(alertParams); | ||
| registerJobsMonitoringRuleType(alertParams); | ||
| export function registerMlAlerts(alertParams: RegisterAlertParams, enabledFeatures: MlFeatures) { | ||
| if (enabledFeatures.ad === true) { |
There was a problem hiding this comment.
question/suggestion: did you consider performing a check before registerMlAlerts and registerCasesPersistableState are called?
There was a problem hiding this comment.
I'm passing in the enabled features into registerMlAlerts and have the check happen in there.
I did it this way to allow for future non AD alerts to still be registered by this function. As in, the registerMlAlerts function will decide which alerts to register.
There was a problem hiding this comment.
To move the check out into the plugin.ts file, these register functions would need to be renamed to have AD or similar in the name e.g. registerMlADAlerts
I thought it would be neater to have one function to register all ML alerts, and have it decide which ones to register based on feature enablement.
|
|
||
| initMlServerLog({ log: this.log }); | ||
|
|
||
| if (plugins.alerting) { |
There was a problem hiding this comment.
| if (plugins.alerting) { | |
| if (plugins.alerting && this.enabledFeatures.ad) { |
| mlSharedServices: sharedServicesProviders, | ||
| mlServicesProviders: internalServicesProviders, | ||
| }, | ||
| this.enabledFeatures |
There was a problem hiding this comment.
| this.enabledFeatures |
| @@ -323,8 +308,12 @@ export class MlServerPlugin | |||
| } | |||
|
|
|||
| if (mlLicense.isMlEnabled() && mlLicense.isFullLicense()) { | |||
| xpack.securitySolution.enableExperimental: | ||
| - discoverInTimeline | ||
|
|
||
| xpack.ml.ad.enabled: true |
There was a problem hiding this comment.
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.
jloleysens
left a comment
There was a problem hiding this comment.
re-approving on behalf of core?
peteharverson
left a comment
There was a problem hiding this comment.
Tested each project, and stateful, and LGTM. Just left a comment about renaming a file.
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Canvas Sharable Runtime
History
To update your PR or re-run it, just comment with: |
Switches to using the serverless config file to enabled/disable ML features rather than a function shared from the setup contract.
Storing these flags in a config file means they are already available when setup runs and so can be used when registering integrations into other plugins.
Removes the dependency on ML from
security_solution_serverless,serverless_observabilityandserverless_search