From 61dc25db8152d61b7f7a4e60b26cb32aca2f96a9 Mon Sep 17 00:00:00 2001 From: Oliver Gupte Date: Wed, 13 Oct 2021 15:53:58 -0400 Subject: [PATCH] [APM] Removes the apm_oss plugin and deprecates related configs (#113364) (#114873) * [APM] Removes the apm_oss plugin and deprecates related configs (#108160) * removes commented lines * fixes typescript errors * performs start up migration on the saved objects mapping for apm-indices * removes all references to the deprecated apm_oss.* config paths in APM * fixes missing bundle error * fixes type error * fixes eslint error with disabled rules * fixes saved object mappings for es_archvices for tests * fixes eslint error * Updates default index values to include the more general apm-*. Fixes broken tests. * removing unused configs from the config path migration: apm_oss.indexPattern and apm_oss.fleetMode * - replaces full index configuration paths with references in the `xpack.apm.indices` namespace - removes mergeConfig function and test * fixes proxy mock object in unit test * fixes linting issues * PR feedback and failed test * changes the configs at `xpack.apm.indices.*` from plural to singular to match `processor.event` values # Conflicts: # x-pack/test/functional/es_archives/cases/migrations/7.16.0_space/mappings.json # x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space/mappings.json --- docs/developer/plugin-list.asciidoc | 4 - packages/kbn-optimizer/limits.yml | 1 - .../resources/base/bin/kibana-docker | 6 ++ src/plugins/apm_oss/README.asciidoc | 5 - src/plugins/apm_oss/kibana.json | 13 --- src/plugins/apm_oss/public/index.ts | 16 --- src/plugins/apm_oss/public/plugin.ts | 22 ----- src/plugins/apm_oss/public/types.ts | 16 --- src/plugins/apm_oss/server/index.ts | 40 -------- src/plugins/apm_oss/server/plugin.ts | 30 ------ src/plugins/apm_oss/tsconfig.json | 17 ---- .../integration/power_user/no_data_screen.ts | 25 +++-- x-pack/plugins/apm/kibana.json | 1 - .../app/Settings/ApmIndices/index.tsx | 19 ++-- .../plugins/apm/public/utils/testHelpers.tsx | 28 +++--- .../apm/scripts/shared/read-kibana-config.ts | 14 ++- .../scripts/upload-telemetry-data/index.ts | 7 +- x-pack/plugins/apm/server/index.test.ts | 40 -------- x-pack/plugins/apm/server/index.ts | 97 ++++++------------- .../alerts/register_error_count_alert_type.ts | 2 +- ...egister_transaction_duration_alert_type.ts | 6 +- ...ister_transaction_error_rate_alert_type.ts | 6 +- .../apm/server/lib/alerts/test_utils/index.ts | 8 +- .../create_anomaly_detection_jobs.ts | 2 +- .../collect_data_telemetry/tasks.test.ts | 10 +- .../collect_data_telemetry/tasks.ts | 78 +++++++-------- .../errors/distribution/get_buckets.test.ts | 14 ++- .../get_is_using_transaction_events.test.ts | 9 +- .../get_is_using_transaction_events.ts | 3 +- .../helpers/aggregated_transactions/index.ts | 3 +- .../unpack_processor_events.test.ts | 13 ++- .../unpack_processor_events.ts | 19 ++-- .../server/lib/helpers/setup_request.test.ts | 23 ++--- .../create_static_index_pattern.test.ts | 25 ++--- .../create_static_index_pattern.ts | 2 +- .../get_apm_index_pattern_title.test.ts | 18 ++-- .../get_apm_index_pattern_title.ts | 8 +- .../java/gc/fetch_and_transform_gc_metrics.ts | 2 +- .../metrics/fetch_and_transform_metrics.ts | 2 +- .../apm/server/lib/rum_client/has_rum_data.ts | 4 +- ...ransactions_correlations_search_service.ts | 2 +- .../latency_correlations_search_service.ts | 2 +- .../search_strategy_provider.test.ts | 5 +- .../server/lib/service_map/get_service_map.ts | 5 +- .../get_service_map_service_node_info.test.ts | 4 +- .../lib/service_map/get_trace_sample_ids.ts | 13 +-- .../get_service_transaction_groups.ts | 2 +- .../settings/apm_indices/get_apm_indices.ts | 37 +++---- .../traces/__snapshots__/queries.test.ts.snap | 2 +- .../apm/server/lib/traces/get_trace_items.ts | 8 +- .../lib/transactions/breakdown/index.test.ts | 19 ++-- .../lib/transactions/breakdown/index.ts | 2 +- x-pack/plugins/apm/server/plugin.ts | 26 ++--- x-pack/plugins/apm/server/routes/fleet.ts | 6 +- .../plugins/apm/server/routes/service_map.ts | 6 +- .../apm/server/routes/settings/apm_indices.ts | 21 ++-- .../apm/server/saved_objects/apm_indices.ts | 42 ++++---- .../migrations/update_apm_oss_index_paths.ts | 36 +++++++ .../apm/server/tutorial/envs/on_prem.ts | 16 +-- x-pack/plugins/apm/server/tutorial/index.ts | 2 +- x-pack/plugins/apm/server/types.ts | 6 -- .../plugins/apm/server/utils/test_helpers.tsx | 44 ++++----- x-pack/plugins/apm/tsconfig.json | 1 - .../plugins/observability/common/typings.ts | 14 ++- .../hooks/use_app_index_pattern.tsx | 2 +- .../public/context/has_data_context.test.tsx | 5 +- .../observability/public/data_handler.test.ts | 5 +- .../pages/overview/overview.stories.tsx | 5 +- .../encrypted_saved_objects/mappings.json | 38 ++++---- .../mappings.json | 38 ++++---- .../es_archiver/key_rotation/mappings.json | 38 ++++---- .../action_task_params/mappings.json | 38 ++++---- .../es_archives/actions/mappings.json | 38 ++++---- .../es_archives/alerts_legacy/mappings.json | 38 ++++---- .../es_archives/canvas/reports/mappings.json | 38 ++++---- .../cases/migrations/7.10.0/mappings.json | 38 ++++---- .../cases/migrations/7.11.1/mappings.json | 40 ++++---- .../cases/migrations/7.13.2/mappings.json | 40 ++++---- .../7.13_user_actions/mappings.json | 40 ++++---- .../data/search_sessions/mappings.json | 38 ++++---- .../telemetry/agent_only/mappings.json | 38 ++++---- .../mappings.json | 38 ++++---- .../cloned_endpoint_installed/mappings.json | 38 ++++---- .../cloned_endpoint_uninstalled/mappings.json | 38 ++++---- .../endpoint_malware_disabled/mappings.json | 38 ++++---- .../endpoint_malware_enabled/mappings.json | 38 ++++---- .../endpoint_uninstalled/mappings.json | 38 ++++---- .../es_archives/fleet/agents/mappings.json | 38 ++++---- .../mappings.json | 38 ++++---- .../es_archives/lists/mappings.json | 38 ++++---- .../canvas_disallowed_url/mappings.json | 38 ++++---- .../ecommerce_kibana_spaces/mappings.json | 38 ++++---- .../reporting/hugedata/mappings.json | 38 ++++---- .../multi_index_kibana/mappings.json | 40 ++++---- .../migrations/mappings.json | 38 ++++---- .../timelines/7.15.0/mappings.json | 38 ++++---- .../visualize/default/mappings.json | 38 ++++---- 97 files changed, 850 insertions(+), 1256 deletions(-) delete mode 100644 src/plugins/apm_oss/README.asciidoc delete mode 100644 src/plugins/apm_oss/kibana.json delete mode 100644 src/plugins/apm_oss/public/index.ts delete mode 100644 src/plugins/apm_oss/public/plugin.ts delete mode 100644 src/plugins/apm_oss/public/types.ts delete mode 100644 src/plugins/apm_oss/server/index.ts delete mode 100644 src/plugins/apm_oss/server/plugin.ts delete mode 100644 src/plugins/apm_oss/tsconfig.json delete mode 100644 x-pack/plugins/apm/server/index.test.ts create mode 100644 x-pack/plugins/apm/server/saved_objects/migrations/update_apm_oss_index_paths.ts diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 6f678b494c2b6..03ea196f49837 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -26,10 +26,6 @@ NOTE: |WARNING: Missing README. -|{kib-repo}blob/{branch}/src/plugins/apm_oss/README.asciidoc[apmOss] -|undefined - - |{kib-repo}blob/{branch}/src/plugins/bfetch/README.md[bfetch] |bfetch allows to batch HTTP requests and streams responses back. diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index d62115c44b0c5..7eca73521b2f6 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -2,7 +2,6 @@ pageLoadAssetSize: advancedSettings: 27596 alerting: 106936 apm: 64385 - apmOss: 18996 bfetch: 51874 canvas: 1066647 charts: 95000 diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index c957293aa59aa..0b1a076c0ac99 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -226,6 +226,12 @@ kibana_vars=( xpack.alerts.invalidateApiKeysTask.interval xpack.alerts.invalidateApiKeysTask.removalDelay xpack.apm.enabled + xpack.apm.indices.errors + xpack.apm.indices.metrics + xpack.apm.indices.onboarding + xpack.apm.indices.sourcemaps + xpack.apm.indices.spans + xpack.apm.indices.transactions xpack.apm.maxServiceEnvironments xpack.apm.searchAggregatedTransactions xpack.apm.serviceMapEnabled diff --git a/src/plugins/apm_oss/README.asciidoc b/src/plugins/apm_oss/README.asciidoc deleted file mode 100644 index c3c060a99ee27..0000000000000 --- a/src/plugins/apm_oss/README.asciidoc +++ /dev/null @@ -1,5 +0,0 @@ -# APM OSS plugin - -OSS plugin for APM. Includes index configuration and tutorial resources. - -See <<../../x-pack/plugins/apm/readme.md,the X-Pack APM plugin README>> for information about the main APM plugin. diff --git a/src/plugins/apm_oss/kibana.json b/src/plugins/apm_oss/kibana.json deleted file mode 100644 index f18b275add9e3..0000000000000 --- a/src/plugins/apm_oss/kibana.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": "apmOss", - "owner": { - "name": "APM UI", - "githubTeam": "apm-ui" - }, - "version": "8.0.0", - "server": true, - "kibanaVersion": "kibana", - "configPath": ["apm_oss"], - "ui": true, - "requiredPlugins": ["home"] -} diff --git a/src/plugins/apm_oss/public/index.ts b/src/plugins/apm_oss/public/index.ts deleted file mode 100644 index fea8ac4a8a1e4..0000000000000 --- a/src/plugins/apm_oss/public/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { ApmOssPlugin } from './plugin'; - -// This exports static code and TypeScript types, -// as well as, Kibana Platform `plugin()` initializer. -export function plugin() { - return new ApmOssPlugin(); -} -export { ApmOssPluginSetup, ApmOssPluginStart } from './types'; diff --git a/src/plugins/apm_oss/public/plugin.ts b/src/plugins/apm_oss/public/plugin.ts deleted file mode 100644 index e6981954b301a..0000000000000 --- a/src/plugins/apm_oss/public/plugin.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { CoreSetup, CoreStart, Plugin } from 'kibana/public'; -import { ApmOssPluginSetup, ApmOssPluginStart } from './types'; - -export class ApmOssPlugin implements Plugin { - public setup(core: CoreSetup): ApmOssPluginSetup { - return {}; - } - - public start(core: CoreStart): ApmOssPluginStart { - return {}; - } - - public stop() {} -} diff --git a/src/plugins/apm_oss/public/types.ts b/src/plugins/apm_oss/public/types.ts deleted file mode 100644 index 16a1fe8be8004..0000000000000 --- a/src/plugins/apm_oss/public/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ApmOssPluginSetup {} - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ApmOssPluginStart {} - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface AppPluginStartDependencies {} diff --git a/src/plugins/apm_oss/server/index.ts b/src/plugins/apm_oss/server/index.ts deleted file mode 100644 index f2f6777672e33..0000000000000 --- a/src/plugins/apm_oss/server/index.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { schema, TypeOf } from '@kbn/config-schema'; -import { ConfigDeprecationProvider, PluginInitializerContext } from '../../../core/server'; -import { APMOSSPlugin } from './plugin'; - -const deprecations: ConfigDeprecationProvider = ({ deprecate, unused }) => [ - deprecate('enabled', '8.0.0'), - unused('fleetMode'), - unused('indexPattern'), -]; - -export const config = { - schema: schema.object({ - enabled: schema.boolean({ defaultValue: true }), - transactionIndices: schema.string({ defaultValue: 'apm-*' }), - spanIndices: schema.string({ defaultValue: 'apm-*' }), - errorIndices: schema.string({ defaultValue: 'apm-*' }), - metricsIndices: schema.string({ defaultValue: 'apm-*' }), - sourcemapIndices: schema.string({ defaultValue: 'apm-*' }), - onboardingIndices: schema.string({ defaultValue: 'apm-*' }), - indexPattern: schema.string({ defaultValue: 'apm-*' }), - fleetMode: schema.boolean({ defaultValue: true }), - }), - deprecations, -}; - -export function plugin(initializerContext: PluginInitializerContext) { - return new APMOSSPlugin(initializerContext); -} - -export type APMOSSConfig = TypeOf; - -export { APMOSSPluginSetup } from './plugin'; diff --git a/src/plugins/apm_oss/server/plugin.ts b/src/plugins/apm_oss/server/plugin.ts deleted file mode 100644 index 02a8ac38be2a3..0000000000000 --- a/src/plugins/apm_oss/server/plugin.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Observable } from 'rxjs'; -import { Plugin, PluginInitializerContext } from 'src/core/server'; -import { APMOSSConfig } from './'; - -export class APMOSSPlugin implements Plugin { - constructor(private readonly initContext: PluginInitializerContext) { - this.initContext = initContext; - } - public setup() { - const config$ = this.initContext.config.create(); - const config = this.initContext.config.get(); - return { config, config$ }; - } - - start() {} - stop() {} -} - -export interface APMOSSPluginSetup { - config: APMOSSConfig; - config$: Observable; -} diff --git a/src/plugins/apm_oss/tsconfig.json b/src/plugins/apm_oss/tsconfig.json deleted file mode 100644 index 08ed86d5da0a8..0000000000000 --- a/src/plugins/apm_oss/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 - "server/tutorial/index_pattern.json" - ], - "references": [{ "path": "../../core/tsconfig.json" }, { "path": "../home/tsconfig.json" }] -} diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/no_data_screen.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/no_data_screen.ts index 1e954d9982295..47eba11e6f6fb 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/no_data_screen.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/no_data_screen.ts @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -/* eslint-disable @typescript-eslint/naming-convention */ const apmIndicesSaveURL = '/internal/apm/settings/apm-indices/save'; @@ -20,12 +19,12 @@ describe('No data screen', () => { url: apmIndicesSaveURL, method: 'POST', body: { - 'apm_oss.sourcemapIndices': 'foo-*', - 'apm_oss.errorIndices': 'foo-*', - 'apm_oss.onboardingIndices': 'foo-*', - 'apm_oss.spanIndices': 'foo-*', - 'apm_oss.transactionIndices': 'foo-*', - 'apm_oss.metricsIndices': 'foo-*', + sourcemaps: 'foo-*', + errors: 'foo-*', + onboarding: 'foo-*', + spans: 'foo-*', + transactions: 'foo-*', + metrics: 'foo-*', }, headers: { 'kbn-xsrf': true, @@ -50,12 +49,12 @@ describe('No data screen', () => { url: apmIndicesSaveURL, method: 'POST', body: { - 'apm_oss.sourcemapIndices': '', - 'apm_oss.errorIndices': '', - 'apm_oss.onboardingIndices': '', - 'apm_oss.spanIndices': '', - 'apm_oss.transactionIndices': '', - 'apm_oss.metricsIndices': '', + sourcemaps: '', + errors: '', + onboarding: '', + spans: '', + transactions: '', + metrics: '', }, headers: { 'kbn-xsrf': true }, auth: { user: 'apm_power_user', pass: 'changeme' }, diff --git a/x-pack/plugins/apm/kibana.json b/x-pack/plugins/apm/kibana.json index 4e82d82d655b4..865358959ea72 100644 --- a/x-pack/plugins/apm/kibana.json +++ b/x-pack/plugins/apm/kibana.json @@ -8,7 +8,6 @@ "version": "8.0.0", "kibanaVersion": "kibana", "requiredPlugins": [ - "apmOss", "data", "embeddable", "features", diff --git a/x-pack/plugins/apm/public/components/app/Settings/ApmIndices/index.tsx b/x-pack/plugins/apm/public/components/app/Settings/ApmIndices/index.tsx index 6685dddd87d7f..2e526eff04346 100644 --- a/x-pack/plugins/apm/public/components/app/Settings/ApmIndices/index.tsx +++ b/x-pack/plugins/apm/public/components/app/Settings/ApmIndices/index.tsx @@ -30,40 +30,40 @@ import { const APM_INDEX_LABELS = [ { - configurationName: 'apm_oss.sourcemapIndices', + configurationName: 'sourcemap', label: i18n.translate( 'xpack.apm.settings.apmIndices.sourcemapIndicesLabel', { defaultMessage: 'Sourcemap Indices' } ), }, { - configurationName: 'apm_oss.errorIndices', + configurationName: 'error', label: i18n.translate('xpack.apm.settings.apmIndices.errorIndicesLabel', { defaultMessage: 'Error Indices', }), }, { - configurationName: 'apm_oss.onboardingIndices', + configurationName: 'onboarding', label: i18n.translate( 'xpack.apm.settings.apmIndices.onboardingIndicesLabel', { defaultMessage: 'Onboarding Indices' } ), }, { - configurationName: 'apm_oss.spanIndices', + configurationName: 'span', label: i18n.translate('xpack.apm.settings.apmIndices.spanIndicesLabel', { defaultMessage: 'Span Indices', }), }, { - configurationName: 'apm_oss.transactionIndices', + configurationName: 'transaction', label: i18n.translate( 'xpack.apm.settings.apmIndices.transactionIndicesLabel', { defaultMessage: 'Transaction Indices' } ), }, { - configurationName: 'apm_oss.metricsIndices', + configurationName: 'metric', label: i18n.translate('xpack.apm.settings.apmIndices.metricsIndicesLabel', { defaultMessage: 'Metrics Indices', }), @@ -145,7 +145,7 @@ export function ApmIndices() { } ), }); - } catch (error) { + } catch (error: any) { notifications.toasts.addDanger({ title: i18n.translate( 'xpack.apm.settings.apmIndices.applyChanges.failed.title', @@ -215,7 +215,10 @@ export function ApmIndices() { { defaultMessage: 'Overrides {configurationName}: {defaultValue}', - values: { configurationName, defaultValue }, + values: { + configurationName: `xpack.apm.indices.${configurationName}`, + defaultValue, + }, } )} fullWidth diff --git a/x-pack/plugins/apm/public/utils/testHelpers.tsx b/x-pack/plugins/apm/public/utils/testHelpers.tsx index 8764ac48c5440..2203bc63f68cd 100644 --- a/x-pack/plugins/apm/public/utils/testHelpers.tsx +++ b/x-pack/plugins/apm/public/utils/testHelpers.tsx @@ -119,14 +119,12 @@ interface MockSetup { config: APMConfig; uiFilters: UxUIFilters; indices: { - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.sourcemapIndices': string; - 'apm_oss.errorIndices': string; - 'apm_oss.onboardingIndices': string; - 'apm_oss.spanIndices': string; - 'apm_oss.transactionIndices': string; - 'apm_oss.metricsIndices': string; - /* eslint-enable @typescript-eslint/naming-convention */ + sourcemaps: string; + errors: string; + onboarding: string; + spans: string; + transactions: string; + metrics: string; apmAgentConfigurationIndex: string; apmCustomLinkIndex: string; }; @@ -178,14 +176,12 @@ export async function inspectSearchParams( ) as APMConfig, uiFilters: {}, indices: { - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.sourcemapIndices': 'myIndex', - 'apm_oss.errorIndices': 'myIndex', - 'apm_oss.onboardingIndices': 'myIndex', - 'apm_oss.spanIndices': 'myIndex', - 'apm_oss.transactionIndices': 'myIndex', - 'apm_oss.metricsIndices': 'myIndex', - /* eslint-enable @typescript-eslint/naming-convention */ + sourcemaps: 'myIndex', + errors: 'myIndex', + onboarding: 'myIndex', + spans: 'myIndex', + transactions: 'myIndex', + metrics: 'myIndex', apmAgentConfigurationIndex: 'myIndex', apmCustomLinkIndex: 'myIndex', }, diff --git a/x-pack/plugins/apm/scripts/shared/read-kibana-config.ts b/x-pack/plugins/apm/scripts/shared/read-kibana-config.ts index a85bd007bc4f3..f3e2b48390468 100644 --- a/x-pack/plugins/apm/scripts/shared/read-kibana-config.ts +++ b/x-pack/plugins/apm/scripts/shared/read-kibana-config.ts @@ -38,14 +38,12 @@ export const readKibanaConfig = () => { }; return { - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.transactionIndices': 'apm-*', - 'apm_oss.metricsIndices': 'apm-*', - 'apm_oss.errorIndices': 'apm-*', - 'apm_oss.spanIndices': 'apm-*', - 'apm_oss.onboardingIndices': 'apm-*', - 'apm_oss.sourcemapIndices': 'apm-*', - /* eslint-enable @typescript-eslint/naming-convention */ + 'xpack.apm.indices.transaction': 'traces-apm*,apm-*', + 'xpack.apm.indices.metric': 'metrics-apm*,apm-*', + 'xpack.apm.indices.error': 'logs-apm*,apm-*', + 'xpack.apm.indices.span': 'traces-apm*,apm-*', + 'xpack.apm.indices.onboarding': 'apm-*', + 'xpack.apm.indices.sourcemap': 'apm-*', 'elasticsearch.hosts': 'http://localhost:9200', ...loadedKibanaConfig, ...cliEsCredentials, diff --git a/x-pack/plugins/apm/scripts/upload-telemetry-data/index.ts b/x-pack/plugins/apm/scripts/upload-telemetry-data/index.ts index 0dab75cfba9c7..c900123c6cee9 100644 --- a/x-pack/plugins/apm/scripts/upload-telemetry-data/index.ts +++ b/x-pack/plugins/apm/scripts/upload-telemetry-data/index.ts @@ -78,7 +78,12 @@ async function uploadData() { collectTelemetryParams: { logger: console as unknown as Logger, indices: { - ...config, + transaction: config['xpack.apm.indices.transaction'], + metric: config['xpack.apm.indices.metric'], + error: config['xpack.apm.indices.error'], + span: config['xpack.apm.indices.span'], + onboarding: config['xpack.apm.indices.onboarding'], + sourcemap: config['xpack.apm.indices.sourcemap'], apmCustomLinkIndex: '.apm-custom-links', apmAgentConfigurationIndex: '.apm-agent-configuration', }, diff --git a/x-pack/plugins/apm/server/index.test.ts b/x-pack/plugins/apm/server/index.test.ts deleted file mode 100644 index be93557fea6fc..0000000000000 --- a/x-pack/plugins/apm/server/index.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import { APMOSSConfig } from 'src/plugins/apm_oss/server'; -import { APMXPackConfig } from '.'; -import { mergeConfigs } from './index'; - -describe('mergeConfigs', () => { - it('merges the configs', () => { - const apmOssConfig = { - transactionIndices: 'apm-*-transaction-*', - spanIndices: 'apm-*-span-*', - errorIndices: 'apm-*-error-*', - metricsIndices: 'apm-*-metric-*', - } as APMOSSConfig; - - const apmConfig = { - ui: { enabled: false }, - enabled: true, - metricsInterval: 2000, - agent: { migrations: { enabled: true } }, - } as APMXPackConfig; - - expect(mergeConfigs(apmOssConfig, apmConfig)).toEqual({ - 'apm_oss.errorIndices': 'logs-apm*,apm-*-error-*', - 'apm_oss.metricsIndices': 'metrics-apm*,apm-*-metric-*', - 'apm_oss.spanIndices': 'traces-apm*,apm-*-span-*', - 'apm_oss.transactionIndices': 'traces-apm*,apm-*-transaction-*', - 'xpack.apm.metricsInterval': 2000, - 'xpack.apm.ui.enabled': false, - 'xpack.apm.agent.migrations.enabled': true, - }); - }); -}); diff --git a/x-pack/plugins/apm/server/index.ts b/x-pack/plugins/apm/server/index.ts index 22787b0301ce0..c0dffc50e4e4f 100644 --- a/x-pack/plugins/apm/server/index.ts +++ b/x-pack/plugins/apm/server/index.ts @@ -10,11 +10,12 @@ import { PluginConfigDescriptor, PluginInitializerContext, } from 'src/core/server'; -import { APMOSSConfig } from 'src/plugins/apm_oss/server'; import { maxSuggestions } from '../../observability/common'; import { SearchAggregatedTransactionSetting } from '../common/aggregated_transactions'; import { APMPlugin } from './plugin'; +// All options should be documented in the APM configuration settings: https://github.com/elastic/kibana/blob/master/docs/settings/apm-settings.asciidoc +// and be included on cloud allow list unless there are specific reasons not to const configSchema = schema.object({ enabled: schema.boolean({ defaultValue: true }), serviceMapEnabled: schema.boolean({ defaultValue: true }), @@ -47,12 +48,37 @@ const configSchema = schema.object({ enabled: schema.boolean({ defaultValue: false }), }), }), + indices: schema.object({ + transaction: schema.string({ defaultValue: 'traces-apm*,apm-*' }), + span: schema.string({ defaultValue: 'traces-apm*,apm-*' }), + error: schema.string({ defaultValue: 'logs-apm*,apm-*' }), + metric: schema.string({ defaultValue: 'metrics-apm*,apm-*' }), + sourcemap: schema.string({ defaultValue: 'apm-*' }), + onboarding: schema.string({ defaultValue: 'apm-*' }), + }), }); // plugin config -export const config: PluginConfigDescriptor = { - deprecations: ({ deprecate, renameFromRoot }) => [ +export const config: PluginConfigDescriptor = { + deprecations: ({ + deprecate, + renameFromRoot, + deprecateFromRoot, + unusedFromRoot, + }) => [ deprecate('enabled', '8.0.0'), + renameFromRoot( + 'apm_oss.transactionIndices', + 'xpack.apm.indices.transaction' + ), + renameFromRoot('apm_oss.spanIndices', 'xpack.apm.indices.span'), + renameFromRoot('apm_oss.errorIndices', 'xpack.apm.indices.error'), + renameFromRoot('apm_oss.metricsIndices', 'xpack.apm.indices.metric'), + renameFromRoot('apm_oss.sourcemapIndices', 'xpack.apm.indices.sourcemap'), + renameFromRoot('apm_oss.onboardingIndices', 'xpack.apm.indices.onboarding'), + deprecateFromRoot('apm_oss.enabled', '8.0.0'), + unusedFromRoot('apm_oss.fleetMode'), + unusedFromRoot('apm_oss.indexPattern'), renameFromRoot( 'xpack.apm.maxServiceEnvironments', `uiSettings.overrides[${maxSuggestions}]` @@ -70,69 +96,8 @@ export const config: PluginConfigDescriptor = { schema: configSchema, }; -export type APMXPackConfig = TypeOf; -export type APMConfig = ReturnType; - -// plugin config and ui indices settings -// All options should be documented in the APM configuration settings: https://github.com/elastic/kibana/blob/master/docs/settings/apm-settings.asciidoc -// and be included on cloud allow list unless there are specific reasons not to -export function mergeConfigs( - apmOssConfig: APMOSSConfig, - apmConfig: APMXPackConfig -) { - const mergedConfig = { - /* eslint-disable @typescript-eslint/naming-convention */ - // TODO: Remove all apm_oss options by 8.0 - 'apm_oss.transactionIndices': apmOssConfig.transactionIndices, - 'apm_oss.spanIndices': apmOssConfig.spanIndices, - 'apm_oss.errorIndices': apmOssConfig.errorIndices, - 'apm_oss.metricsIndices': apmOssConfig.metricsIndices, - 'apm_oss.sourcemapIndices': apmOssConfig.sourcemapIndices, - 'apm_oss.onboardingIndices': apmOssConfig.onboardingIndices, - /* eslint-enable @typescript-eslint/naming-convention */ - 'xpack.apm.serviceMapEnabled': apmConfig.serviceMapEnabled, - 'xpack.apm.serviceMapFingerprintBucketSize': - apmConfig.serviceMapFingerprintBucketSize, - 'xpack.apm.serviceMapTraceIdBucketSize': - apmConfig.serviceMapTraceIdBucketSize, - 'xpack.apm.serviceMapFingerprintGlobalBucketSize': - apmConfig.serviceMapFingerprintGlobalBucketSize, - 'xpack.apm.serviceMapTraceIdGlobalBucketSize': - apmConfig.serviceMapTraceIdGlobalBucketSize, - 'xpack.apm.serviceMapMaxTracesPerRequest': - apmConfig.serviceMapMaxTracesPerRequest, - 'xpack.apm.ui.enabled': apmConfig.ui.enabled, - 'xpack.apm.ui.maxTraceItems': apmConfig.ui.maxTraceItems, - 'xpack.apm.ui.transactionGroupBucketSize': - apmConfig.ui.transactionGroupBucketSize, - 'xpack.apm.autocreateApmIndexPattern': apmConfig.autocreateApmIndexPattern, - 'xpack.apm.telemetryCollectionEnabled': - apmConfig.telemetryCollectionEnabled, - 'xpack.apm.searchAggregatedTransactions': - apmConfig.searchAggregatedTransactions, - 'xpack.apm.metricsInterval': apmConfig.metricsInterval, - 'xpack.apm.agent.migrations.enabled': apmConfig.agent.migrations.enabled, - }; - - // Add data stream indices to list of configured values - mergedConfig[ - 'apm_oss.transactionIndices' - ] = `traces-apm*,${mergedConfig['apm_oss.transactionIndices']}`; - - mergedConfig[ - 'apm_oss.spanIndices' - ] = `traces-apm*,${mergedConfig['apm_oss.spanIndices']}`; - - mergedConfig[ - 'apm_oss.errorIndices' - ] = `logs-apm*,${mergedConfig['apm_oss.errorIndices']}`; - - mergedConfig[ - 'apm_oss.metricsIndices' - ] = `metrics-apm*,${mergedConfig['apm_oss.metricsIndices']}`; - - return mergedConfig; -} +export type APMConfig = TypeOf; +export type ApmIndicesConfigName = keyof APMConfig['indices']; export const plugin = (initContext: PluginInitializerContext) => new APMPlugin(initContext); diff --git a/x-pack/plugins/apm/server/lib/alerts/register_error_count_alert_type.ts b/x-pack/plugins/apm/server/lib/alerts/register_error_count_alert_type.ts index d1026b0b6ca8b..7fe2adcfe24d7 100644 --- a/x-pack/plugins/apm/server/lib/alerts/register_error_count_alert_type.ts +++ b/x-pack/plugins/apm/server/lib/alerts/register_error_count_alert_type.ts @@ -99,7 +99,7 @@ export function registerErrorCountAlertType({ }); const searchParams = { - index: indices['apm_oss.errorIndices'], + index: indices.error, size: 0, body: { query: { diff --git a/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts b/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts index b383b4777eca4..df4de254346c9 100644 --- a/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts +++ b/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts @@ -115,12 +115,12 @@ export function registerTransactionDurationAlertType({ // to prevent (likely) unnecessary blocking request // in rule execution const searchAggregatedTransactions = - config['xpack.apm.searchAggregatedTransactions'] !== + config.searchAggregatedTransactions !== SearchAggregatedTransactionSetting.never; const index = searchAggregatedTransactions - ? indices['apm_oss.metricsIndices'] - : indices['apm_oss.transactionIndices']; + ? indices.metric + : indices.transaction; const field = getTransactionDurationFieldForAggregatedTransactions( searchAggregatedTransactions diff --git a/x-pack/plugins/apm/server/lib/alerts/register_transaction_error_rate_alert_type.ts b/x-pack/plugins/apm/server/lib/alerts/register_transaction_error_rate_alert_type.ts index 6c59bcc4107b0..598487d02625a 100644 --- a/x-pack/plugins/apm/server/lib/alerts/register_transaction_error_rate_alert_type.ts +++ b/x-pack/plugins/apm/server/lib/alerts/register_transaction_error_rate_alert_type.ts @@ -110,12 +110,12 @@ export function registerTransactionErrorRateAlertType({ // to prevent (likely) unnecessary blocking request // in rule execution const searchAggregatedTransactions = - config['xpack.apm.searchAggregatedTransactions'] !== + config.searchAggregatedTransactions !== SearchAggregatedTransactionSetting.never; const index = searchAggregatedTransactions - ? indices['apm_oss.metricsIndices'] - : indices['apm_oss.transactionIndices']; + ? indices.metric + : indices.transaction; const searchParams = { index, diff --git a/x-pack/plugins/apm/server/lib/alerts/test_utils/index.ts b/x-pack/plugins/apm/server/lib/alerts/test_utils/index.ts index 5d5865bdd2289..22649a7010461 100644 --- a/x-pack/plugins/apm/server/lib/alerts/test_utils/index.ts +++ b/x-pack/plugins/apm/server/lib/alerts/test_utils/index.ts @@ -17,10 +17,10 @@ export const createRuleTypeMocks = () => { let alertExecutor: (...args: any[]) => Promise; const mockedConfig$ = of({ - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.errorIndices': 'apm-*', - 'apm_oss.transactionIndices': 'apm-*', - /* eslint-enable @typescript-eslint/naming-convention */ + indices: { + error: 'apm-*', + transaction: 'apm-*', + }, } as APMConfig); const loggerMock = { diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts index 324202b207237..10758b6d90cdc 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts @@ -50,7 +50,7 @@ export async function createAnomalyDetectionJobs( `Creating ML anomaly detection jobs for environments: [${uniqueMlJobEnvs}].` ); - const indexPatternName = indices['apm_oss.metricsIndices']; + const indexPatternName = indices.metric; const responses = await Promise.all( uniqueMlJobEnvs.map((environment) => createAnomalyDetectionJob({ ml, environment, indexPatternName }) diff --git a/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.test.ts b/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.test.ts index 4bfac442b4a3c..1e697ebdcae06 100644 --- a/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.test.ts +++ b/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.test.ts @@ -14,12 +14,10 @@ import { describe('data telemetry collection tasks', () => { const indices = { - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.errorIndices': 'apm-8.0.0-error', - 'apm_oss.metricsIndices': 'apm-8.0.0-metric', - 'apm_oss.spanIndices': 'apm-8.0.0-span', - 'apm_oss.transactionIndices': 'apm-8.0.0-transaction', - /* eslint-enable @typescript-eslint/naming-convention */ + error: 'apm-8.0.0-error', + metric: 'apm-8.0.0-metric', + span: 'apm-8.0.0-span', + transaction: 'apm-8.0.0-transaction', } as ApmIndicesConfig; describe('environments', () => { diff --git a/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts b/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts index d624c8527df86..8764223ad1ebb 100644 --- a/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts +++ b/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts @@ -78,7 +78,7 @@ export const tasks: TelemetryTask[] = [ }; const params = { - index: [indices['apm_oss.transactionIndices']], + index: [indices.transaction], body: { size: 0, timeout, @@ -138,7 +138,7 @@ export const tasks: TelemetryTask[] = [ // fixed date range for reliable results const lastTransaction = ( await search({ - index: indices['apm_oss.transactionIndices'], + index: indices.transaction, body: { query: { bool: { @@ -253,10 +253,10 @@ export const tasks: TelemetryTask[] = [ const response = await search({ index: [ - indices['apm_oss.errorIndices'], - indices['apm_oss.metricsIndices'], - indices['apm_oss.spanIndices'], - indices['apm_oss.transactionIndices'], + indices.error, + indices.metric, + indices.span, + indices.transaction, ], body: { size: 0, @@ -310,10 +310,10 @@ export const tasks: TelemetryTask[] = [ const response = await search({ index: [ - indices['apm_oss.errorIndices'], - indices['apm_oss.metricsIndices'], - indices['apm_oss.spanIndices'], - indices['apm_oss.transactionIndices'], + indices.error, + indices.metric, + indices.span, + indices.transaction, ], body: { size: 0, @@ -345,7 +345,7 @@ export const tasks: TelemetryTask[] = [ name: 'environments', executor: async ({ indices, search }) => { const response = await search({ - index: [indices['apm_oss.transactionIndices']], + index: [indices.transaction], body: { query: { bool: { @@ -426,12 +426,12 @@ export const tasks: TelemetryTask[] = [ name: 'processor_events', executor: async ({ indices, search }) => { const indicesByProcessorEvent = { - error: indices['apm_oss.errorIndices'], - metric: indices['apm_oss.metricsIndices'], - span: indices['apm_oss.spanIndices'], - transaction: indices['apm_oss.transactionIndices'], - onboarding: indices['apm_oss.onboardingIndices'], - sourcemap: indices['apm_oss.sourcemapIndices'], + error: indices.error, + metric: indices.metric, + span: indices.span, + transaction: indices.transaction, + onboarding: indices.onboarding, + sourcemap: indices.sourcemap, }; type ProcessorEvent = keyof typeof indicesByProcessorEvent; @@ -549,10 +549,10 @@ export const tasks: TelemetryTask[] = [ return prevJob.then(async (data) => { const response = await search({ index: [ - indices['apm_oss.errorIndices'], - indices['apm_oss.spanIndices'], - indices['apm_oss.metricsIndices'], - indices['apm_oss.transactionIndices'], + indices.error, + indices.span, + indices.metric, + indices.transaction, ], body: { size: 0, @@ -598,11 +598,7 @@ export const tasks: TelemetryTask[] = [ name: 'versions', executor: async ({ search, indices }) => { const response = await search({ - index: [ - indices['apm_oss.transactionIndices'], - indices['apm_oss.spanIndices'], - indices['apm_oss.errorIndices'], - ], + index: [indices.transaction, indices.span, indices.error], terminateAfter: 1, body: { query: { @@ -647,7 +643,7 @@ export const tasks: TelemetryTask[] = [ executor: async ({ search, indices }) => { const errorGroupsCount = ( await search({ - index: indices['apm_oss.errorIndices'], + index: indices.error, body: { size: 0, timeout, @@ -683,7 +679,7 @@ export const tasks: TelemetryTask[] = [ const transactionGroupsCount = ( await search({ - index: indices['apm_oss.transactionIndices'], + index: indices.transaction, body: { size: 0, timeout, @@ -719,7 +715,7 @@ export const tasks: TelemetryTask[] = [ const tracesPerDayCount = ( await search({ - index: indices['apm_oss.transactionIndices'], + index: indices.transaction, body: { query: { bool: { @@ -741,11 +737,7 @@ export const tasks: TelemetryTask[] = [ const servicesCount = ( await search({ - index: [ - indices['apm_oss.transactionIndices'], - indices['apm_oss.errorIndices'], - indices['apm_oss.metricsIndices'], - ], + index: [indices.transaction, indices.error, indices.metric], body: { size: 0, timeout, @@ -811,11 +803,7 @@ export const tasks: TelemetryTask[] = [ const data = await prevJob; const response = await search({ - index: [ - indices['apm_oss.errorIndices'], - indices['apm_oss.metricsIndices'], - indices['apm_oss.transactionIndices'], - ], + index: [indices.error, indices.metric, indices.transaction], body: { size: 0, timeout, @@ -1006,12 +994,12 @@ export const tasks: TelemetryTask[] = [ const response = await indicesStats({ index: [ indices.apmAgentConfigurationIndex, - indices['apm_oss.errorIndices'], - indices['apm_oss.metricsIndices'], - indices['apm_oss.onboardingIndices'], - indices['apm_oss.sourcemapIndices'], - indices['apm_oss.spanIndices'], - indices['apm_oss.transactionIndices'], + indices.error, + indices.metric, + indices.onboarding, + indices.sourcemap, + indices.span, + indices.transaction, ], }); diff --git a/x-pack/plugins/apm/server/lib/errors/distribution/get_buckets.test.ts b/x-pack/plugins/apm/server/lib/errors/distribution/get_buckets.test.ts index 809869e13de7f..871df10d9bafa 100644 --- a/x-pack/plugins/apm/server/lib/errors/distribution/get_buckets.test.ts +++ b/x-pack/plugins/apm/server/lib/errors/distribution/get_buckets.test.ts @@ -43,14 +43,12 @@ describe('get buckets', () => { } ) as APMConfig, indices: { - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.sourcemapIndices': 'apm-*', - 'apm_oss.errorIndices': 'apm-*', - 'apm_oss.onboardingIndices': 'apm-*', - 'apm_oss.spanIndices': 'apm-*', - 'apm_oss.transactionIndices': 'apm-*', - 'apm_oss.metricsIndices': 'apm-*', - /* eslint-enable @typescript-eslint/naming-convention */ + sourcemap: 'apm-*', + error: 'apm-*', + onboarding: 'apm-*', + span: 'apm-*', + transaction: 'apm-*', + metric: 'apm-*', apmAgentConfigurationIndex: '.apm-agent-configuration', apmCustomLinkIndex: '.apm-custom-link', }, diff --git a/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/get_is_using_transaction_events.test.ts b/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/get_is_using_transaction_events.test.ts index f17224384842d..1fac873ced7be 100644 --- a/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/get_is_using_transaction_events.test.ts +++ b/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/get_is_using_transaction_events.test.ts @@ -58,8 +58,7 @@ describe('getIsUsingTransactionEvents', () => { describe('with config xpack.apm.searchAggregatedTransactions: never', () => { const config = { - 'xpack.apm.searchAggregatedTransactions': - SearchAggregatedTransactionSetting.never, + searchAggregatedTransactions: SearchAggregatedTransactionSetting.never, }; it('should be false', async () => { @@ -81,8 +80,7 @@ describe('getIsUsingTransactionEvents', () => { describe('with config xpack.apm.searchAggregatedTransactions: always', () => { const config = { - 'xpack.apm.searchAggregatedTransactions': - SearchAggregatedTransactionSetting.always, + searchAggregatedTransactions: SearchAggregatedTransactionSetting.always, }; it('should be false when kuery is empty', async () => { mock = await inspectSearchParams( @@ -164,8 +162,7 @@ describe('getIsUsingTransactionEvents', () => { describe('with config xpack.apm.searchAggregatedTransactions: auto', () => { const config = { - 'xpack.apm.searchAggregatedTransactions': - SearchAggregatedTransactionSetting.auto, + searchAggregatedTransactions: SearchAggregatedTransactionSetting.auto, }; it('should query for data once if metrics data found', async () => { diff --git a/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/get_is_using_transaction_events.ts b/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/get_is_using_transaction_events.ts index 70df0959a63b6..66e9697ab7c91 100644 --- a/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/get_is_using_transaction_events.ts +++ b/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/get_is_using_transaction_events.ts @@ -23,8 +23,7 @@ export async function getIsUsingTransactionEvents({ start?: number; end?: number; }): Promise { - const searchAggregatedTransactions = - config['xpack.apm.searchAggregatedTransactions']; + const searchAggregatedTransactions = config.searchAggregatedTransactions; if ( searchAggregatedTransactions === SearchAggregatedTransactionSetting.never diff --git a/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/index.ts b/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/index.ts index 478f3218ef38c..a58a95dd43fcc 100644 --- a/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/index.ts +++ b/x-pack/plugins/apm/server/lib/helpers/aggregated_transactions/index.ts @@ -63,8 +63,7 @@ export async function getSearchAggregatedTransactions({ apmEventClient: APMEventClient; kuery: string; }): Promise { - const searchAggregatedTransactions = - config['xpack.apm.searchAggregatedTransactions']; + const searchAggregatedTransactions = config.searchAggregatedTransactions; if ( kuery || diff --git a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/unpack_processor_events.test.ts b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/unpack_processor_events.test.ts index 4983d6d515944..5ef3786e9bde4 100644 --- a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/unpack_processor_events.test.ts +++ b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/unpack_processor_events.test.ts @@ -5,7 +5,6 @@ * 2.0. */ -/* eslint-disable @typescript-eslint/naming-convention */ import { APMEventESSearchRequest } from '.'; import { ApmIndicesConfig } from '../../../settings/apm_indices/get_apm_indices'; import { unpackProcessorEvents } from './unpack_processor_events'; @@ -19,12 +18,12 @@ describe('unpackProcessorEvents', () => { } as APMEventESSearchRequest; const indices = { - 'apm_oss.transactionIndices': 'my-apm-*-transaction-*', - 'apm_oss.metricsIndices': 'my-apm-*-metric-*', - 'apm_oss.errorIndices': 'my-apm-*-error-*', - 'apm_oss.spanIndices': 'my-apm-*-span-*', - 'apm_oss.onboardingIndices': 'my-apm-*-onboarding-', - 'apm_oss.sourcemapIndices': 'my-apm-*-sourcemap-*', + transaction: 'my-apm-*-transaction-*', + metric: 'my-apm-*-metric-*', + error: 'my-apm-*-error-*', + span: 'my-apm-*-span-*', + onboarding: 'my-apm-*-onboarding-*', + sourcemap: 'my-apm-*-sourcemap-*', } as ApmIndicesConfig; res = unpackProcessorEvents(request, indices); diff --git a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/unpack_processor_events.ts b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/unpack_processor_events.ts index 47a2b3fe7e5c8..582fe0374c5ca 100644 --- a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/unpack_processor_events.ts +++ b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/unpack_processor_events.ts @@ -13,19 +13,16 @@ import { ESFilter, } from '../../../../../../../../src/core/types/elasticsearch'; import { APMEventESSearchRequest, APMEventESTermsEnumRequest } from '.'; -import { - ApmIndicesConfig, - ApmIndicesName, -} from '../../../settings/apm_indices/get_apm_indices'; +import { ApmIndicesConfig } from '../../../settings/apm_indices/get_apm_indices'; -const processorEventIndexMap: Record = { - [ProcessorEvent.transaction]: 'apm_oss.transactionIndices', - [ProcessorEvent.span]: 'apm_oss.spanIndices', - [ProcessorEvent.metric]: 'apm_oss.metricsIndices', - [ProcessorEvent.error]: 'apm_oss.errorIndices', +const processorEventIndexMap = { + [ProcessorEvent.transaction]: 'transaction', + [ProcessorEvent.span]: 'span', + [ProcessorEvent.metric]: 'metric', + [ProcessorEvent.error]: 'error', // TODO: should have its own config setting - [ProcessorEvent.profile]: 'apm_oss.transactionIndices', -}; + [ProcessorEvent.profile]: 'transaction', +} as const; export function unpackProcessorEvents( request: APMEventESSearchRequest | APMEventESTermsEnumRequest, diff --git a/x-pack/plugins/apm/server/lib/helpers/setup_request.test.ts b/x-pack/plugins/apm/server/lib/helpers/setup_request.test.ts index 94e88a09ea35c..d5ff97c050d9d 100644 --- a/x-pack/plugins/apm/server/lib/helpers/setup_request.test.ts +++ b/x-pack/plugins/apm/server/lib/helpers/setup_request.test.ts @@ -10,19 +10,20 @@ import { APMConfig } from '../..'; import { APMRouteHandlerResources } from '../../routes/typings'; import { ProcessorEvent } from '../../../common/processor_event'; import { PROCESSOR_EVENT } from '../../../common/elasticsearch_fieldnames'; +import { getApmIndices } from '../settings/apm_indices/get_apm_indices'; +import { PromiseReturnType } from '../../../../observability/typings/common'; jest.mock('../settings/apm_indices/get_apm_indices', () => ({ - getApmIndices: async () => ({ - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.sourcemapIndices': 'apm-*', - 'apm_oss.errorIndices': 'apm-*', - 'apm_oss.onboardingIndices': 'apm-*', - 'apm_oss.spanIndices': 'apm-*', - 'apm_oss.transactionIndices': 'apm-*', - 'apm_oss.metricsIndices': 'apm-*', - /* eslint-enable @typescript-eslint/naming-convention */ - apmAgentConfigurationIndex: 'apm-*', - }), + getApmIndices: async () => + ({ + sourcemap: 'apm-*', + error: 'apm-*', + onboarding: 'apm-*', + span: 'apm-*', + transaction: 'apm-*', + metric: 'apm-*', + apmAgentConfigurationIndex: 'apm-*', + } as PromiseReturnType), })); jest.mock('../index_pattern/get_dynamic_index_pattern', () => ({ diff --git a/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.test.ts b/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.test.ts index aae707c6e4689..83adab6ae6cbc 100644 --- a/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.test.ts +++ b/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.test.ts @@ -5,7 +5,6 @@ * 2.0. */ -/* eslint-disable @typescript-eslint/naming-convention */ import { createStaticIndexPattern } from './create_static_index_pattern'; import { Setup } from '../helpers/setup_request'; import * as HistoricalAgentData from '../../routes/historical_data/has_historical_agent_data'; @@ -25,11 +24,11 @@ function getMockSavedObjectsClient(existingIndexPatternTitle: string) { const setup = { indices: { - 'apm_oss.transactionIndices': 'apm-*-transaction-*', - 'apm_oss.spanIndices': 'apm-*-span-*', - 'apm_oss.errorIndices': 'apm-*-error-*', - 'apm_oss.metricsIndices': 'apm-*-metrics-*', - }, + transaction: 'apm-*-transaction-*', + span: 'apm-*-span-*', + error: 'apm-*-error-*', + metric: 'apm-*-metrics-*', + } as APMConfig['indices'], } as unknown as Setup; describe('createStaticIndexPattern', () => { @@ -37,7 +36,7 @@ describe('createStaticIndexPattern', () => { const savedObjectsClient = getMockSavedObjectsClient('apm-*'); await createStaticIndexPattern({ setup, - config: { 'xpack.apm.autocreateApmIndexPattern': false } as APMConfig, + config: { autocreateApmIndexPattern: false } as APMConfig, savedObjectsClient, spaceId: 'default', }); @@ -54,7 +53,7 @@ describe('createStaticIndexPattern', () => { await createStaticIndexPattern({ setup, - config: { 'xpack.apm.autocreateApmIndexPattern': true } as APMConfig, + config: { autocreateApmIndexPattern: true } as APMConfig, savedObjectsClient, spaceId: 'default', }); @@ -71,7 +70,7 @@ describe('createStaticIndexPattern', () => { await createStaticIndexPattern({ setup, - config: { 'xpack.apm.autocreateApmIndexPattern': true } as APMConfig, + config: { autocreateApmIndexPattern: true } as APMConfig, savedObjectsClient, spaceId: 'default', }); @@ -91,9 +90,7 @@ describe('createStaticIndexPattern', () => { await createStaticIndexPattern({ setup, - config: { - 'xpack.apm.autocreateApmIndexPattern': true, - } as APMConfig, + config: { autocreateApmIndexPattern: true } as APMConfig, savedObjectsClient, spaceId: 'default', }); @@ -120,9 +117,7 @@ describe('createStaticIndexPattern', () => { await createStaticIndexPattern({ setup, - config: { - 'xpack.apm.autocreateApmIndexPattern': true, - } as APMConfig, + config: { autocreateApmIndexPattern: true } as APMConfig, savedObjectsClient, spaceId: 'default', }); diff --git a/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.ts b/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.ts index 4f35e7e639151..26ae2ac337e88 100644 --- a/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.ts +++ b/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.ts @@ -34,7 +34,7 @@ export async function createStaticIndexPattern({ }): Promise { return withApmSpan('create_static_index_pattern', async () => { // don't autocreate APM index pattern if it's been disabled via the config - if (!config['xpack.apm.autocreateApmIndexPattern']) { + if (!config.autocreateApmIndexPattern) { return false; } diff --git a/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.test.ts b/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.test.ts index 8103630157584..8b7444ffdf6fa 100644 --- a/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.test.ts +++ b/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.test.ts @@ -5,18 +5,16 @@ * 2.0. */ -/* eslint-disable @typescript-eslint/naming-convention */ - import { ApmIndicesConfig } from '../settings/apm_indices/get_apm_indices'; import { getApmIndexPatternTitle } from './get_apm_index_pattern_title'; describe('getApmIndexPatternTitle', () => { it('returns an index pattern title by combining existing indicies', () => { const title = getApmIndexPatternTitle({ - 'apm_oss.transactionIndices': 'apm-*-transaction-*', - 'apm_oss.spanIndices': 'apm-*-span-*', - 'apm_oss.errorIndices': 'apm-*-error-*', - 'apm_oss.metricsIndices': 'apm-*-metrics-*', + transaction: 'apm-*-transaction-*', + span: 'apm-*-span-*', + error: 'apm-*-error-*', + metric: 'apm-*-metrics-*', } as ApmIndicesConfig); expect(title).toBe( 'apm-*-transaction-*,apm-*-span-*,apm-*-error-*,apm-*-metrics-*' @@ -25,10 +23,10 @@ describe('getApmIndexPatternTitle', () => { it('removes duplicates', () => { const title = getApmIndexPatternTitle({ - 'apm_oss.transactionIndices': 'apm-*', - 'apm_oss.spanIndices': 'apm-*', - 'apm_oss.errorIndices': 'apm-*', - 'apm_oss.metricsIndices': 'apm-*', + transaction: 'apm-*', + span: 'apm-*', + error: 'apm-*', + metric: 'apm-*', } as ApmIndicesConfig); expect(title).toBe('apm-*'); }); diff --git a/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.ts b/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.ts index e65f200130e9a..5e055ff1c2fdc 100644 --- a/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.ts +++ b/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.ts @@ -10,9 +10,9 @@ import { ApmIndicesConfig } from '../settings/apm_indices/get_apm_indices'; export function getApmIndexPatternTitle(apmIndicesConfig: ApmIndicesConfig) { return uniq([ - apmIndicesConfig['apm_oss.transactionIndices'], - apmIndicesConfig['apm_oss.spanIndices'], - apmIndicesConfig['apm_oss.errorIndices'], - apmIndicesConfig['apm_oss.metricsIndices'], + apmIndicesConfig.transaction, + apmIndicesConfig.span, + apmIndicesConfig.error, + apmIndicesConfig.metric, ]).join(','); } diff --git a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts index ba35836452122..06138931c004e 100644 --- a/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts +++ b/x-pack/plugins/apm/server/lib/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts @@ -85,7 +85,7 @@ export async function fetchAndTransformGcMetrics({ date_histogram: getMetricsDateHistogramParams({ start, end, - metricsInterval: config['xpack.apm.metricsInterval'], + metricsInterval: config.metricsInterval, }), aggs: { // get the max value diff --git a/x-pack/plugins/apm/server/lib/metrics/fetch_and_transform_metrics.ts b/x-pack/plugins/apm/server/lib/metrics/fetch_and_transform_metrics.ts index a3fce0368f4a5..581a0782e4d72 100644 --- a/x-pack/plugins/apm/server/lib/metrics/fetch_and_transform_metrics.ts +++ b/x-pack/plugins/apm/server/lib/metrics/fetch_and_transform_metrics.ts @@ -99,7 +99,7 @@ export async function fetchAndTransformMetrics({ date_histogram: getMetricsDateHistogramParams({ start, end, - metricsInterval: config['xpack.apm.metricsInterval'], + metricsInterval: config.metricsInterval, }), aggs, }, diff --git a/x-pack/plugins/apm/server/lib/rum_client/has_rum_data.ts b/x-pack/plugins/apm/server/lib/rum_client/has_rum_data.ts index 9409e94fa9ba9..ba35ac5c5c89c 100644 --- a/x-pack/plugins/apm/server/lib/rum_client/has_rum_data.ts +++ b/x-pack/plugins/apm/server/lib/rum_client/has_rum_data.ts @@ -56,7 +56,7 @@ export async function hasRumData({ const response = await apmEventClient.search('has_rum_data', params); return { - indices: setup.indices['apm_oss.transactionIndices']!, + indices: setup.indices.transaction, hasData: response.hits.total.value > 0, serviceName: response.aggregations?.services?.mostTraffic?.buckets?.[0]?.key, @@ -65,7 +65,7 @@ export async function hasRumData({ return { hasData: false, serviceName: undefined, - indices: setup.indices['apm_oss.transactionIndices']!, + indices: setup.indices.transaction, }; } } diff --git a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/failed_transactions_correlations_search_service.ts b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/failed_transactions_correlations_search_service.ts index 02ba0a8514b62..239cf39f15ffe 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/failed_transactions_correlations_search_service.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/failed_transactions_correlations_search_service.ts @@ -65,7 +65,7 @@ export const failedTransactionsCorrelationsSearchServiceProvider: FailedTransact const params: FailedTransactionsCorrelationsRequestParams & SearchStrategyServerParams = { ...searchServiceParams, - index: indices['apm_oss.transactionIndices'], + index: indices.transaction, includeFrozen, }; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service.ts b/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service.ts index 7e420c821a746..91f4a0d3349a4 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service.ts @@ -67,7 +67,7 @@ export const latencyCorrelationsSearchServiceProvider: LatencyCorrelationsSearch const indices = await getApmIndices(); params = { ...searchServiceParams, - index: indices['apm_oss.transactionIndices'], + index: indices.transaction, includeFrozen, }; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/search_strategy_provider.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/search_strategy_provider.test.ts index 6e03c879f9b97..8a9d04df32036 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/search_strategy_provider.test.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/search_strategy_provider.test.ts @@ -90,10 +90,7 @@ const clientSearchMock = ( }; const getApmIndicesMock = async () => - ({ - // eslint-disable-next-line @typescript-eslint/naming-convention - 'apm_oss.transactionIndices': 'apm-*', - } as ApmIndicesConfig); + ({ transaction: 'apm-*' } as ApmIndicesConfig); describe('APM Correlations search strategy', () => { describe('strategy interface', () => { diff --git a/x-pack/plugins/apm/server/lib/service_map/get_service_map.ts b/x-pack/plugins/apm/server/lib/service_map/get_service_map.ts index 2497a85c0c774..ae511d0fed8f8 100644 --- a/x-pack/plugins/apm/server/lib/service_map/get_service_map.ts +++ b/x-pack/plugins/apm/server/lib/service_map/get_service_map.ts @@ -53,10 +53,7 @@ async function getConnectionData({ end, }); - const chunks = chunk( - traceIds, - setup.config['xpack.apm.serviceMapMaxTracesPerRequest'] - ); + const chunks = chunk(traceIds, setup.config.serviceMapMaxTracesPerRequest); const init = { connections: [], diff --git a/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.test.ts b/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.test.ts index 2129606e69fc3..afb88189a5fd2 100644 --- a/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.test.ts +++ b/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.test.ts @@ -70,9 +70,7 @@ describe('getServiceMapServiceNodeInfo', () => { indices: {}, start: 1593460053026000, end: 1593497863217000, - config: { - 'xpack.apm.metricsInterval': 30, - }, + config: { metricsInterval: 30 }, uiFilters: { environment: 'test environment' }, } as unknown as Setup; const serviceName = 'test service name'; diff --git a/x-pack/plugins/apm/server/lib/service_map/get_trace_sample_ids.ts b/x-pack/plugins/apm/server/lib/service_map/get_trace_sample_ids.ts index c1c11f7bf639a..7e16e69498e7c 100644 --- a/x-pack/plugins/apm/server/lib/service_map/get_trace_sample_ids.ts +++ b/x-pack/plugins/apm/server/lib/service_map/get_trace_sample_ids.ts @@ -60,13 +60,11 @@ export async function getTraceSampleIds({ query.bool.filter.push(...environmentQuery(environment)); const fingerprintBucketSize = serviceName - ? config['xpack.apm.serviceMapFingerprintBucketSize'] - : config['xpack.apm.serviceMapFingerprintGlobalBucketSize']; - + ? config.serviceMapFingerprintBucketSize + : config.serviceMapFingerprintGlobalBucketSize; const traceIdBucketSize = serviceName - ? config['xpack.apm.serviceMapTraceIdBucketSize'] - : config['xpack.apm.serviceMapTraceIdGlobalBucketSize']; - + ? config.serviceMapTraceIdBucketSize + : config.serviceMapTraceIdGlobalBucketSize; const samplerShardSize = traceIdBucketSize * 10; const params = { @@ -137,8 +135,7 @@ export async function getTraceSampleIds({ 'get_trace_sample_ids', params ); - // make sure at least one trace per composite/connection bucket - // is queried + // make sure at least one trace per composite/connection bucket is queried const traceIdsWithPriority = tracesSampleResponse.aggregations?.connections.buckets.flatMap((bucket) => bucket.sample.trace_ids.buckets.map((sampleDocBucket, index) => ({ diff --git a/x-pack/plugins/apm/server/lib/services/get_service_transaction_groups.ts b/x-pack/plugins/apm/server/lib/services/get_service_transaction_groups.ts index d5a2006060395..fbc1e2880495b 100644 --- a/x-pack/plugins/apm/server/lib/services/get_service_transaction_groups.ts +++ b/x-pack/plugins/apm/server/lib/services/get_service_transaction_groups.ts @@ -57,7 +57,7 @@ export async function getServiceTransactionGroups({ end: number; }) { const { apmEventClient, config } = setup; - const bucketSize = config['xpack.apm.ui.transactionGroupBucketSize']; + const bucketSize = config.ui.transactionGroupBucketSize; const field = getTransactionDurationFieldForAggregatedTransactions( searchAggregatedTransactions diff --git a/x-pack/plugins/apm/server/lib/settings/apm_indices/get_apm_indices.ts b/x-pack/plugins/apm/server/lib/settings/apm_indices/get_apm_indices.ts index 0ade96682b362..107493af1a0c0 100644 --- a/x-pack/plugins/apm/server/lib/settings/apm_indices/get_apm_indices.ts +++ b/x-pack/plugins/apm/server/lib/settings/apm_indices/get_apm_indices.ts @@ -5,8 +5,6 @@ * 2.0. */ -import { merge } from 'lodash'; - import { SavedObjectsClient } from 'src/core/server'; import { PromiseReturnType } from '../../../../../observability/typings/common'; import { @@ -22,8 +20,6 @@ export { ApmIndicesConfig }; type ISavedObjectsClient = Pick; -export type ApmIndicesName = keyof ApmIndicesConfig; - async function getApmIndicesSavedObject( savedObjectsClient: ISavedObjectsClient ) { @@ -38,14 +34,12 @@ async function getApmIndicesSavedObject( export function getApmIndicesConfig(config: APMConfig): ApmIndicesConfig { return { - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.sourcemapIndices': config['apm_oss.sourcemapIndices'], - 'apm_oss.errorIndices': config['apm_oss.errorIndices'], - 'apm_oss.onboardingIndices': config['apm_oss.onboardingIndices'], - 'apm_oss.spanIndices': config['apm_oss.spanIndices'], - 'apm_oss.transactionIndices': config['apm_oss.transactionIndices'], - 'apm_oss.metricsIndices': config['apm_oss.metricsIndices'], - /* eslint-enable @typescript-eslint/naming-convention */ + sourcemap: config.indices.sourcemap, + error: config.indices.error, + onboarding: config.indices.onboarding, + span: config.indices.span, + transaction: config.indices.transaction, + metric: config.indices.metric, // system indices, not configurable apmAgentConfigurationIndex: '.apm-agent-configuration', apmCustomLinkIndex: '.apm-custom-link', @@ -64,21 +58,12 @@ export async function getApmIndices({ savedObjectsClient ); const apmIndicesConfig = getApmIndicesConfig(config); - return merge({}, apmIndicesConfig, apmIndicesSavedObject); + return { ...apmIndicesConfig, ...apmIndicesSavedObject }; } catch (error) { return getApmIndicesConfig(config); } } -const APM_UI_INDICES: ApmIndicesName[] = [ - 'apm_oss.sourcemapIndices', - 'apm_oss.errorIndices', - 'apm_oss.onboardingIndices', - 'apm_oss.spanIndices', - 'apm_oss.transactionIndices', - 'apm_oss.metricsIndices', -]; - export async function getApmIndexSettings({ context, config, @@ -88,7 +73,7 @@ export async function getApmIndexSettings({ apmIndicesSavedObject = await getApmIndicesSavedObject( context.core.savedObjects.client ); - } catch (error) { + } catch (error: any) { if (error.output && error.output.statusCode === 404) { apmIndicesSavedObject = {}; } else { @@ -97,7 +82,11 @@ export async function getApmIndexSettings({ } const apmIndicesConfig = getApmIndicesConfig(config); - return APM_UI_INDICES.map((configurationName) => ({ + const apmIndices = Object.keys(config.indices) as Array< + keyof typeof config.indices + >; + + return apmIndices.map((configurationName) => ({ configurationName, defaultValue: apmIndicesConfig[configurationName], // value defined in kibana[.dev].yml savedValue: apmIndicesSavedObject[configurationName], // value saved via Saved Objects service diff --git a/x-pack/plugins/apm/server/lib/traces/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/traces/__snapshots__/queries.test.ts.snap index 53318fe5fe594..ea8f39f9d9b6d 100644 --- a/x-pack/plugins/apm/server/lib/traces/__snapshots__/queries.test.ts.snap +++ b/x-pack/plugins/apm/server/lib/traces/__snapshots__/queries.test.ts.snap @@ -37,7 +37,7 @@ Object { }, }, }, - "size": "myIndex", + "size": 1000, }, } `; diff --git a/x-pack/plugins/apm/server/lib/traces/get_trace_items.ts b/x-pack/plugins/apm/server/lib/traces/get_trace_items.ts index e940100edcf52..60a28fd9abdbd 100644 --- a/x-pack/plugins/apm/server/lib/traces/get_trace_items.ts +++ b/x-pack/plugins/apm/server/lib/traces/get_trace_items.ts @@ -24,7 +24,7 @@ export async function getTraceItems( end: number ) { const { apmEventClient, config } = setup; - const maxTraceItems = config['xpack.apm.ui.maxTraceItems']; + const maxTraceItems = config.ui.maxTraceItems; const excludedLogLevels = ['debug', 'info', 'warning']; const errorResponsePromise = apmEventClient.search('get_errors_docs', { @@ -80,9 +80,5 @@ export async function getTraceItems( const traceDocs = traceResponse.hits.hits.map((hit) => hit._source); const errorDocs = errorResponse.hits.hits.map((hit) => hit._source); - return { - exceedsMax, - traceDocs, - errorDocs, - }; + return { exceedsMax, traceDocs, errorDocs }; } diff --git a/x-pack/plugins/apm/server/lib/transactions/breakdown/index.test.ts b/x-pack/plugins/apm/server/lib/transactions/breakdown/index.test.ts index 6e9d0aad96b71..76cabd3e3af93 100644 --- a/x-pack/plugins/apm/server/lib/transactions/breakdown/index.test.ts +++ b/x-pack/plugins/apm/server/lib/transactions/breakdown/index.test.ts @@ -11,16 +11,15 @@ import noDataResponse from './mock_responses/no_data.json'; import dataResponse from './mock_responses/data.json'; import { APMConfig } from '../../..'; import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; - -const mockIndices = { - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.sourcemapIndices': 'myIndex', - 'apm_oss.errorIndices': 'myIndex', - 'apm_oss.onboardingIndices': 'myIndex', - 'apm_oss.spanIndices': 'myIndex', - 'apm_oss.transactionIndices': 'myIndex', - 'apm_oss.metricsIndices': 'myIndex', - /* eslint-enable @typescript-eslint/naming-convention */ +import { ApmIndicesConfig } from '../../settings/apm_indices/get_apm_indices'; + +const mockIndices: ApmIndicesConfig = { + sourcemap: 'myIndex', + error: 'myIndex', + onboarding: 'myIndex', + span: 'myIndex', + transaction: 'myIndex', + metric: 'myIndex', apmAgentConfigurationIndex: 'myIndex', apmCustomLinkIndex: 'myIndex', }; diff --git a/x-pack/plugins/apm/server/lib/transactions/breakdown/index.ts b/x-pack/plugins/apm/server/lib/transactions/breakdown/index.ts index 62277dba8ac29..a5c11776c70b0 100644 --- a/x-pack/plugins/apm/server/lib/transactions/breakdown/index.ts +++ b/x-pack/plugins/apm/server/lib/transactions/breakdown/index.ts @@ -124,7 +124,7 @@ export async function getTransactionBreakdown({ date_histogram: getMetricsDateHistogramParams({ start, end, - metricsInterval: config['xpack.apm.metricsInterval'], + metricsInterval: config.metricsInterval, }), aggs: subAggs, }, diff --git a/x-pack/plugins/apm/server/plugin.ts b/x-pack/plugins/apm/server/plugin.ts index 2296227de2a33..d2d8dbf602364 100644 --- a/x-pack/plugins/apm/server/plugin.ts +++ b/x-pack/plugins/apm/server/plugin.ts @@ -5,8 +5,7 @@ * 2.0. */ -import { combineLatest } from 'rxjs'; -import { map, take } from 'rxjs/operators'; +import { take } from 'rxjs/operators'; import { CoreSetup, CoreStart, @@ -19,8 +18,7 @@ import { isEmpty, mapValues } from 'lodash'; import { SavedObjectsClient } from '../../../../src/core/server'; import { mappingFromFieldMap } from '../../rule_registry/common/mapping_from_field_map'; import { Dataset } from '../../rule_registry/server'; -import { APMConfig, APMXPackConfig, APM_SERVER_FEATURE_ID } from '.'; -import { mergeConfigs } from './index'; +import { APMConfig, APM_SERVER_FEATURE_ID } from '.'; import { UI_SETTINGS } from '../../../../src/plugins/data/common'; import { APM_FEATURE, registerFeaturesUsage } from './feature'; import { registerApmAlerts } from './lib/alerts/register_apm_alerts'; @@ -73,29 +71,23 @@ export class APMPlugin plugins: Omit ) { this.logger = this.initContext.logger.get(); - const config$ = this.initContext.config.create(); - const mergedConfig$ = combineLatest(plugins.apmOss.config$, config$).pipe( - map(([apmOssConfig, apmConfig]) => mergeConfigs(apmOssConfig, apmConfig)) - ); + const config$ = this.initContext.config.create(); core.savedObjects.registerType(apmIndices); core.savedObjects.registerType(apmTelemetry); core.savedObjects.registerType(apmServerSettings); - const currentConfig = mergeConfigs( - plugins.apmOss.config, - this.initContext.config.get() - ); + const currentConfig = this.initContext.config.get(); this.currentConfig = currentConfig; if ( plugins.taskManager && plugins.usageCollection && - currentConfig['xpack.apm.telemetryCollectionEnabled'] + currentConfig.telemetryCollectionEnabled ) { createApmTelemetry({ core, - config$: mergedConfig$, + config$, usageCollector: plugins.usageCollection, taskManager: plugins.taskManager, logger: this.logger, @@ -156,7 +148,7 @@ export class APMPlugin const boundGetApmIndices = async () => getApmIndices({ savedObjectsClient: await getInternalSavedObjectsClient(core), - config: await mergedConfig$.pipe(take(1)).toPromise(), + config: await config$.pipe(take(1)).toPromise(), }); boundGetApmIndices().then((indices) => { @@ -193,7 +185,7 @@ export class APMPlugin ruleDataClient, alerting: plugins.alerting, ml: plugins.ml, - config$: mergedConfig$, + config$, logger: this.logger!.get('rule'), }); } @@ -231,7 +223,7 @@ export class APMPlugin }); return { - config$: mergedConfig$, + config$, getApmIndices: boundGetApmIndices, createApmEventClient: async ({ request, diff --git a/x-pack/plugins/apm/server/routes/fleet.ts b/x-pack/plugins/apm/server/routes/fleet.ts index d8097228df0dc..2884c08ceb9a1 100644 --- a/x-pack/plugins/apm/server/routes/fleet.ts +++ b/x-pack/plugins/apm/server/routes/fleet.ts @@ -129,8 +129,7 @@ const getMigrationCheckRoute = createApmServerRoute({ options: { tags: ['access:apm'] }, handler: async (resources) => { const { plugins, context, config, request } = resources; - const cloudApmMigrationEnabled = - config['xpack.apm.agent.migrations.enabled']; + const cloudApmMigrationEnabled = config.agent.migrations.enabled; if (!plugins.fleet || !plugins.security) { throw Boom.internal(FLEET_SECURITY_REQUIRED_MESSAGE); } @@ -158,8 +157,7 @@ const createCloudApmPackagePolicyRoute = createApmServerRoute({ options: { tags: ['access:apm', 'access:apm_write'] }, handler: async (resources) => { const { plugins, context, config, request, logger } = resources; - const cloudApmMigrationEnabled = - config['xpack.apm.agent.migrations.enabled']; + const cloudApmMigrationEnabled = config.agent.migrations.enabled; if (!plugins.fleet || !plugins.security) { throw Boom.internal(FLEET_SECURITY_REQUIRED_MESSAGE); } diff --git a/x-pack/plugins/apm/server/routes/service_map.ts b/x-pack/plugins/apm/server/routes/service_map.ts index f9062ac13e049..17fb9d7c98c5f 100644 --- a/x-pack/plugins/apm/server/routes/service_map.ts +++ b/x-pack/plugins/apm/server/routes/service_map.ts @@ -33,7 +33,7 @@ const serviceMapRoute = createApmServerRoute({ options: { tags: ['access:apm'] }, handler: async (resources) => { const { config, context, params, logger } = resources; - if (!config['xpack.apm.serviceMapEnabled']) { + if (!config.serviceMapEnabled) { throw Boom.notFound(); } if (!isActivePlatinumLicense(context.licensing.license)) { @@ -81,7 +81,7 @@ const serviceMapServiceNodeRoute = createApmServerRoute({ handler: async (resources) => { const { config, context, params } = resources; - if (!config['xpack.apm.serviceMapEnabled']) { + if (!config.serviceMapEnabled) { throw Boom.notFound(); } if (!isActivePlatinumLicense(context.licensing.license)) { @@ -125,7 +125,7 @@ const serviceMapBackendNodeRoute = createApmServerRoute({ handler: async (resources) => { const { config, context, params } = resources; - if (!config['xpack.apm.serviceMapEnabled']) { + if (!config.serviceMapEnabled) { throw Boom.notFound(); } if (!isActivePlatinumLicense(context.licensing.license)) { diff --git a/x-pack/plugins/apm/server/routes/settings/apm_indices.ts b/x-pack/plugins/apm/server/routes/settings/apm_indices.ts index 1cba5f972c27e..156f4d1af0bb2 100644 --- a/x-pack/plugins/apm/server/routes/settings/apm_indices.ts +++ b/x-pack/plugins/apm/server/routes/settings/apm_indices.ts @@ -13,6 +13,7 @@ import { getApmIndexSettings, } from '../../lib/settings/apm_indices/get_apm_indices'; import { saveApmIndices } from '../../lib/settings/apm_indices/save_apm_indices'; +import { APMConfig } from '../..'; // get list of apm indices and values const apmIndexSettingsRoute = createApmServerRoute({ @@ -37,6 +38,10 @@ const apmIndicesRoute = createApmServerRoute({ }, }); +type SaveApmIndicesBodySchema = { + [Property in keyof APMConfig['indices']]: t.StringC; +}; + // save ui indices const saveApmIndicesRoute = createApmServerRoute({ endpoint: 'POST /internal/apm/settings/apm-indices/save', @@ -45,15 +50,13 @@ const saveApmIndicesRoute = createApmServerRoute({ }, params: t.type({ body: t.partial({ - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.sourcemapIndices': t.string, - 'apm_oss.errorIndices': t.string, - 'apm_oss.onboardingIndices': t.string, - 'apm_oss.spanIndices': t.string, - 'apm_oss.transactionIndices': t.string, - 'apm_oss.metricsIndices': t.string, - /* eslint-enable @typescript-eslint/naming-convention */ - }), + sourcemap: t.string, + error: t.string, + onboarding: t.string, + span: t.string, + transaction: t.string, + metric: t.string, + } as SaveApmIndicesBodySchema), }), handler: async (resources) => { const { params, context } = resources; diff --git a/x-pack/plugins/apm/server/saved_objects/apm_indices.ts b/x-pack/plugins/apm/server/saved_objects/apm_indices.ts index df5267023ae89..4aa6c4953056a 100644 --- a/x-pack/plugins/apm/server/saved_objects/apm_indices.ts +++ b/x-pack/plugins/apm/server/saved_objects/apm_indices.ts @@ -7,34 +7,24 @@ import { SavedObjectsType } from 'src/core/server'; import { i18n } from '@kbn/i18n'; +import { updateApmOssIndexPaths } from './migrations/update_apm_oss_index_paths'; +import { ApmIndicesConfigName } from '..'; + +const properties: { [Property in ApmIndicesConfigName]: { type: 'keyword' } } = + { + sourcemap: { type: 'keyword' }, + error: { type: 'keyword' }, + onboarding: { type: 'keyword' }, + span: { type: 'keyword' }, + transaction: { type: 'keyword' }, + metric: { type: 'keyword' }, + }; export const apmIndices: SavedObjectsType = { name: 'apm-indices', hidden: false, namespaceType: 'agnostic', - mappings: { - properties: { - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.sourcemapIndices': { - type: 'keyword', - }, - 'apm_oss.errorIndices': { - type: 'keyword', - }, - 'apm_oss.onboardingIndices': { - type: 'keyword', - }, - 'apm_oss.spanIndices': { - type: 'keyword', - }, - 'apm_oss.transactionIndices': { - type: 'keyword', - }, - 'apm_oss.metricsIndices': { - type: 'keyword', - }, - }, - }, + mappings: { properties }, management: { importableAndExportable: true, icon: 'apmApp', @@ -43,4 +33,10 @@ export const apmIndices: SavedObjectsType = { defaultMessage: 'APM Settings - Index', }), }, + migrations: { + '7.16.0': (doc) => { + const attributes = updateApmOssIndexPaths(doc.attributes); + return { ...doc, attributes }; + }, + }, }; diff --git a/x-pack/plugins/apm/server/saved_objects/migrations/update_apm_oss_index_paths.ts b/x-pack/plugins/apm/server/saved_objects/migrations/update_apm_oss_index_paths.ts new file mode 100644 index 0000000000000..72ba40db0ce05 --- /dev/null +++ b/x-pack/plugins/apm/server/saved_objects/migrations/update_apm_oss_index_paths.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +const apmIndexConfigs = [ + ['sourcemap', 'apm_oss.sourcemapIndices'], + ['error', 'apm_oss.errorIndices'], + ['onboarding', 'apm_oss.onboardingIndices'], + ['span', 'apm_oss.spanIndices'], + ['transaction', 'apm_oss.transactionIndices'], + ['metric', 'apm_oss.metricsIndices'], +] as const; + +type ApmIndexConfigs = typeof apmIndexConfigs[number][0]; +type ApmIndicesSavedObjectAttributes = Partial<{ + [Property in ApmIndexConfigs]: string; +}>; +type DeprecatedApmIndexConfigPaths = typeof apmIndexConfigs[number][1]; +type DeprecatedApmIndicesSavedObjectAttributes = Partial<{ + [Property in DeprecatedApmIndexConfigPaths]: string; +}>; + +export function updateApmOssIndexPaths( + attributes: DeprecatedApmIndicesSavedObjectAttributes +) { + return apmIndexConfigs.reduce((attrs, [configPath, deprecatedConfigPath]) => { + const indexConfig: string | undefined = attributes[deprecatedConfigPath]; + if (indexConfig) { + attrs[configPath] = indexConfig; + } + return attrs; + }, {} as ApmIndicesSavedObjectAttributes); +} diff --git a/x-pack/plugins/apm/server/tutorial/envs/on_prem.ts b/x-pack/plugins/apm/server/tutorial/envs/on_prem.ts index acc0ce69e0e4e..ba99b0624c441 100644 --- a/x-pack/plugins/apm/server/tutorial/envs/on_prem.ts +++ b/x-pack/plugins/apm/server/tutorial/envs/on_prem.ts @@ -37,13 +37,7 @@ export function onPremInstructions({ apmConfig, isFleetPluginEnabled, }: { - apmConfig: Pick< - APMConfig, - | 'apm_oss.errorIndices' - | 'apm_oss.transactionIndices' - | 'apm_oss.metricsIndices' - | 'apm_oss.onboardingIndices' - >; + apmConfig: APMConfig; isFleetPluginEnabled: boolean; }): InstructionsSchema { const EDIT_CONFIG = createEditConfig(); @@ -149,7 +143,7 @@ export function onPremInstructions({ } ), esHitsCheck: { - index: apmConfig['apm_oss.onboardingIndices'], + index: apmConfig.indices.onboarding, query: { bool: { filter: [ @@ -242,9 +236,9 @@ export function onPremInstructions({ ), esHitsCheck: { index: [ - apmConfig['apm_oss.errorIndices'], - apmConfig['apm_oss.transactionIndices'], - apmConfig['apm_oss.metricsIndices'], + apmConfig.indices.error, + apmConfig.indices.transaction, + apmConfig.indices.metric, ], query: { bool: { diff --git a/x-pack/plugins/apm/server/tutorial/index.ts b/x-pack/plugins/apm/server/tutorial/index.ts index 66e6ffaed95a8..5caf2b4372483 100644 --- a/x-pack/plugins/apm/server/tutorial/index.ts +++ b/x-pack/plugins/apm/server/tutorial/index.ts @@ -67,7 +67,7 @@ export const tutorialProvider = ], }; - if (apmConfig['xpack.apm.ui.enabled']) { + if (apmConfig.ui.enabled) { // @ts-expect-error artifacts.application is readonly artifacts.application = { path: '/app/apm', diff --git a/x-pack/plugins/apm/server/types.ts b/x-pack/plugins/apm/server/types.ts index 325891d8c1d33..c686c42beb6ef 100644 --- a/x-pack/plugins/apm/server/types.ts +++ b/x-pack/plugins/apm/server/types.ts @@ -16,7 +16,6 @@ import { PluginStart as DataPluginStart, } from '../../../../src/plugins/data/server'; import { SpacesPluginSetup, SpacesPluginStart } from '../../spaces/server'; -import { APMOSSPluginSetup } from '../../../../src/plugins/apm_oss/server'; import { HomeServerPluginSetup, HomeServerPluginStart, @@ -71,10 +70,6 @@ interface DependencyMap { setup: SpacesPluginSetup; start: SpacesPluginStart; }; - apmOss: { - setup: APMOSSPluginSetup; - start: undefined; - }; home: { setup: HomeServerPluginSetup; start: HomeServerPluginStart; @@ -135,7 +130,6 @@ interface DependencyMap { const requiredDependencies = [ 'features', - 'apmOss', 'data', 'licensing', 'triggersActionsUi', diff --git a/x-pack/plugins/apm/server/utils/test_helpers.tsx b/x-pack/plugins/apm/server/utils/test_helpers.tsx index 7b6b549e07c8d..5cf5016aec2e9 100644 --- a/x-pack/plugins/apm/server/utils/test_helpers.tsx +++ b/x-pack/plugins/apm/server/utils/test_helpers.tsx @@ -12,6 +12,7 @@ import { ESSearchResponse, } from '../../../../../src/core/types/elasticsearch'; import { UxUIFilters } from '../../typings/ui_filters'; +import { ApmIndicesConfig } from '../lib/settings/apm_indices/get_apm_indices'; interface Options { mockResponse?: ( @@ -26,18 +27,7 @@ interface MockSetup { internalClient: any; config: APMConfig; uiFilters: UxUIFilters; - indices: { - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.sourcemapIndices': string; - 'apm_oss.errorIndices': string; - 'apm_oss.onboardingIndices': string; - 'apm_oss.spanIndices': string; - 'apm_oss.transactionIndices': string; - 'apm_oss.metricsIndices': string; - /* eslint-enable @typescript-eslint/naming-convention */ - apmAgentConfigurationIndex: string; - apmCustomLinkIndex: string; - }; + indices: ApmIndicesConfig; } export async function inspectSearchParams( @@ -61,6 +51,16 @@ export async function inspectSearchParams( let response; let error; + const mockApmIndices: { + [Property in keyof APMConfig['indices']]: string; + } = { + sourcemap: 'myIndex', + error: 'myIndex', + onboarding: 'myIndex', + span: 'myIndex', + transaction: 'myIndex', + metric: 'myIndex', + }; const mockSetup = { apmEventClient: { search: spy } as any, internalClient: { search: spy } as any, @@ -76,8 +76,15 @@ export async function inspectSearchParams( switch (key) { default: return 'myIndex'; - - case 'xpack.apm.metricsInterval': + case 'indices': + return mockApmIndices; + case 'ui': + return { + enabled: true, + transactionGroupBucketSize: 1000, + maxTraceItems: 1000, + }; + case 'metricsInterval': return 30; } }, @@ -85,14 +92,7 @@ export async function inspectSearchParams( ) as APMConfig, uiFilters: options?.uiFilters ?? {}, indices: { - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.sourcemapIndices': 'myIndex', - 'apm_oss.errorIndices': 'myIndex', - 'apm_oss.onboardingIndices': 'myIndex', - 'apm_oss.spanIndices': 'myIndex', - 'apm_oss.transactionIndices': 'myIndex', - 'apm_oss.metricsIndices': 'myIndex', - /* eslint-enable @typescript-eslint/naming-convention */ + ...mockApmIndices, apmAgentConfigurationIndex: 'myIndex', apmCustomLinkIndex: 'myIndex', }, diff --git a/x-pack/plugins/apm/tsconfig.json b/x-pack/plugins/apm/tsconfig.json index c1030d2a4be1d..5db20725dd785 100644 --- a/x-pack/plugins/apm/tsconfig.json +++ b/x-pack/plugins/apm/tsconfig.json @@ -19,7 +19,6 @@ ], "references": [ { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/apm_oss/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json" }, diff --git a/x-pack/plugins/observability/common/typings.ts b/x-pack/plugins/observability/common/typings.ts index 71337075e1617..bccb0f4491009 100644 --- a/x-pack/plugins/observability/common/typings.ts +++ b/x-pack/plugins/observability/common/typings.ts @@ -16,14 +16,12 @@ export const alertWorkflowStatusRt = t.keyof({ export type AlertWorkflowStatus = t.TypeOf; export interface ApmIndicesConfig { - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.sourcemapIndices': string; - 'apm_oss.errorIndices': string; - 'apm_oss.onboardingIndices': string; - 'apm_oss.spanIndices': string; - 'apm_oss.transactionIndices': string; - 'apm_oss.metricsIndices': string; - /* eslint-enable @typescript-eslint/naming-convention */ + sourcemap: string; + error: string; + onboarding: string; + span: string; + transaction: string; + metric: string; apmAgentConfigurationIndex: string; apmCustomLinkIndex: string; } diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx index 83a7ac1ae17dc..8a766075ef8d2 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx @@ -65,7 +65,7 @@ export function IndexPatternContextProvider({ children }: ProviderProps) { case 'mobile': const resultApm = await getDataHandler('apm')?.hasData(); hasDataT = Boolean(resultApm?.hasData); - indices = resultApm?.indices['apm_oss.transactionIndices']; + indices = resultApm?.indices.transaction; break; } setHasAppData((prevState) => ({ ...prevState, [dataType]: hasDataT })); diff --git a/x-pack/plugins/observability/public/context/has_data_context.test.tsx b/x-pack/plugins/observability/public/context/has_data_context.test.tsx index 36f7bfb990222..a586a8bf0bcce 100644 --- a/x-pack/plugins/observability/public/context/has_data_context.test.tsx +++ b/x-pack/plugins/observability/public/context/has_data_context.test.tsx @@ -24,10 +24,7 @@ import { act } from '@testing-library/react'; const relativeStart = '2020-10-08T06:00:00.000Z'; const relativeEnd = '2020-10-08T07:00:00.000Z'; -const sampleAPMIndices = { - // eslint-disable-next-line @typescript-eslint/naming-convention - 'apm_oss.transactionIndices': 'apm-*', -} as ApmIndicesConfig; +const sampleAPMIndices = { transaction: 'apm-*' } as ApmIndicesConfig; function wrapper({ children }: { children: React.ReactElement }) { const history = createMemoryHistory(); diff --git a/x-pack/plugins/observability/public/data_handler.test.ts b/x-pack/plugins/observability/public/data_handler.test.ts index e0b8494d4dbed..2beae5d111f7d 100644 --- a/x-pack/plugins/observability/public/data_handler.test.ts +++ b/x-pack/plugins/observability/public/data_handler.test.ts @@ -9,10 +9,7 @@ import { registerDataHandler, getDataHandler } from './data_handler'; import moment from 'moment'; import { ApmIndicesConfig } from '../common/typings'; -const sampleAPMIndices = { - // eslint-disable-next-line @typescript-eslint/naming-convention - 'apm_oss.transactionIndices': 'apm-*', -} as ApmIndicesConfig; +const sampleAPMIndices = { transaction: 'apm-*' } as ApmIndicesConfig; const params = { absoluteTime: { diff --git a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx index 3c389a0ee20b2..506b919b16416 100644 --- a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx +++ b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx @@ -36,10 +36,7 @@ function unregisterAll() { unregisterDataHandler({ appName: 'synthetics' }); } -const sampleAPMIndices = { - // eslint-disable-next-line @typescript-eslint/naming-convention - 'apm_oss.transactionIndices': 'apm-*', -} as ApmIndicesConfig; +const sampleAPMIndices = { transaction: 'apm-*' } as ApmIndicesConfig; const withCore = makeDecorator({ name: 'withCore', diff --git a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/es_archiver/encrypted_saved_objects/mappings.json b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/es_archiver/encrypted_saved_objects/mappings.json index 54471972cd3d2..4a136e524f439 100644 --- a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/es_archiver/encrypted_saved_objects/mappings.json +++ b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/es_archiver/encrypted_saved_objects/mappings.json @@ -190,27 +190,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/es_archiver/encrypted_saved_objects_different_key/mappings.json b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/es_archiver/encrypted_saved_objects_different_key/mappings.json index 22b79eb9bbd8e..4e41d8cb72fb5 100644 --- a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/es_archiver/encrypted_saved_objects_different_key/mappings.json +++ b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/es_archiver/encrypted_saved_objects_different_key/mappings.json @@ -216,27 +216,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/es_archiver/key_rotation/mappings.json b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/es_archiver/key_rotation/mappings.json index 74083cbfa949a..9164430730216 100644 --- a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/es_archiver/key_rotation/mappings.json +++ b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/es_archiver/key_rotation/mappings.json @@ -214,27 +214,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/action_task_params/mappings.json b/x-pack/test/functional/es_archives/action_task_params/mappings.json index 2bb6be179d890..874886647e6d6 100644 --- a/x-pack/test/functional/es_archives/action_task_params/mappings.json +++ b/x-pack/test/functional/es_archives/action_task_params/mappings.json @@ -206,27 +206,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/actions/mappings.json b/x-pack/test/functional/es_archives/actions/mappings.json index eeb9d09d3b0a2..786005d1ab6a6 100644 --- a/x-pack/test/functional/es_archives/actions/mappings.json +++ b/x-pack/test/functional/es_archives/actions/mappings.json @@ -202,27 +202,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/alerts_legacy/mappings.json b/x-pack/test/functional/es_archives/alerts_legacy/mappings.json index 69edf30c1ffd0..9c856a829a343 100644 --- a/x-pack/test/functional/es_archives/alerts_legacy/mappings.json +++ b/x-pack/test/functional/es_archives/alerts_legacy/mappings.json @@ -198,27 +198,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/canvas/reports/mappings.json b/x-pack/test/functional/es_archives/canvas/reports/mappings.json index 047a52aaa1f98..51c48857d2481 100644 --- a/x-pack/test/functional/es_archives/canvas/reports/mappings.json +++ b/x-pack/test/functional/es_archives/canvas/reports/mappings.json @@ -229,27 +229,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/cases/migrations/7.10.0/mappings.json b/x-pack/test/functional/es_archives/cases/migrations/7.10.0/mappings.json index c7e1a180e6c54..bd0b2c4e9ad27 100644 --- a/x-pack/test/functional/es_archives/cases/migrations/7.10.0/mappings.json +++ b/x-pack/test/functional/es_archives/cases/migrations/7.10.0/mappings.json @@ -199,27 +199,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/cases/migrations/7.11.1/mappings.json b/x-pack/test/functional/es_archives/cases/migrations/7.11.1/mappings.json index bc719ab40aebd..2da75330be93a 100644 --- a/x-pack/test/functional/es_archives/cases/migrations/7.11.1/mappings.json +++ b/x-pack/test/functional/es_archives/cases/migrations/7.11.1/mappings.json @@ -254,27 +254,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, @@ -2720,4 +2716,4 @@ } } } -} \ No newline at end of file +} diff --git a/x-pack/test/functional/es_archives/cases/migrations/7.13.2/mappings.json b/x-pack/test/functional/es_archives/cases/migrations/7.13.2/mappings.json index 88f3e5d78cb16..62fec329aa40f 100644 --- a/x-pack/test/functional/es_archives/cases/migrations/7.13.2/mappings.json +++ b/x-pack/test/functional/es_archives/cases/migrations/7.13.2/mappings.json @@ -260,27 +260,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, @@ -2864,4 +2860,4 @@ } } } -} \ No newline at end of file +} diff --git a/x-pack/test/functional/es_archives/cases/migrations/7.13_user_actions/mappings.json b/x-pack/test/functional/es_archives/cases/migrations/7.13_user_actions/mappings.json index c6b71a2613859..8a9c1a626e652 100644 --- a/x-pack/test/functional/es_archives/cases/migrations/7.13_user_actions/mappings.json +++ b/x-pack/test/functional/es_archives/cases/migrations/7.13_user_actions/mappings.json @@ -261,27 +261,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, @@ -2951,4 +2947,4 @@ } } } -} \ No newline at end of file +} diff --git a/x-pack/test/functional/es_archives/data/search_sessions/mappings.json b/x-pack/test/functional/es_archives/data/search_sessions/mappings.json index a3eab7787c3eb..1203e1d892d56 100644 --- a/x-pack/test/functional/es_archives/data/search_sessions/mappings.json +++ b/x-pack/test/functional/es_archives/data/search_sessions/mappings.json @@ -169,27 +169,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/endpoint/telemetry/agent_only/mappings.json b/x-pack/test/functional/es_archives/endpoint/telemetry/agent_only/mappings.json index 4dcb8f905b197..daab89b69483e 100644 --- a/x-pack/test/functional/es_archives/endpoint/telemetry/agent_only/mappings.json +++ b/x-pack/test/functional/es_archives/endpoint/telemetry/agent_only/mappings.json @@ -198,27 +198,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_different_states/mappings.json b/x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_different_states/mappings.json index d6d91281151aa..c133c3fec76e2 100644 --- a/x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_different_states/mappings.json +++ b/x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_different_states/mappings.json @@ -199,27 +199,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_installed/mappings.json b/x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_installed/mappings.json index d6d91281151aa..c133c3fec76e2 100644 --- a/x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_installed/mappings.json +++ b/x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_installed/mappings.json @@ -199,27 +199,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_uninstalled/mappings.json b/x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_uninstalled/mappings.json index d6d91281151aa..c133c3fec76e2 100644 --- a/x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_uninstalled/mappings.json +++ b/x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_uninstalled/mappings.json @@ -199,27 +199,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_malware_disabled/mappings.json b/x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_malware_disabled/mappings.json index 4dcb8f905b197..daab89b69483e 100644 --- a/x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_malware_disabled/mappings.json +++ b/x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_malware_disabled/mappings.json @@ -198,27 +198,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_malware_enabled/mappings.json b/x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_malware_enabled/mappings.json index 4dcb8f905b197..daab89b69483e 100644 --- a/x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_malware_enabled/mappings.json +++ b/x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_malware_enabled/mappings.json @@ -198,27 +198,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_uninstalled/mappings.json b/x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_uninstalled/mappings.json index 4dcb8f905b197..daab89b69483e 100644 --- a/x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_uninstalled/mappings.json +++ b/x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_uninstalled/mappings.json @@ -198,27 +198,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/fleet/agents/mappings.json b/x-pack/test/functional/es_archives/fleet/agents/mappings.json index bbd02e6f4263a..272de2c2458da 100644 --- a/x-pack/test/functional/es_archives/fleet/agents/mappings.json +++ b/x-pack/test/functional/es_archives/fleet/agents/mappings.json @@ -190,27 +190,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/kibana_scripted_fields_on_logstash/mappings.json b/x-pack/test/functional/es_archives/kibana_scripted_fields_on_logstash/mappings.json index a70cb9014c781..ca5bfc9507ee7 100644 --- a/x-pack/test/functional/es_archives/kibana_scripted_fields_on_logstash/mappings.json +++ b/x-pack/test/functional/es_archives/kibana_scripted_fields_on_logstash/mappings.json @@ -182,27 +182,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/lists/mappings.json b/x-pack/test/functional/es_archives/lists/mappings.json index 134ed28bac2e7..e23c5ad224506 100644 --- a/x-pack/test/functional/es_archives/lists/mappings.json +++ b/x-pack/test/functional/es_archives/lists/mappings.json @@ -196,27 +196,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/reporting/canvas_disallowed_url/mappings.json b/x-pack/test/functional/es_archives/reporting/canvas_disallowed_url/mappings.json index 5bffb9540e983..a35e4c8e07e97 100644 --- a/x-pack/test/functional/es_archives/reporting/canvas_disallowed_url/mappings.json +++ b/x-pack/test/functional/es_archives/reporting/canvas_disallowed_url/mappings.json @@ -193,27 +193,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/reporting/ecommerce_kibana_spaces/mappings.json b/x-pack/test/functional/es_archives/reporting/ecommerce_kibana_spaces/mappings.json index 254184cbef584..9d11349819d68 100644 --- a/x-pack/test/functional/es_archives/reporting/ecommerce_kibana_spaces/mappings.json +++ b/x-pack/test/functional/es_archives/reporting/ecommerce_kibana_spaces/mappings.json @@ -214,27 +214,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/reporting/hugedata/mappings.json b/x-pack/test/functional/es_archives/reporting/hugedata/mappings.json index 1fdde9d9d208b..02a212d65cc1a 100644 --- a/x-pack/test/functional/es_archives/reporting/hugedata/mappings.json +++ b/x-pack/test/functional/es_archives/reporting/hugedata/mappings.json @@ -170,27 +170,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/reporting/multi_index_kibana/mappings.json b/x-pack/test/functional/es_archives/reporting/multi_index_kibana/mappings.json index f950877aea332..f6b5df41938fb 100644 --- a/x-pack/test/functional/es_archives/reporting/multi_index_kibana/mappings.json +++ b/x-pack/test/functional/es_archives/reporting/multi_index_kibana/mappings.json @@ -172,27 +172,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, @@ -2028,4 +2024,4 @@ } } } -} \ No newline at end of file +} diff --git a/x-pack/test/functional/es_archives/security_solution/migrations/mappings.json b/x-pack/test/functional/es_archives/security_solution/migrations/mappings.json index 5a602322b3017..fa49916066a1a 100644 --- a/x-pack/test/functional/es_archives/security_solution/migrations/mappings.json +++ b/x-pack/test/functional/es_archives/security_solution/migrations/mappings.json @@ -272,27 +272,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/security_solution/timelines/7.15.0/mappings.json b/x-pack/test/functional/es_archives/security_solution/timelines/7.15.0/mappings.json index 7561dbb8dc6d2..2e6a9bcee3d8c 100644 --- a/x-pack/test/functional/es_archives/security_solution/timelines/7.15.0/mappings.json +++ b/x-pack/test/functional/es_archives/security_solution/timelines/7.15.0/mappings.json @@ -276,27 +276,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } }, diff --git a/x-pack/test/functional/es_archives/visualize/default/mappings.json b/x-pack/test/functional/es_archives/visualize/default/mappings.json index 00dddbcafdd1c..2d761064d0a46 100644 --- a/x-pack/test/functional/es_archives/visualize/default/mappings.json +++ b/x-pack/test/functional/es_archives/visualize/default/mappings.json @@ -254,27 +254,23 @@ }, "apm-indices": { "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } + "errors": { + "type": "keyword" + }, + "metrics": { + "type": "keyword" + }, + "onboarding": { + "type": "keyword" + }, + "sourcemaps": { + "type": "keyword" + }, + "spans": { + "type": "keyword" + }, + "transactions": { + "type": "keyword" } } },