|
4 | 4 | * you may not use this file except in compliance with the Elastic License. |
5 | 5 | */ |
6 | 6 | import { i18n } from '@kbn/i18n'; |
| 7 | +import { combineLatest, Observable } from 'rxjs'; |
| 8 | +import { map, take } from 'rxjs/operators'; |
7 | 9 | import { |
8 | | - PluginInitializerContext, |
9 | | - Plugin, |
10 | 10 | CoreSetup, |
11 | 11 | CoreStart, |
12 | 12 | Logger, |
| 13 | + Plugin, |
| 14 | + PluginInitializerContext, |
13 | 15 | } from 'src/core/server'; |
14 | | -import { Observable, combineLatest } from 'rxjs'; |
15 | | -import { map, take } from 'rxjs/operators'; |
16 | | -import { ObservabilityPluginSetup } from '../../observability/server'; |
17 | | -import { SecurityPluginSetup } from '../../security/server'; |
18 | | -import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/server'; |
19 | | -import { TaskManagerSetupContract } from '../../task_manager/server'; |
20 | | -import { AlertingPlugin } from '../../alerts/server'; |
21 | | -import { ActionsPlugin } from '../../actions/server'; |
| 16 | +import { APMConfig, APMXPackConfig, mergeConfigs } from '.'; |
22 | 17 | import { APMOSSPluginSetup } from '../../../../src/plugins/apm_oss/server'; |
23 | | -import { createApmAgentConfigurationIndex } from './lib/settings/agent_configuration/create_agent_config_index'; |
24 | | -import { createApmCustomLinkIndex } from './lib/settings/custom_link/create_custom_link_index'; |
25 | | -import { createApmApi } from './routes/create_apm_api'; |
26 | | -import { getApmIndices } from './lib/settings/apm_indices/get_apm_indices'; |
27 | | -import { APMConfig, mergeConfigs, APMXPackConfig } from '.'; |
28 | 18 | import { HomeServerPluginSetup } from '../../../../src/plugins/home/server'; |
| 19 | +import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/server'; |
| 20 | +import { ActionsPlugin } from '../../actions/server'; |
| 21 | +import { AlertingPlugin } from '../../alerts/server'; |
29 | 22 | import { CloudSetup } from '../../cloud/server'; |
30 | | -import { getInternalSavedObjectsClient } from './lib/helpers/get_internal_saved_objects_client'; |
31 | | -import { |
32 | | - LicensingPluginSetup, |
33 | | - LicensingPluginStart, |
34 | | -} from '../../licensing/server'; |
35 | | -import { registerApmAlerts } from './lib/alerts/register_apm_alerts'; |
36 | | -import { createApmTelemetry } from './lib/apm_telemetry'; |
37 | | - |
38 | 23 | import { PluginSetupContract as FeaturesPluginSetup } from '../../features/server'; |
| 24 | +import { LicensingPluginSetup } from '../../licensing/server'; |
| 25 | +import { MlPluginSetup } from '../../ml/server'; |
| 26 | +import { ObservabilityPluginSetup } from '../../observability/server'; |
| 27 | +import { SecurityPluginSetup } from '../../security/server'; |
| 28 | +import { TaskManagerSetupContract } from '../../task_manager/server'; |
39 | 29 | import { |
40 | 30 | APM_FEATURE, |
41 | 31 | APM_SERVICE_MAPS_FEATURE_NAME, |
42 | 32 | APM_SERVICE_MAPS_LICENSE_TYPE, |
43 | 33 | } from './feature'; |
| 34 | +import { registerApmAlerts } from './lib/alerts/register_apm_alerts'; |
| 35 | +import { createApmTelemetry } from './lib/apm_telemetry'; |
| 36 | +import { getInternalSavedObjectsClient } from './lib/helpers/get_internal_saved_objects_client'; |
| 37 | +import { createApmAgentConfigurationIndex } from './lib/settings/agent_configuration/create_agent_config_index'; |
| 38 | +import { getApmIndices } from './lib/settings/apm_indices/get_apm_indices'; |
| 39 | +import { createApmCustomLinkIndex } from './lib/settings/custom_link/create_custom_link_index'; |
| 40 | +import { createApmApi } from './routes/create_apm_api'; |
44 | 41 | import { apmIndices, apmTelemetry } from './saved_objects'; |
45 | 42 | import { createElasticCloudInstructions } from './tutorial/elastic_cloud'; |
46 | | -import { MlPluginSetup } from '../../ml/server'; |
47 | 43 |
|
48 | 44 | export interface APMPluginSetup { |
49 | 45 | config$: Observable<APMConfig>; |
@@ -135,18 +131,14 @@ export class APMPlugin implements Plugin<APMPluginSetup> { |
135 | 131 | APM_SERVICE_MAPS_LICENSE_TYPE |
136 | 132 | ); |
137 | 133 |
|
138 | | - core.getStartServices().then(([_coreStart, pluginsStart]) => { |
139 | | - createApmApi().init(core, { |
140 | | - config$: mergedConfig$, |
141 | | - logger: this.logger!, |
142 | | - plugins: { |
143 | | - licensing: (pluginsStart as { licensing: LicensingPluginStart }) |
144 | | - .licensing, |
145 | | - observability: plugins.observability, |
146 | | - security: plugins.security, |
147 | | - ml: plugins.ml, |
148 | | - }, |
149 | | - }); |
| 134 | + createApmApi().init(core, { |
| 135 | + config$: mergedConfig$, |
| 136 | + logger: this.logger!, |
| 137 | + plugins: { |
| 138 | + observability: plugins.observability, |
| 139 | + security: plugins.security, |
| 140 | + ml: plugins.ml, |
| 141 | + }, |
150 | 142 | }); |
151 | 143 |
|
152 | 144 | return { |
|
0 commit comments