mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Get metric indices (#131898)
* Get metric indices * Infra plugin is required
This commit is contained in:
parent
ce29dabec6
commit
14ee59ca1c
2 changed files with 25 additions and 0 deletions
22
x-pack/plugins/apm/server/lib/helpers/get_metric_indices.ts
Normal file
22
x-pack/plugins/apm/server/lib/helpers/get_metric_indices.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* 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 { SavedObjectsClientContract } from '@kbn/core/server';
|
||||
import { APMRouteHandlerResources } from '../../routes/typings';
|
||||
|
||||
export async function getMetricIndices({
|
||||
infraPlugin,
|
||||
savedObjectsClient,
|
||||
}: {
|
||||
infraPlugin: Required<APMRouteHandlerResources['plugins']['infra']>;
|
||||
savedObjectsClient: SavedObjectsClientContract;
|
||||
}): Promise<string> {
|
||||
const infra = await infraPlugin.start();
|
||||
const metricIndices = await infra.getMetricIndices(savedObjectsClient);
|
||||
|
||||
return metricIndices;
|
||||
}
|
|
@ -49,6 +49,7 @@ import {
|
|||
FleetSetupContract as FleetPluginSetup,
|
||||
FleetStartContract as FleetPluginStart,
|
||||
} from '@kbn/fleet-plugin/server';
|
||||
import { InfraPluginStart, InfraPluginSetup } from '@kbn/infra-plugin/server';
|
||||
import { APMConfig } from '.';
|
||||
import { ApmIndicesConfig } from './routes/settings/apm_indices/get_apm_indices';
|
||||
import { APMEventClient } from './lib/helpers/create_es_client/create_apm_event_client';
|
||||
|
@ -71,6 +72,7 @@ export interface APMPluginSetupDependencies {
|
|||
licensing: LicensingPluginSetup;
|
||||
observability: ObservabilityPluginSetup;
|
||||
ruleRegistry: RuleRegistryPluginSetupContract;
|
||||
infra: InfraPluginSetup;
|
||||
|
||||
// optional dependencies
|
||||
actions?: ActionsPlugin['setup'];
|
||||
|
@ -92,6 +94,7 @@ export interface APMPluginStartDependencies {
|
|||
licensing: LicensingPluginStart;
|
||||
observability: undefined;
|
||||
ruleRegistry: RuleRegistryPluginStartContract;
|
||||
infra: InfraPluginStart;
|
||||
|
||||
// optional dependencies
|
||||
actions?: ActionsPlugin['start'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue