Skip to content

Commit

Permalink
[APM] Removes the apm_oss plugin and deprecates related configs (#113364
Browse files Browse the repository at this point in the history
) (#114873)

* [APM] Removes the apm_oss plugin and deprecates related configs (#108160)

* removes commented lines

* fixes typescript errors

* performs start up migration on the saved objects mapping for apm-indices

* removes all references to the deprecated apm_oss.* config paths in APM

* fixes missing bundle error

* fixes type error

* fixes eslint error with disabled rules

* fixes saved object mappings for es_archvices for tests

* fixes eslint error

* Updates default index values to include the more general apm-*. Fixes broken tests.

* removing unused configs from the config path migration: apm_oss.indexPattern and apm_oss.fleetMode

* - replaces full index configuration paths with references in the `xpack.apm.indices` namespace
- removes mergeConfig function and test

* fixes proxy mock object in unit test

* fixes linting issues

* PR feedback and failed test

* changes the configs at `xpack.apm.indices.*` from plural to singular to match `processor.event` values
# Conflicts:
#	x-pack/test/functional/es_archives/cases/migrations/7.16.0_space/mappings.json
#	x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space/mappings.json
  • Loading branch information
ogupte authored Oct 13, 2021
1 parent 488cc68 commit 61dc25d
Show file tree
Hide file tree
Showing 97 changed files with 850 additions and 1,256 deletions.
4 changes: 0 additions & 4 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ NOTE:
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/apm_oss/README.asciidoc[apmOss]
|undefined
|{kib-repo}blob/{branch}/src/plugins/bfetch/README.md[bfetch]
|bfetch allows to batch HTTP requests and streams responses back.
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pageLoadAssetSize:
advancedSettings: 27596
alerting: 106936
apm: 64385
apmOss: 18996
bfetch: 51874
canvas: 1066647
charts: 95000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ kibana_vars=(
xpack.alerts.invalidateApiKeysTask.interval
xpack.alerts.invalidateApiKeysTask.removalDelay
xpack.apm.enabled
xpack.apm.indices.errors
xpack.apm.indices.metrics
xpack.apm.indices.onboarding
xpack.apm.indices.sourcemaps
xpack.apm.indices.spans
xpack.apm.indices.transactions
xpack.apm.maxServiceEnvironments
xpack.apm.searchAggregatedTransactions
xpack.apm.serviceMapEnabled
Expand Down
5 changes: 0 additions & 5 deletions src/plugins/apm_oss/README.asciidoc

This file was deleted.

13 changes: 0 additions & 13 deletions src/plugins/apm_oss/kibana.json

This file was deleted.

16 changes: 0 additions & 16 deletions src/plugins/apm_oss/public/index.ts

This file was deleted.

22 changes: 0 additions & 22 deletions src/plugins/apm_oss/public/plugin.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/plugins/apm_oss/public/types.ts

This file was deleted.

40 changes: 0 additions & 40 deletions src/plugins/apm_oss/server/index.ts

This file was deleted.

30 changes: 0 additions & 30 deletions src/plugins/apm_oss/server/plugin.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/plugins/apm_oss/tsconfig.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
/* eslint-disable @typescript-eslint/naming-convention */

const apmIndicesSaveURL = '/internal/apm/settings/apm-indices/save';

Expand All @@ -20,12 +19,12 @@ describe('No data screen', () => {
url: apmIndicesSaveURL,
method: 'POST',
body: {
'apm_oss.sourcemapIndices': 'foo-*',
'apm_oss.errorIndices': 'foo-*',
'apm_oss.onboardingIndices': 'foo-*',
'apm_oss.spanIndices': 'foo-*',
'apm_oss.transactionIndices': 'foo-*',
'apm_oss.metricsIndices': 'foo-*',
sourcemaps: 'foo-*',
errors: 'foo-*',
onboarding: 'foo-*',
spans: 'foo-*',
transactions: 'foo-*',
metrics: 'foo-*',
},
headers: {
'kbn-xsrf': true,
Expand All @@ -50,12 +49,12 @@ describe('No data screen', () => {
url: apmIndicesSaveURL,
method: 'POST',
body: {
'apm_oss.sourcemapIndices': '',
'apm_oss.errorIndices': '',
'apm_oss.onboardingIndices': '',
'apm_oss.spanIndices': '',
'apm_oss.transactionIndices': '',
'apm_oss.metricsIndices': '',
sourcemaps: '',
errors: '',
onboarding: '',
spans: '',
transactions: '',
metrics: '',
},
headers: { 'kbn-xsrf': true },
auth: { user: 'apm_power_user', pass: 'changeme' },
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/apm/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"version": "8.0.0",
"kibanaVersion": "kibana",
"requiredPlugins": [
"apmOss",
"data",
"embeddable",
"features",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,40 +30,40 @@ import {

const APM_INDEX_LABELS = [
{
configurationName: 'apm_oss.sourcemapIndices',
configurationName: 'sourcemap',
label: i18n.translate(
'xpack.apm.settings.apmIndices.sourcemapIndicesLabel',
{ defaultMessage: 'Sourcemap Indices' }
),
},
{
configurationName: 'apm_oss.errorIndices',
configurationName: 'error',
label: i18n.translate('xpack.apm.settings.apmIndices.errorIndicesLabel', {
defaultMessage: 'Error Indices',
}),
},
{
configurationName: 'apm_oss.onboardingIndices',
configurationName: 'onboarding',
label: i18n.translate(
'xpack.apm.settings.apmIndices.onboardingIndicesLabel',
{ defaultMessage: 'Onboarding Indices' }
),
},
{
configurationName: 'apm_oss.spanIndices',
configurationName: 'span',
label: i18n.translate('xpack.apm.settings.apmIndices.spanIndicesLabel', {
defaultMessage: 'Span Indices',
}),
},
{
configurationName: 'apm_oss.transactionIndices',
configurationName: 'transaction',
label: i18n.translate(
'xpack.apm.settings.apmIndices.transactionIndicesLabel',
{ defaultMessage: 'Transaction Indices' }
),
},
{
configurationName: 'apm_oss.metricsIndices',
configurationName: 'metric',
label: i18n.translate('xpack.apm.settings.apmIndices.metricsIndicesLabel', {
defaultMessage: 'Metrics Indices',
}),
Expand Down Expand Up @@ -145,7 +145,7 @@ export function ApmIndices() {
}
),
});
} catch (error) {
} catch (error: any) {
notifications.toasts.addDanger({
title: i18n.translate(
'xpack.apm.settings.apmIndices.applyChanges.failed.title',
Expand Down Expand Up @@ -215,7 +215,10 @@ export function ApmIndices() {
{
defaultMessage:
'Overrides {configurationName}: {defaultValue}',
values: { configurationName, defaultValue },
values: {
configurationName: `xpack.apm.indices.${configurationName}`,
defaultValue,
},
}
)}
fullWidth
Expand Down
28 changes: 12 additions & 16 deletions x-pack/plugins/apm/public/utils/testHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,12 @@ interface MockSetup {
config: APMConfig;
uiFilters: UxUIFilters;
indices: {
/* eslint-disable @typescript-eslint/naming-convention */
'apm_oss.sourcemapIndices': string;
'apm_oss.errorIndices': string;
'apm_oss.onboardingIndices': string;
'apm_oss.spanIndices': string;
'apm_oss.transactionIndices': string;
'apm_oss.metricsIndices': string;
/* eslint-enable @typescript-eslint/naming-convention */
sourcemaps: string;
errors: string;
onboarding: string;
spans: string;
transactions: string;
metrics: string;
apmAgentConfigurationIndex: string;
apmCustomLinkIndex: string;
};
Expand Down Expand Up @@ -178,14 +176,12 @@ export async function inspectSearchParams(
) as APMConfig,
uiFilters: {},
indices: {
/* eslint-disable @typescript-eslint/naming-convention */
'apm_oss.sourcemapIndices': 'myIndex',
'apm_oss.errorIndices': 'myIndex',
'apm_oss.onboardingIndices': 'myIndex',
'apm_oss.spanIndices': 'myIndex',
'apm_oss.transactionIndices': 'myIndex',
'apm_oss.metricsIndices': 'myIndex',
/* eslint-enable @typescript-eslint/naming-convention */
sourcemaps: 'myIndex',
errors: 'myIndex',
onboarding: 'myIndex',
spans: 'myIndex',
transactions: 'myIndex',
metrics: 'myIndex',
apmAgentConfigurationIndex: 'myIndex',
apmCustomLinkIndex: 'myIndex',
},
Expand Down
14 changes: 6 additions & 8 deletions x-pack/plugins/apm/scripts/shared/read-kibana-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ export const readKibanaConfig = () => {
};

return {
/* eslint-disable @typescript-eslint/naming-convention */
'apm_oss.transactionIndices': 'apm-*',
'apm_oss.metricsIndices': 'apm-*',
'apm_oss.errorIndices': 'apm-*',
'apm_oss.spanIndices': 'apm-*',
'apm_oss.onboardingIndices': 'apm-*',
'apm_oss.sourcemapIndices': 'apm-*',
/* eslint-enable @typescript-eslint/naming-convention */
'xpack.apm.indices.transaction': 'traces-apm*,apm-*',
'xpack.apm.indices.metric': 'metrics-apm*,apm-*',
'xpack.apm.indices.error': 'logs-apm*,apm-*',
'xpack.apm.indices.span': 'traces-apm*,apm-*',
'xpack.apm.indices.onboarding': 'apm-*',
'xpack.apm.indices.sourcemap': 'apm-*',
'elasticsearch.hosts': 'http://localhost:9200',
...loadedKibanaConfig,
...cliEsCredentials,
Expand Down
7 changes: 6 additions & 1 deletion x-pack/plugins/apm/scripts/upload-telemetry-data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ async function uploadData() {
collectTelemetryParams: {
logger: console as unknown as Logger,
indices: {
...config,
transaction: config['xpack.apm.indices.transaction'],
metric: config['xpack.apm.indices.metric'],
error: config['xpack.apm.indices.error'],
span: config['xpack.apm.indices.span'],
onboarding: config['xpack.apm.indices.onboarding'],
sourcemap: config['xpack.apm.indices.sourcemap'],
apmCustomLinkIndex: '.apm-custom-links',
apmAgentConfigurationIndex: '.apm-agent-configuration',
},
Expand Down
Loading

0 comments on commit 61dc25d

Please sign in to comment.