kibana/x-pack/plugins/stack_alerts/server/plugin.ts
Ying Mao a62635146e
[Response Ops][Alerting] alert -> rule for stack alerts (#144613)
* Renaming folder

* Renaming alertType to ruleType. Adding parameters to support group by

* Renaming

* Updating codeowners
2022-11-04 14:44:41 -04:00

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() {}
}