@@ -27,6 +27,14 @@ import {
2727 ALERT_DETAILS ,
2828} from '../common/constants' ;
2929
30+ import { createCpuUsageAlertType } from './alerts/cpu_usage_alert' ;
31+ import { createMissingMonitoringDataAlertType } from './alerts/missing_monitoring_data_alert' ;
32+ import { createLegacyAlertTypes } from './alerts/legacy_alert' ;
33+ import { createDiskUsageAlertType } from './alerts/disk_usage_alert' ;
34+ import { createThreadPoolRejectionsAlertType } from './alerts/thread_pool_rejections_alert' ;
35+ import { createMemoryUsageAlertType } from './alerts/memory_usage_alert' ;
36+ import { createCCRReadExceptionsAlertType } from './alerts/ccr_read_exceptions_alert' ;
37+
3038interface MonitoringSetupPluginDependencies {
3139 home ?: HomePublicPluginSetup ;
3240 cloud ?: { isCloudEnabled : boolean } ;
@@ -72,7 +80,7 @@ export class MonitoringPlugin
7280 } ) ;
7381 }
7482
75- await this . registerAlertsAsync ( plugins ) ;
83+ this . registerAlerts ( plugins ) ;
7684
7785 const app : App = {
7886 id,
@@ -135,19 +143,7 @@ export class MonitoringPlugin
135143 ] ;
136144 }
137145
138- private registerAlertsAsync = async ( plugins : MonitoringSetupPluginDependencies ) => {
139- const { createCpuUsageAlertType } = await import ( './alerts/cpu_usage_alert' ) ;
140- const { createMissingMonitoringDataAlertType } = await import (
141- './alerts/missing_monitoring_data_alert'
142- ) ;
143- const { createLegacyAlertTypes } = await import ( './alerts/legacy_alert' ) ;
144- const { createDiskUsageAlertType } = await import ( './alerts/disk_usage_alert' ) ;
145- const { createThreadPoolRejectionsAlertType } = await import (
146- './alerts/thread_pool_rejections_alert'
147- ) ;
148- const { createMemoryUsageAlertType } = await import ( './alerts/memory_usage_alert' ) ;
149- const { createCCRReadExceptionsAlertType } = await import ( './alerts/ccr_read_exceptions_alert' ) ;
150-
146+ private registerAlerts ( plugins : MonitoringSetupPluginDependencies ) {
151147 const {
152148 triggersActionsUi : { alertTypeRegistry } ,
153149 } = plugins ;
@@ -172,5 +168,5 @@ export class MonitoringPlugin
172168 for ( const legacyAlertType of legacyAlertTypes ) {
173169 alertTypeRegistry . register ( legacyAlertType ) ;
174170 }
175- } ;
171+ }
176172}
0 commit comments