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 f87d1c966427..680aef242eb8 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 @@ -212,6 +212,12 @@ kibana_vars=( xpack.alerts.invalidateApiKeysTask.interval xpack.alerts.invalidateApiKeysTask.removalDelay xpack.apm.enabled + xpack.apm.errors + xpack.apm.metrics + xpack.apm.onboarding + xpack.apm.sourcemaps + xpack.apm.spans + xpack.apm.transactions xpack.apm.maxServiceEnvironments xpack.apm.searchAggregatedTransactions xpack.apm.serviceMapEnabled 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 bdc7edbafe8f..718b8bfb0175 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 @@ -19,12 +19,12 @@ describe('No data screen', () => { url: apmIndicesSaveURL, method: 'POST', body: { - 'xpack.apm.sourcemapIndices': 'foo-*', - 'xpack.apm.errorIndices': 'foo-*', - 'xpack.apm.onboardingIndices': 'foo-*', - 'xpack.apm.spanIndices': 'foo-*', - 'xpack.apm.transactionIndices': 'foo-*', - 'xpack.apm.metricsIndices': 'foo-*', + sourcemaps: 'foo-*', + errors: 'foo-*', + onboarding: 'foo-*', + spans: 'foo-*', + transactions: 'foo-*', + metrics: 'foo-*', }, headers: { 'kbn-xsrf': true, @@ -49,12 +49,12 @@ describe('No data screen', () => { url: apmIndicesSaveURL, method: 'POST', body: { - 'xpack.apm.sourcemapIndices': '', - 'xpack.apm.errorIndices': '', - 'xpack.apm.onboardingIndices': '', - 'xpack.apm.spanIndices': '', - 'xpack.apm.transactionIndices': '', - 'xpack.apm.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/public/components/app/Settings/ApmIndices/index.tsx b/x-pack/plugins/apm/public/components/app/Settings/ApmIndices/index.tsx index dd7c491598f1..595d34a2588b 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: 'xpack.apm.sourcemapIndices', + configurationName: 'sourcemaps', label: i18n.translate( 'xpack.apm.settings.apmIndices.sourcemapIndicesLabel', { defaultMessage: 'Sourcemap Indices' } ), }, { - configurationName: 'xpack.apm.errorIndices', + configurationName: 'errors', label: i18n.translate('xpack.apm.settings.apmIndices.errorIndicesLabel', { defaultMessage: 'Error Indices', }), }, { - configurationName: 'xpack.apm.onboardingIndices', + configurationName: 'onboarding', label: i18n.translate( 'xpack.apm.settings.apmIndices.onboardingIndicesLabel', { defaultMessage: 'Onboarding Indices' } ), }, { - configurationName: 'xpack.apm.spanIndices', + configurationName: 'spans', label: i18n.translate('xpack.apm.settings.apmIndices.spanIndicesLabel', { defaultMessage: 'Span Indices', }), }, { - configurationName: 'xpack.apm.transactionIndices', + configurationName: 'transactions', label: i18n.translate( 'xpack.apm.settings.apmIndices.transactionIndicesLabel', { defaultMessage: 'Transaction Indices' } ), }, { - configurationName: 'xpack.apm.metricsIndices', + configurationName: 'metrics', label: i18n.translate('xpack.apm.settings.apmIndices.metricsIndicesLabel', { defaultMessage: 'Metrics Indices', }), @@ -214,7 +214,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 e777317e220a..2203bc63f68c 100644 --- a/x-pack/plugins/apm/public/utils/testHelpers.tsx +++ b/x-pack/plugins/apm/public/utils/testHelpers.tsx @@ -119,12 +119,12 @@ interface MockSetup { config: APMConfig; uiFilters: UxUIFilters; indices: { - 'xpack.apm.sourcemapIndices': string; - 'xpack.apm.errorIndices': string; - 'xpack.apm.onboardingIndices': string; - 'xpack.apm.spanIndices': string; - 'xpack.apm.transactionIndices': string; - 'xpack.apm.metricsIndices': string; + sourcemaps: string; + errors: string; + onboarding: string; + spans: string; + transactions: string; + metrics: string; apmAgentConfigurationIndex: string; apmCustomLinkIndex: string; }; @@ -176,12 +176,12 @@ export async function inspectSearchParams( ) as APMConfig, uiFilters: {}, indices: { - 'xpack.apm.sourcemapIndices': 'myIndex', - 'xpack.apm.errorIndices': 'myIndex', - 'xpack.apm.onboardingIndices': 'myIndex', - 'xpack.apm.spanIndices': 'myIndex', - 'xpack.apm.transactionIndices': 'myIndex', - 'xpack.apm.metricsIndices': 'myIndex', + 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 5b1fdc0ad473..dbdb2278b15a 100644 --- a/x-pack/plugins/apm/scripts/shared/read-kibana-config.ts +++ b/x-pack/plugins/apm/scripts/shared/read-kibana-config.ts @@ -38,12 +38,12 @@ export const readKibanaConfig = () => { }; return { - 'xpack.apm.transactionIndices': 'apm-*', - 'xpack.apm.metricsIndices': 'apm-*', - 'xpack.apm.errorIndices': 'apm-*', - 'xpack.apm.spanIndices': 'apm-*', - 'xpack.apm.onboardingIndices': 'apm-*', - 'xpack.apm.sourcemapIndices': 'apm-*', + 'xpack.apm.indices.transactions': 'apm-*', + 'xpack.apm.indices.metrics': 'apm-*', + 'xpack.apm.indices.errors': 'apm-*', + 'xpack.apm.indices.spans': 'apm-*', + 'xpack.apm.indices.onboarding': 'apm-*', + 'xpack.apm.indices.sourcemaps': '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 0dab75cfba9c..5e5053521db6 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, + transactions: config['xpack.apm.indices.transactions'], + metrics: config['xpack.apm.indices.metrics'], + errors: config['xpack.apm.indices.errors'], + spans: config['xpack.apm.indices.spans'], + onboarding: config['xpack.apm.indices.onboarding'], + sourcemaps: config['xpack.apm.indices.sourcemaps'], 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 88a5aa196ea3..000000000000 --- a/x-pack/plugins/apm/server/index.test.ts +++ /dev/null @@ -1,34 +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. - */ - -import { APMXPackConfig } from '.'; -import { mergeConfigs } from './index'; - -describe('mergeConfigs', () => { - it('merges the configs', () => { - const apmConfig = { - transactionIndices: 'traces-apm*,apm-*-transaction-*', - spanIndices: 'traces-apm*,apm-*-span-*', - errorIndices: 'logs-apm*,apm-*-error-*', - metricsIndices: 'metrics-apm*,apm-*-metric-*', - ui: { enabled: false }, - enabled: true, - metricsInterval: 2000, - agent: { migrations: { enabled: true } }, - } as APMXPackConfig; - - expect(mergeConfigs(apmConfig)).toEqual({ - 'xpack.apm.errorIndices': 'logs-apm*,apm-*-error-*', - 'xpack.apm.metricsIndices': 'metrics-apm*,apm-*-metric-*', - 'xpack.apm.spanIndices': 'traces-apm*,apm-*-span-*', - 'xpack.apm.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 92b4e0bd8839..f5f41754c435 100644 --- a/x-pack/plugins/apm/server/index.ts +++ b/x-pack/plugins/apm/server/index.ts @@ -46,18 +46,18 @@ const configSchema = schema.object({ enabled: schema.boolean({ defaultValue: false }), }), }), - transactionIndices: schema.string({ defaultValue: 'traces-apm*,apm-*' }), - spanIndices: schema.string({ defaultValue: 'traces-apm*,apm-*' }), - errorIndices: schema.string({ defaultValue: 'logs-apm*,apm-*' }), - metricsIndices: schema.string({ defaultValue: 'metrics-apm*,apm-*' }), - sourcemapIndices: schema.string({ defaultValue: 'apm-*' }), - onboardingIndices: schema.string({ defaultValue: 'apm-*' }), - indexPattern: schema.string({ defaultValue: 'apm-*' }), - fleetMode: schema.boolean({ defaultValue: true }), + indices: schema.object({ + transactions: schema.string({ defaultValue: 'traces-apm*,apm-*' }), + spans: schema.string({ defaultValue: 'traces-apm*,apm-*' }), + errors: schema.string({ defaultValue: 'logs-apm*,apm-*' }), + metrics: schema.string({ defaultValue: 'metrics-apm*,apm-*' }), + sourcemaps: schema.string({ defaultValue: 'apm-*' }), + onboarding: schema.string({ defaultValue: 'apm-*' }), + }), }); // plugin config -export const config: PluginConfigDescriptor = { +export const config: PluginConfigDescriptor = { deprecations: ({ deprecate, renameFromRoot, @@ -67,13 +67,13 @@ export const config: PluginConfigDescriptor = { deprecate('enabled', '8.0.0'), renameFromRoot( 'apm_oss.transactionIndices', - 'xpack.apm.transactionIndices' + 'xpack.apm.indices.transactions' ), - renameFromRoot('apm_oss.spanIndices', 'xpack.apm.spanIndices'), - renameFromRoot('apm_oss.errorIndices', 'xpack.apm.errorIndices'), - renameFromRoot('apm_oss.metricsIndices', 'xpack.apm.metricsIndices'), - renameFromRoot('apm_oss.sourcemapIndices', 'xpack.apm.sourcemapIndices'), - renameFromRoot('apm_oss.onboardingIndices', 'xpack.apm.onboardingIndices'), + renameFromRoot('apm_oss.spanIndices', 'xpack.apm.indices.spans'), + renameFromRoot('apm_oss.errorIndices', 'xpack.apm.indices.errors'), + renameFromRoot('apm_oss.metricsIndices', 'xpack.apm.indices.metrics'), + renameFromRoot('apm_oss.sourcemapIndices', 'xpack.apm.indices.sourcemaps'), + renameFromRoot('apm_oss.onboardingIndices', 'xpack.apm.indices.onboarding'), deprecateFromRoot('apm_oss.enabled', '8.0.0'), unusedFromRoot('apm_oss.fleetMode'), unusedFromRoot('apm_oss.indexPattern'), @@ -94,44 +94,7 @@ export const config: PluginConfigDescriptor = { schema: configSchema, }; -export type APMXPackConfig = TypeOf; -export type APMConfig = ReturnType; - -// plugin config and ui indices settings -export function mergeConfigs(apmConfig: APMXPackConfig) { - const mergedConfig = { - 'xpack.apm.transactionIndices': apmConfig.transactionIndices, - 'xpack.apm.spanIndices': apmConfig.spanIndices, - 'xpack.apm.errorIndices': apmConfig.errorIndices, - 'xpack.apm.metricsIndices': apmConfig.metricsIndices, - 'xpack.apm.sourcemapIndices': apmConfig.sourcemapIndices, - 'xpack.apm.onboardingIndices': apmConfig.onboardingIndices, - '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, - }; - - return mergedConfig; -} +export type APMConfig = TypeOf; 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 19d9dd52d551..e87cb0c8cb9e 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['xpack.apm.errorIndices'], + index: indices.errors, 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 a0abc63392d8..82df85a0f516 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['xpack.apm.metricsIndices'] - : indices['xpack.apm.transactionIndices']; + ? indices.metrics + : indices.transactions; 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 77c483444359..758066e305a6 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['xpack.apm.metricsIndices'] - : indices['xpack.apm.transactionIndices']; + ? indices.metrics + : indices.transactions; 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 f51ad03e60bf..68bd113c52cb 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,8 +17,10 @@ export const createRuleTypeMocks = () => { let alertExecutor: (...args: any[]) => Promise; const mockedConfig$ = of({ - 'xpack.apm.errorIndices': 'apm-*', - 'xpack.apm.transactionIndices': 'apm-*', + indices: { + errors: 'apm-*', + transactions: '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 9f3b2dd4a9ac..63f78b0be9d2 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['xpack.apm.metricsIndices']; + const indexPatternName = indices.metrics; 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 e126068ed12e..3fe7b698f34c 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,10 +14,10 @@ import { describe('data telemetry collection tasks', () => { const indices = { - 'xpack.apm.errorIndices': 'apm-8.0.0-error', - 'xpack.apm.metricsIndices': 'apm-8.0.0-metric', - 'xpack.apm.spanIndices': 'apm-8.0.0-span', - 'xpack.apm.transactionIndices': 'apm-8.0.0-transaction', + errors: 'apm-8.0.0-error', + metrics: 'apm-8.0.0-metric', + spans: 'apm-8.0.0-span', + transactions: '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 9720735c3c49..07a95a908961 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['xpack.apm.transactionIndices']], + index: [indices.transactions], body: { size: 0, timeout, @@ -138,7 +138,7 @@ export const tasks: TelemetryTask[] = [ // fixed date range for reliable results const lastTransaction = ( await search({ - index: indices['xpack.apm.transactionIndices'], + index: indices.transactions, body: { query: { bool: { @@ -253,10 +253,10 @@ export const tasks: TelemetryTask[] = [ const response = await search({ index: [ - indices['xpack.apm.errorIndices'], - indices['xpack.apm.metricsIndices'], - indices['xpack.apm.spanIndices'], - indices['xpack.apm.transactionIndices'], + indices.errors, + indices.metrics, + indices.spans, + indices.transactions, ], body: { size: 0, @@ -310,10 +310,10 @@ export const tasks: TelemetryTask[] = [ const response = await search({ index: [ - indices['xpack.apm.errorIndices'], - indices['xpack.apm.metricsIndices'], - indices['xpack.apm.spanIndices'], - indices['xpack.apm.transactionIndices'], + indices.errors, + indices.metrics, + indices.spans, + indices.transactions, ], body: { size: 0, @@ -345,7 +345,7 @@ export const tasks: TelemetryTask[] = [ name: 'environments', executor: async ({ indices, search }) => { const response = await search({ - index: [indices['xpack.apm.transactionIndices']], + index: [indices.transactions], body: { query: { bool: { @@ -426,12 +426,12 @@ export const tasks: TelemetryTask[] = [ name: 'processor_events', executor: async ({ indices, search }) => { const indicesByProcessorEvent = { - error: indices['xpack.apm.errorIndices'], - metric: indices['xpack.apm.metricsIndices'], - span: indices['xpack.apm.spanIndices'], - transaction: indices['xpack.apm.transactionIndices'], - onboarding: indices['xpack.apm.onboardingIndices'], - sourcemap: indices['xpack.apm.sourcemapIndices'], + error: indices.errors, + metric: indices.metrics, + span: indices.spans, + transaction: indices.transactions, + onboarding: indices.onboarding, + sourcemap: indices.sourcemaps, }; type ProcessorEvent = keyof typeof indicesByProcessorEvent; @@ -549,10 +549,10 @@ export const tasks: TelemetryTask[] = [ return prevJob.then(async (data) => { const response = await search({ index: [ - indices['xpack.apm.errorIndices'], - indices['xpack.apm.spanIndices'], - indices['xpack.apm.metricsIndices'], - indices['xpack.apm.transactionIndices'], + indices.errors, + indices.spans, + indices.metrics, + indices.transactions, ], body: { size: 0, @@ -598,11 +598,7 @@ export const tasks: TelemetryTask[] = [ name: 'versions', executor: async ({ search, indices }) => { const response = await search({ - index: [ - indices['xpack.apm.transactionIndices'], - indices['xpack.apm.spanIndices'], - indices['xpack.apm.errorIndices'], - ], + index: [indices.transactions, indices.spans, indices.errors], terminateAfter: 1, body: { query: { @@ -647,7 +643,7 @@ export const tasks: TelemetryTask[] = [ executor: async ({ search, indices }) => { const errorGroupsCount = ( await search({ - index: indices['xpack.apm.errorIndices'], + index: indices.errors, body: { size: 0, timeout, @@ -683,7 +679,7 @@ export const tasks: TelemetryTask[] = [ const transactionGroupsCount = ( await search({ - index: indices['xpack.apm.transactionIndices'], + index: indices.transactions, body: { size: 0, timeout, @@ -719,7 +715,7 @@ export const tasks: TelemetryTask[] = [ const tracesPerDayCount = ( await search({ - index: indices['xpack.apm.transactionIndices'], + index: indices.transactions, body: { query: { bool: { @@ -741,11 +737,7 @@ export const tasks: TelemetryTask[] = [ const servicesCount = ( await search({ - index: [ - indices['xpack.apm.transactionIndices'], - indices['xpack.apm.errorIndices'], - indices['xpack.apm.metricsIndices'], - ], + index: [indices.transactions, indices.errors, indices.metrics], body: { size: 0, timeout, @@ -811,11 +803,7 @@ export const tasks: TelemetryTask[] = [ const data = await prevJob; const response = await search({ - index: [ - indices['xpack.apm.errorIndices'], - indices['xpack.apm.metricsIndices'], - indices['xpack.apm.transactionIndices'], - ], + index: [indices.errors, indices.metrics, indices.transactions], body: { size: 0, timeout, @@ -1006,12 +994,12 @@ export const tasks: TelemetryTask[] = [ const response = await indicesStats({ index: [ indices.apmAgentConfigurationIndex, - indices['xpack.apm.errorIndices'], - indices['xpack.apm.metricsIndices'], - indices['xpack.apm.onboardingIndices'], - indices['xpack.apm.sourcemapIndices'], - indices['xpack.apm.spanIndices'], - indices['xpack.apm.transactionIndices'], + indices.errors, + indices.metrics, + indices.onboarding, + indices.sourcemaps, + indices.spans, + indices.transactions, ], }); 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 e2afdb31795e..942dd75482db 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,12 +43,12 @@ describe('get buckets', () => { } ) as APMConfig, indices: { - 'xpack.apm.sourcemapIndices': 'apm-*', - 'xpack.apm.errorIndices': 'apm-*', - 'xpack.apm.onboardingIndices': 'apm-*', - 'xpack.apm.spanIndices': 'apm-*', - 'xpack.apm.transactionIndices': 'apm-*', - 'xpack.apm.metricsIndices': 'apm-*', + sourcemaps: 'apm-*', + errors: 'apm-*', + onboarding: 'apm-*', + spans: 'apm-*', + transactions: 'apm-*', + metrics: '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 f17224384842..1fac873ced7b 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 70df0959a63b..66e9697ab7c9 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 478f3218ef38..a58a95dd43fc 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 cc454cc0f291..00321c727ffb 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 @@ -18,12 +18,12 @@ describe('unpackProcessorEvents', () => { } as APMEventESSearchRequest; const indices = { - 'xpack.apm.transactionIndices': 'my-apm-*-transaction-*', - 'xpack.apm.metricsIndices': 'my-apm-*-metric-*', - 'xpack.apm.errorIndices': 'my-apm-*-error-*', - 'xpack.apm.spanIndices': 'my-apm-*-span-*', - 'xpack.apm.onboardingIndices': 'my-apm-*-onboarding-', - 'xpack.apm.sourcemapIndices': 'my-apm-*-sourcemap-*', + transactions: 'my-apm-*-transaction-*', + metrics: 'my-apm-*-metric-*', + errors: 'my-apm-*-error-*', + spans: 'my-apm-*-span-*', + onboarding: 'my-apm-*-onboarding-*', + sourcemaps: '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 04a22a6ca764..5d9f38f7dd8d 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 @@ -16,12 +16,12 @@ import { APMEventESSearchRequest, APMEventESTermsEnumRequest } from '.'; import { ApmIndicesConfig } from '../../../settings/apm_indices/get_apm_indices'; const processorEventIndexMap = { - [ProcessorEvent.transaction]: 'xpack.apm.transactionIndices', - [ProcessorEvent.span]: 'xpack.apm.spanIndices', - [ProcessorEvent.metric]: 'xpack.apm.metricsIndices', - [ProcessorEvent.error]: 'xpack.apm.errorIndices', + [ProcessorEvent.transaction]: 'transactions', + [ProcessorEvent.span]: 'spans', + [ProcessorEvent.metric]: 'metrics', + [ProcessorEvent.error]: 'errors', // TODO: should have its own config setting - [ProcessorEvent.profile]: 'xpack.apm.transactionIndices', + [ProcessorEvent.profile]: 'transactions', } as const; export function unpackProcessorEvents( 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 d2740712d3cc..2fa4f58b8a44 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 @@ -13,12 +13,12 @@ import { PROCESSOR_EVENT } from '../../../common/elasticsearch_fieldnames'; jest.mock('../settings/apm_indices/get_apm_indices', () => ({ getApmIndices: async () => ({ - 'xpack.apm.sourcemapIndices': 'apm-*', - 'xpack.apm.errorIndices': 'apm-*', - 'xpack.apm.onboardingIndices': 'apm-*', - 'xpack.apm.spanIndices': 'apm-*', - 'xpack.apm.transactionIndices': 'apm-*', - 'xpack.apm.metricsIndices': 'apm-*', + sourcemaps: 'apm-*', + errors: 'apm-*', + onboarding: 'apm-*', + spans: 'apm-*', + transactions: 'apm-*', + metrics: 'apm-*', apmAgentConfigurationIndex: 'apm-*', }), })); 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 0e5c6548ecc1..9def9f12568d 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 @@ -24,10 +24,10 @@ function getMockSavedObjectsClient(existingIndexPatternTitle: string) { const setup = { indices: { - 'xpack.apm.transactionIndices': 'apm-*-transaction-*', - 'xpack.apm.spanIndices': 'apm-*-span-*', - 'xpack.apm.errorIndices': 'apm-*-error-*', - 'xpack.apm.metricsIndices': 'apm-*-metrics-*', + transactions: 'apm-*-transaction-*', + spans: 'apm-*-span-*', + errors: 'apm-*-error-*', + metrics: 'apm-*-metrics-*', }, } as unknown as Setup; @@ -36,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', }); @@ -53,7 +53,7 @@ describe('createStaticIndexPattern', () => { await createStaticIndexPattern({ setup, - config: { 'xpack.apm.autocreateApmIndexPattern': true } as APMConfig, + config: { autocreateApmIndexPattern: true } as APMConfig, savedObjectsClient, spaceId: 'default', }); @@ -70,7 +70,7 @@ describe('createStaticIndexPattern', () => { await createStaticIndexPattern({ setup, - config: { 'xpack.apm.autocreateApmIndexPattern': true } as APMConfig, + config: { autocreateApmIndexPattern: true } as APMConfig, savedObjectsClient, spaceId: 'default', }); @@ -90,9 +90,7 @@ describe('createStaticIndexPattern', () => { await createStaticIndexPattern({ setup, - config: { - 'xpack.apm.autocreateApmIndexPattern': true, - } as APMConfig, + config: { autocreateApmIndexPattern: true } as APMConfig, savedObjectsClient, spaceId: 'default', }); @@ -119,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 4f35e7e63915..26ae2ac337e8 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 92f325c80a18..f98eed5c5e30 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 @@ -11,10 +11,10 @@ import { getApmIndexPatternTitle } from './get_apm_index_pattern_title'; describe('getApmIndexPatternTitle', () => { it('returns an index pattern title by combining existing indicies', () => { const title = getApmIndexPatternTitle({ - 'xpack.apm.transactionIndices': 'apm-*-transaction-*', - 'xpack.apm.spanIndices': 'apm-*-span-*', - 'xpack.apm.errorIndices': 'apm-*-error-*', - 'xpack.apm.metricsIndices': 'apm-*-metrics-*', + transactions: 'apm-*-transaction-*', + spans: 'apm-*-span-*', + errors: 'apm-*-error-*', + metrics: 'apm-*-metrics-*', } as ApmIndicesConfig); expect(title).toBe( 'apm-*-transaction-*,apm-*-span-*,apm-*-error-*,apm-*-metrics-*' @@ -23,10 +23,10 @@ describe('getApmIndexPatternTitle', () => { it('removes duplicates', () => { const title = getApmIndexPatternTitle({ - 'xpack.apm.transactionIndices': 'apm-*', - 'xpack.apm.spanIndices': 'apm-*', - 'xpack.apm.errorIndices': 'apm-*', - 'xpack.apm.metricsIndices': 'apm-*', + transactions: 'apm-*', + spans: 'apm-*', + errors: 'apm-*', + metrics: '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 ae70e4cf4bbc..df67930f5641 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['xpack.apm.transactionIndices'], - apmIndicesConfig['xpack.apm.spanIndices'], - apmIndicesConfig['xpack.apm.errorIndices'], - apmIndicesConfig['xpack.apm.metricsIndices'], + apmIndicesConfig.transactions, + apmIndicesConfig.spans, + apmIndicesConfig.errors, + apmIndicesConfig.metrics, ]).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 8231e4d3c6fa..68ce8de5cd3d 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 a3fce0368f4a..581a0782e4d7 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 2cf3bf5fd031..092eddaedf12 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['xpack.apm.transactionIndices']!, + indices: setup.indices.transactions, 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['xpack.apm.transactionIndices']!, + indices: setup.indices.transactions, }; } } 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 ea9ed01f930c..876d3c14eea0 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['xpack.apm.transactionIndices'], + index: indices.transactions, 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 3e70b4650fd4..f7d0e6dca0e2 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['xpack.apm.transactionIndices'], + index: indices.transactions, 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 be70dd7cf632..b2bea57a913c 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,7 +90,7 @@ const clientSearchMock = ( }; const getApmIndicesMock = async () => - ({ 'xpack.apm.transactionIndices': 'apm-*' } as ApmIndicesConfig); + ({ transactions: '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 2497a85c0c77..ae511d0fed8f 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 2129606e69fc..afb88189a5fd 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 c1c11f7bf639..7e16e69498e7 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 d5a200606039..fbc1e2880495 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 125814d58e73..342d49a85d81 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 @@ -34,12 +34,12 @@ async function getApmIndicesSavedObject( export function getApmIndicesConfig(config: APMConfig): ApmIndicesConfig { return { - 'xpack.apm.sourcemapIndices': config['xpack.apm.sourcemapIndices'], - 'xpack.apm.errorIndices': config['xpack.apm.errorIndices'], - 'xpack.apm.onboardingIndices': config['xpack.apm.onboardingIndices'], - 'xpack.apm.spanIndices': config['xpack.apm.spanIndices'], - 'xpack.apm.transactionIndices': config['xpack.apm.transactionIndices'], - 'xpack.apm.metricsIndices': config['xpack.apm.metricsIndices'], + sourcemaps: config.indices.sourcemaps, + errors: config.indices.errors, + onboarding: config.indices.onboarding, + spans: config.indices.spans, + transactions: config.indices.transactions, + metrics: config.indices.metrics, // system indices, not configurable apmAgentConfigurationIndex: '.apm-agent-configuration', apmCustomLinkIndex: '.apm-custom-link', @@ -64,15 +64,6 @@ export async function getApmIndices({ } } -const APM_UI_INDICES: Array = [ - 'xpack.apm.sourcemapIndices', - 'xpack.apm.errorIndices', - 'xpack.apm.onboardingIndices', - 'xpack.apm.spanIndices', - 'xpack.apm.transactionIndices', - 'xpack.apm.metricsIndices', -]; - export async function getApmIndexSettings({ context, config, @@ -91,8 +82,12 @@ export async function getApmIndexSettings({ } const apmIndicesConfig = getApmIndicesConfig(config); - return APM_UI_INDICES.map((configurationName) => ({ - configurationName, + const apmIndices = Object.keys(config.indices) as Array< + keyof typeof config.indices + >; + + return apmIndices.map((configurationName) => ({ + 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/get_trace_items.ts b/x-pack/plugins/apm/server/lib/traces/get_trace_items.ts index e940100edcf5..60a28fd9abdb 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 ab75ec7f3612..7c4543cf3eda 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 @@ -13,12 +13,12 @@ import { APMConfig } from '../../..'; import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; const mockIndices = { - 'xpack.apm.sourcemapIndices': 'myIndex', - 'xpack.apm.errorIndices': 'myIndex', - 'xpack.apm.onboardingIndices': 'myIndex', - 'xpack.apm.spanIndices': 'myIndex', - 'xpack.apm.transactionIndices': 'myIndex', - 'xpack.apm.metricsIndices': 'myIndex', + sourcemaps: 'myIndex', + errors: 'myIndex', + onboarding: 'myIndex', + spans: 'myIndex', + transactions: 'myIndex', + metrics: '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 62277dba8ac2..a5c11776c70b 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 492623edf3e0..cec4f1138ece 100644 --- a/x-pack/plugins/apm/server/plugin.ts +++ b/x-pack/plugins/apm/server/plugin.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { map, take } from 'rxjs/operators'; +import { take } from 'rxjs/operators'; import { CoreSetup, CoreStart, @@ -18,8 +18,8 @@ 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,*/ APMConfig, APM_SERVER_FEATURE_ID } from '.'; +// import { getFullPathConfigs } from './index'; import { UI_SETTINGS } from '../../../../src/plugins/data/common'; import { APM_FEATURE, registerFeaturesUsage } from './feature'; import { registerApmAlerts } from './lib/alerts/register_apm_alerts'; @@ -72,28 +72,32 @@ export class APMPlugin plugins: Omit ) { this.logger = this.initContext.logger.get(); - const config$ = this.initContext.config.create(); - const mergedConfig$ = config$.pipe( - map((apmConfig) => mergeConfigs(apmConfig)) - ); + const config$ = this.initContext.config.create(); + // const mergedConfig$ = config$.pipe( + // map((apmConfig) => getFullPathConfigs(apmConfig)) + // ); core.savedObjects.registerType(apmIndices); core.savedObjects.registerType(apmTelemetry); core.savedObjects.registerType(apmServerSettings); - const currentConfig = mergeConfigs( - this.initContext.config.get() - ); + // const currentConfig = getFullPathConfigs( + // this.initContext.config.get() + // ); + // this.currentConfig = currentConfig; + const currentConfig = this.initContext.config.get(); this.currentConfig = currentConfig; if ( plugins.taskManager && plugins.usageCollection && - currentConfig['xpack.apm.telemetryCollectionEnabled'] + currentConfig.telemetryCollectionEnabled + // currentConfig['xpack.apm.telemetryCollectionEnabled'] ) { createApmTelemetry({ core, - config$: mergedConfig$, + // config$: mergedConfig$, + config$, usageCollector: plugins.usageCollection, taskManager: plugins.taskManager, logger: this.logger, @@ -154,7 +158,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) => { @@ -191,7 +195,7 @@ export class APMPlugin ruleDataClient, alerting: plugins.alerting, ml: plugins.ml, - config$: mergedConfig$, + config$, logger: this.logger!.get('rule'), }); } @@ -229,7 +233,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 5bfbfef5e680..8b3fc7e66c6d 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 8fb3abe99e36..11a2e8bb445a 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 ef85b6ee4fb8..29ee3359a183 100644 --- a/x-pack/plugins/apm/server/routes/settings/apm_indices.ts +++ b/x-pack/plugins/apm/server/routes/settings/apm_indices.ts @@ -45,12 +45,12 @@ const saveApmIndicesRoute = createApmServerRoute({ }, params: t.type({ body: t.partial({ - 'xpack.apm.sourcemapIndices': t.string, - 'xpack.apm.errorIndices': t.string, - 'xpack.apm.onboardingIndices': t.string, - 'xpack.apm.spanIndices': t.string, - 'xpack.apm.transactionIndices': t.string, - 'xpack.apm.metricsIndices': t.string, + sourcemaps: t.string, + errors: t.string, + onboarding: t.string, + spans: t.string, + transactions: t.string, + metrics: t.string, }), }), handler: async (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 2d855cb515e1..0be512a4fd17 100644 --- a/x-pack/plugins/apm/server/saved_objects/apm_indices.ts +++ b/x-pack/plugins/apm/server/saved_objects/apm_indices.ts @@ -15,24 +15,12 @@ export const apmIndices: SavedObjectsType = { namespaceType: 'agnostic', mappings: { properties: { - 'xpack.apm.sourcemapIndices': { - type: 'keyword', - }, - 'xpack.apm.errorIndices': { - type: 'keyword', - }, - 'xpack.apm.onboardingIndices': { - type: 'keyword', - }, - 'xpack.apm.spanIndices': { - type: 'keyword', - }, - 'xpack.apm.transactionIndices': { - type: 'keyword', - }, - 'xpack.apm.metricsIndices': { - type: 'keyword', - }, + sourcemaps: { type: 'keyword' }, + errors: { type: 'keyword' }, + onboarding: { type: 'keyword' }, + spans: { type: 'keyword' }, + transactions: { type: 'keyword' }, + metrics: { type: 'keyword' }, }, }, management: { 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 index 5999a37ee44b..49ea9076b008 100644 --- 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 @@ -5,35 +5,32 @@ * 2.0. */ -const apmIndexConfigPaths = [ - ['xpack.apm.sourcemapIndices', 'apm_oss.sourcemapIndices'], - ['xpack.apm.errorIndices', 'apm_oss.errorIndices'], - ['xpack.apm.onboardingIndices', 'apm_oss.onboardingIndices'], - ['xpack.apm.spanIndices', 'apm_oss.spanIndices'], - ['xpack.apm.transactionIndices', 'apm_oss.transactionIndices'], - ['xpack.apm.metricsIndices', 'apm_oss.metricsIndices'], +const apmIndexConfigs = [ + ['sourcemaps', 'apm_oss.sourcemapIndices'], + ['errors', 'apm_oss.errorIndices'], + ['onboarding', 'apm_oss.onboardingIndices'], + ['spans', 'apm_oss.spanIndices'], + ['transactions', 'apm_oss.transactionIndices'], + ['metrics', 'apm_oss.metricsIndices'], ] as const; -type ApmIndexConfigsPaths = typeof apmIndexConfigPaths[number][0]; +type ApmIndexConfigs = typeof apmIndexConfigs[number][0]; type ApmIndicesSavedObjectAttributes = Partial<{ - [Property in ApmIndexConfigsPaths]: string; + [Property in ApmIndexConfigs]: string; }>; -type DeprecatedApmIndexConfigsPaths = typeof apmIndexConfigPaths[number][1]; +type DeprecatedApmIndexConfigPaths = typeof apmIndexConfigs[number][1]; type DeprecatedApmIndicesSavedObjectAttributes = Partial<{ - [Property in DeprecatedApmIndexConfigsPaths]: string; + [Property in DeprecatedApmIndexConfigPaths]: string; }>; export function updateApmOssIndexPaths( attributes: DeprecatedApmIndicesSavedObjectAttributes ) { - return apmIndexConfigPaths.reduce( - (attrs, [configPath, deprecatedConfigPath]) => { - const indexConfig: string | undefined = attributes[deprecatedConfigPath]; - if (indexConfig) { - attrs[configPath] = indexConfig; - } - return attrs; - }, - {} as ApmIndicesSavedObjectAttributes - ); + 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 2fc9d5d6cb2e..4d617e6a47e4 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, - | 'xpack.apm.errorIndices' - | 'xpack.apm.transactionIndices' - | 'xpack.apm.metricsIndices' - | 'xpack.apm.onboardingIndices' - >; + apmConfig: APMConfig; isFleetPluginEnabled: boolean; }): InstructionsSchema { const EDIT_CONFIG = createEditConfig(); @@ -144,7 +138,7 @@ export function onPremInstructions({ } ), esHitsCheck: { - index: apmConfig['xpack.apm.onboardingIndices'], + index: apmConfig.indices.onboarding, query: { bool: { filter: [ @@ -237,9 +231,9 @@ export function onPremInstructions({ ), esHitsCheck: { index: [ - apmConfig['xpack.apm.errorIndices'], - apmConfig['xpack.apm.transactionIndices'], - apmConfig['xpack.apm.metricsIndices'], + apmConfig.indices.errors, + apmConfig.indices.transactions, + apmConfig.indices.metrics, ], query: { bool: { diff --git a/x-pack/plugins/apm/server/tutorial/index.ts b/x-pack/plugins/apm/server/tutorial/index.ts index 66e6ffaed95a..5caf2b437248 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/utils/test_helpers.tsx b/x-pack/plugins/apm/server/utils/test_helpers.tsx index 10b669500573..290a03220ef5 100644 --- a/x-pack/plugins/apm/server/utils/test_helpers.tsx +++ b/x-pack/plugins/apm/server/utils/test_helpers.tsx @@ -27,12 +27,12 @@ interface MockSetup { config: APMConfig; uiFilters: UxUIFilters; indices: { - 'xpack.apm.sourcemapIndices': string; - 'xpack.apm.errorIndices': string; - 'xpack.apm.onboardingIndices': string; - 'xpack.apm.spanIndices': string; - 'xpack.apm.transactionIndices': string; - 'xpack.apm.metricsIndices': string; + sourcemaps: string; + errors: string; + onboarding: string; + spans: string; + transactions: string; + metrics: string; apmAgentConfigurationIndex: string; apmCustomLinkIndex: string; }; @@ -74,8 +74,9 @@ export async function inspectSearchParams( switch (key) { default: return 'myIndex'; - - case 'xpack.apm.metricsInterval': + case 'indices': + return new Proxy({}, { get: () => 'myIndex' }); + case 'metricsInterval': return 30; } }, @@ -83,12 +84,12 @@ export async function inspectSearchParams( ) as APMConfig, uiFilters: options?.uiFilters ?? {}, indices: { - 'xpack.apm.sourcemapIndices': 'myIndex', - 'xpack.apm.errorIndices': 'myIndex', - 'xpack.apm.onboardingIndices': 'myIndex', - 'xpack.apm.spanIndices': 'myIndex', - 'xpack.apm.transactionIndices': 'myIndex', - 'xpack.apm.metricsIndices': 'myIndex', + sourcemaps: 'myIndex', + errors: 'myIndex', + onboarding: 'myIndex', + spans: 'myIndex', + transactions: 'myIndex', + metrics: 'myIndex', apmAgentConfigurationIndex: 'myIndex', apmCustomLinkIndex: 'myIndex', }, diff --git a/x-pack/plugins/observability/common/typings.ts b/x-pack/plugins/observability/common/typings.ts index 657841e59ff0..b9edb51760a3 100644 --- a/x-pack/plugins/observability/common/typings.ts +++ b/x-pack/plugins/observability/common/typings.ts @@ -16,12 +16,12 @@ export const alertWorkflowStatusRt = t.keyof({ export type AlertWorkflowStatus = t.TypeOf; export interface ApmIndicesConfig { - 'xpack.apm.sourcemapIndices': string; - 'xpack.apm.errorIndices': string; - 'xpack.apm.onboardingIndices': string; - 'xpack.apm.spanIndices': string; - 'xpack.apm.transactionIndices': string; - 'xpack.apm.metricsIndices': string; + sourcemaps: string; + errors: string; + onboarding: string; + spans: string; + transactions: string; + metrics: 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 5245030a6466..36dcd93b7d7e 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['xpack.apm.transactionIndices']; + indices = resultApm?.indices.transactions; 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 dc227936aeaf..72cfe68a583e 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,7 +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 = { 'xpack.apm.transactionIndices': 'apm-*' } as ApmIndicesConfig; +const sampleAPMIndices = { transactions: '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 441de2e44af1..127b00349d43 100644 --- a/x-pack/plugins/observability/public/data_handler.test.ts +++ b/x-pack/plugins/observability/public/data_handler.test.ts @@ -9,7 +9,7 @@ import { registerDataHandler, getDataHandler } from './data_handler'; import moment from 'moment'; import { ApmIndicesConfig } from '../common/typings'; -const sampleAPMIndices = { 'xpack.apm.transactionIndices': 'apm-*' } as ApmIndicesConfig; +const sampleAPMIndices = { transactions: '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 8bac62402d53..8eded3fad7da 100644 --- a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx +++ b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx @@ -36,7 +36,7 @@ function unregisterAll() { unregisterDataHandler({ appName: 'synthetics' }); } -const sampleAPMIndices = { 'xpack.apm.transactionIndices': 'apm-*' } as ApmIndicesConfig; +const sampleAPMIndices = { transactions: '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 f1dfc542dad5..daa99c4d7196 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 @@ -189,31 +189,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 fae1a1379f5a..4e41d8cb72fb 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,31 +216,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 b430bf962fb4..916443073021 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,31 +214,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 ab08540a145b..874886647e6d 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,31 +206,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 6351edc05d02..786005d1ab6a 100644 --- a/x-pack/test/functional/es_archives/actions/mappings.json +++ b/x-pack/test/functional/es_archives/actions/mappings.json @@ -202,31 +202,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 6e7361ead260..9c856a829a34 100644 --- a/x-pack/test/functional/es_archives/alerts_legacy/mappings.json +++ b/x-pack/test/functional/es_archives/alerts_legacy/mappings.json @@ -198,31 +198,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 68f34d37dbd3..51c48857d248 100644 --- a/x-pack/test/functional/es_archives/canvas/reports/mappings.json +++ b/x-pack/test/functional/es_archives/canvas/reports/mappings.json @@ -229,31 +229,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 62049be7d9dc..bd0b2c4e9ad2 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,31 +199,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 de4e11dee2f2..2da75330be93 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,31 +254,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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.13.2/mappings.json b/x-pack/test/functional/es_archives/cases/migrations/7.13.2/mappings.json index cf82159d06b4..62fec329aa40 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,31 +260,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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.13_user_actions/mappings.json b/x-pack/test/functional/es_archives/cases/migrations/7.13_user_actions/mappings.json index cf2442c59c6b..8a9c1a626e65 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,31 +261,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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.16.0_space/mappings.json b/x-pack/test/functional/es_archives/cases/migrations/7.16.0_space/mappings.json index 51fe50218b1f..4b8f2c7103b2 100644 --- a/x-pack/test/functional/es_archives/cases/migrations/7.16.0_space/mappings.json +++ b/x-pack/test/functional/es_archives/cases/migrations/7.16.0_space/mappings.json @@ -275,27 +275,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/data/search_sessions/mappings.json b/x-pack/test/functional/es_archives/data/search_sessions/mappings.json index f61db73871ac..1203e1d892d5 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,31 +169,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 08a9d3b8f893..daab89b69483 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,31 +198,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 4e6ebd37527a..c133c3fec76e 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,31 +199,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 4e6ebd37527a..c133c3fec76e 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,31 +199,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 4e6ebd37527a..c133c3fec76e 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,31 +199,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 08a9d3b8f893..daab89b69483 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,31 +198,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 08a9d3b8f893..daab89b69483 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,31 +198,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 08a9d3b8f893..daab89b69483 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,31 +198,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 e294fe5bc884..b2f5392ebd23 100644 --- a/x-pack/test/functional/es_archives/fleet/agents/mappings.json +++ b/x-pack/test/functional/es_archives/fleet/agents/mappings.json @@ -189,31 +189,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 d8aa7f2a5fc6..7853368bc37d 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 @@ -181,31 +181,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 f33d0a9ee6b1..e23c5ad22450 100644 --- a/x-pack/test/functional/es_archives/lists/mappings.json +++ b/x-pack/test/functional/es_archives/lists/mappings.json @@ -196,31 +196,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 a6df85c97779..a35e4c8e07e9 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,31 +193,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 295236e90c18..9d11349819d6 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,31 +214,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 143547d17d21..02a212d65cc1 100644 --- a/x-pack/test/functional/es_archives/reporting/hugedata/mappings.json +++ b/x-pack/test/functional/es_archives/reporting/hugedata/mappings.json @@ -170,31 +170,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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 74a554910da3..f6b5df41938f 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,31 +172,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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/migrations/mappings.json b/x-pack/test/functional/es_archives/security_solution/migrations/mappings.json index 5a602322b301..fa49916066a1 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 cf32d22feb11..2e6a9bcee3d8 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,31 +276,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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_space/mappings.json b/x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space/mappings.json index 0fa5a458f699..682b241c126f 100644 --- a/x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space/mappings.json +++ b/x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space/mappings.json @@ -273,27 +273,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" } } }, @@ -3089,4 +3085,4 @@ } } } -} \ No newline at end of file +} 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 62b3f9105e2c..2d761064d0a4 100644 --- a/x-pack/test/functional/es_archives/visualize/default/mappings.json +++ b/x-pack/test/functional/es_archives/visualize/default/mappings.json @@ -254,31 +254,23 @@ }, "apm-indices": { "properties": { - "xpack": { - "properties": { - "apm": { - "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" } } },