mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* Renaming folder * Renaming alertType to ruleType. Adding parameters to support group by * Renaming * Updating codeowners
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
/*
|
|
* 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 { Plugin, Logger, CoreSetup, PluginInitializerContext } from '@kbn/core/server';
|
|
|
|
import { StackAlertsDeps, StackAlertsStartDeps } from './types';
|
|
import { registerBuiltInRuleTypes } from './rule_types';
|
|
import { BUILT_IN_ALERTS_FEATURE } from './feature';
|
|
|
|
export class AlertingBuiltinsPlugin
|
|
implements Plugin<void, void, StackAlertsDeps, StackAlertsStartDeps>
|
|
{
|
|
private readonly logger: Logger;
|
|
|
|
constructor(ctx: PluginInitializerContext) {
|
|
this.logger = ctx.logger.get();
|
|
}
|
|
|
|
public setup(core: CoreSetup<StackAlertsStartDeps>, { alerting, features }: StackAlertsDeps) {
|
|
features.registerKibanaFeature(BUILT_IN_ALERTS_FEATURE);
|
|
|
|
registerBuiltInRuleTypes({
|
|
logger: this.logger,
|
|
data: core
|
|
.getStartServices()
|
|
.then(async ([, { triggersActionsUi }]) => triggersActionsUi.data),
|
|
alerting,
|
|
core,
|
|
});
|
|
}
|
|
|
|
public start() {}
|
|
public stop() {}
|
|
}
|