diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 7f2a8e986b5d4..50ba18f93b687 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -21547,10 +21547,6 @@
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.indexClosedCallout.calloutDetails.reindexingTakesLongerEmphasis": "再インデックスには通常よりも時間がかかることがあります",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.indexClosedCallout.calloutTitle": "インデックスが閉じました",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.openAndCloseDocumentation": "ドキュメンテーション",
- "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.apmReindexWarningDetail": "バージョン 7.0.0 以降、APM データは Elastic Common Schema で表示されます。過去の APM データは再インデックスされるまで表示されません。",
- "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.apmReindexWarningTitle": "このインデックスは ECS 形式に変換されます",
- "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningDetail": "マッピングタイプは8.xではサポートされていません。このインデックスマッピングはデフォルトのタイプ名、{defaultType}を使用しておらず、再インデックス時に更新されます。アプリケーションコードまたはスクリプトが異なるタイプに依存していないことを確認してください。",
- "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningTitle": "マッピングタイプが{defaultType}に変更されます",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutDetail": "インデックスをバックアップして、互換性を破るそれぞれの変更に同意することで再インデックスしてください。",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutTitle": "このインデックスには元に戻すことのできない破壊的な変更が含まれています",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.documentationLinkLabel": "ドキュメント",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 1eee5f0d2f4dc..179e60b68cbeb 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -21597,10 +21597,6 @@
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.indexClosedCallout.calloutDetails.reindexingTakesLongerEmphasis": "重新索引可能比通常花费更多的时间",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.indexClosedCallout.calloutTitle": "索引已关闭",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.openAndCloseDocumentation": "文档",
- "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.apmReindexWarningDetail": "从版本 7.0.0 开始,将以 Elastic Common Schema 格式表示 APM 数据。只有重新索引历史 APM 数据后,其才可见。",
- "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.apmReindexWarningTitle": "此索引将转换成 ECS 格式",
- "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningDetail": "映射类型在 8.x 中不再受支持。此索引映射不使用默认类型名称 {defaultType},并将在重新索引时更新。确保没有应用程序代码或脚本依赖其他类型。",
- "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningTitle": "映射类型将更改为 {defaultType}",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutDetail": "备份您的索引,然后通过接受每个重大更改来继续重新索引。",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutTitle": "此索引需要无法撤消的破坏性更改",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.documentationLinkLabel": "文档",
diff --git a/x-pack/plugins/upgrade_assistant/common/constants.ts b/x-pack/plugins/upgrade_assistant/common/constants.ts
new file mode 100644
index 0000000000000..d9a056cebcc21
--- /dev/null
+++ b/x-pack/plugins/upgrade_assistant/common/constants.ts
@@ -0,0 +1,15 @@
+/*
+ * 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 SemVer from 'semver/classes/semver';
+
+/*
+ * These constants are used only in tests to add conditional logic based on Kibana version
+ * On master, the version should represent the next major version (e.g., master --> 8.0.0)
+ * The release branch should match the release version (e.g., 7.x --> 7.0.0)
+ */
+export const mockKibanaVersion = '7.0.0';
+export const mockKibanaSemverVersion = new SemVer(mockKibanaVersion);
diff --git a/x-pack/plugins/upgrade_assistant/common/types.ts b/x-pack/plugins/upgrade_assistant/common/types.ts
index 3be01fdb8f7dc..adf0661feb66b 100644
--- a/x-pack/plugins/upgrade_assistant/common/types.ts
+++ b/x-pack/plugins/upgrade_assistant/common/types.ts
@@ -94,8 +94,9 @@ export type ReindexSavedObject = SavedObject;
export enum ReindexWarning {
// 7.0 -> 8.0 warnings
- apmReindex,
customTypeName,
+
+ // 8.0 -> 9.0 warnings
}
export enum IndexGroup {
diff --git a/x-pack/plugins/upgrade_assistant/kibana.json b/x-pack/plugins/upgrade_assistant/kibana.json
index 0a3da4c055b1c..c4c6f23611f2b 100644
--- a/x-pack/plugins/upgrade_assistant/kibana.json
+++ b/x-pack/plugins/upgrade_assistant/kibana.json
@@ -4,6 +4,6 @@
"server": true,
"ui": true,
"configPath": ["xpack", "upgrade_assistant"],
- "requiredPlugins": ["management", "licensing", "apmOss", "features"],
+ "requiredPlugins": ["management", "licensing", "features"],
"optionalPlugins": ["cloud", "usageCollection"]
}
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/tabs.test.tsx
index 8810569027cc8..b732f6806a388 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs.test.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/tabs.test.tsx
@@ -6,9 +6,9 @@
*/
import React from 'react';
-import SemVer from 'semver/classes/semver';
import { mountWithIntl } from '@kbn/test/jest';
import { httpServiceMock } from 'src/core/public/mocks';
+import { mockKibanaSemverVersion } from '../../../common/constants';
import { UpgradeAssistantTabs } from './tabs';
import { LoadingState } from './types';
@@ -18,7 +18,6 @@ import { OverviewTab } from './tabs/overview';
const promisesToResolve = () => new Promise((resolve) => setTimeout(resolve, 0));
const mockHttp = httpServiceMock.createSetupContract();
-const mockKibanaVersion = new SemVer('7.0.0');
jest.mock('../app_context', () => {
return {
@@ -29,9 +28,9 @@ jest.mock('../app_context', () => {
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
},
kibanaVersionInfo: {
- currentMajor: mockKibanaVersion.major,
- prevMajor: mockKibanaVersion.major - 1,
- nextMajor: mockKibanaVersion.major + 1,
+ currentMajor: mockKibanaSemverVersion.major,
+ prevMajor: mockKibanaSemverVersion.major - 1,
+ nextMajor: mockKibanaSemverVersion.major + 1,
},
};
},
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/checkup_tab.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/checkup_tab.test.tsx
index feffd4f7853cd..bf890c856239e 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/checkup_tab.test.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/checkup_tab.test.tsx
@@ -7,7 +7,7 @@
import { shallow } from 'enzyme';
import React from 'react';
-import SemVer from 'semver/classes/semver';
+import { mockKibanaSemverVersion } from '../../../../../common/constants';
import { LoadingState } from '../../types';
import AssistanceData from '../__fixtures__/checkup_api_response.json';
@@ -22,8 +22,6 @@ const defaultProps = {
setSelectedTabIndex: jest.fn(),
};
-const mockKibanaVersion = new SemVer('7.0.0');
-
jest.mock('../../../app_context', () => {
return {
useAppContext: () => {
@@ -33,9 +31,9 @@ jest.mock('../../../app_context', () => {
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
},
kibanaVersionInfo: {
- currentMajor: mockKibanaVersion.major,
- prevMajor: mockKibanaVersion.major - 1,
- nextMajor: mockKibanaVersion.major + 1,
+ currentMajor: mockKibanaSemverVersion.major,
+ prevMajor: mockKibanaSemverVersion.major - 1,
+ nextMajor: mockKibanaSemverVersion.major + 1,
},
};
},
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/cell.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/cell.tsx
index dd69263b1c856..d7487c2744b2b 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/cell.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/cell.tsx
@@ -17,7 +17,6 @@ import {
EuiTitle,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
-import { FixDefaultFieldsButton } from './default_fields/button';
import { ReindexButton } from './reindex';
import { AppContext } from '../../../../app_context';
import { EnrichedDeprecationInfo } from '../../../../../../common/types';
@@ -99,14 +98,6 @@ export const DeprecationCell: FunctionComponent = ({
)}
-
- {needsDefaultFields && (
-
-
- {({ http }) => }
-
-
- )}
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/default_fields/button.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/default_fields/button.tsx
deleted file mode 100644
index 327051c6e6092..0000000000000
--- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/default_fields/button.tsx
+++ /dev/null
@@ -1,133 +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 React, { ReactNode } from 'react';
-import { HttpSetup } from 'src/core/public';
-
-import { EuiButton } from '@elastic/eui';
-import { FormattedMessage } from '@kbn/i18n/react';
-import { LoadingState } from '../../../../types';
-
-/**
- * Field types used by Metricbeat to generate the default_field setting.
- * Matches Beats code here:
- * https://github.com/elastic/beats/blob/eee127cb59b56f2ed7c7e317398c3f79c4158216/libbeat/template/processor.go#L104
- */
-const BEAT_DEFAULT_FIELD_TYPES: ReadonlySet = new Set(['keyword', 'text', 'ip']);
-const BEAT_OTHER_DEFAULT_FIELDS: ReadonlySet = new Set(['fields.*']);
-
-interface FixDefaultFieldsButtonProps {
- http: HttpSetup;
- indexName: string;
-}
-
-interface FixDefaultFieldsButtonState {
- fixLoadingState?: LoadingState;
-}
-
-/**
- * Renders a button if given index is a valid Metricbeat index to add a default_field setting.
- */
-export class FixDefaultFieldsButton extends React.Component<
- FixDefaultFieldsButtonProps,
- FixDefaultFieldsButtonState
-> {
- constructor(props: FixDefaultFieldsButtonProps) {
- super(props);
- this.state = {};
- }
-
- public render() {
- const { fixLoadingState } = this.state;
-
- if (!this.isBeatsIndex()) {
- return null;
- }
-
- const buttonProps: any = { size: 's', onClick: this.fixBeatsIndex };
- let buttonContent: ReactNode;
-
- switch (fixLoadingState) {
- case LoadingState.Loading:
- buttonProps.disabled = true;
- buttonProps.isLoading = true;
- buttonContent = (
-
- );
- break;
- case LoadingState.Success:
- buttonProps.iconSide = 'left';
- buttonProps.iconType = 'check';
- buttonProps.disabled = true;
- buttonContent = (
-
- );
- break;
- case LoadingState.Error:
- buttonProps.color = 'danger';
- buttonProps.iconSide = 'left';
- buttonProps.iconType = 'cross';
- buttonContent = (
-
- );
- break;
- default:
- buttonContent = (
-
- );
- }
-
- return {buttonContent};
- }
-
- private isBeatsIndex = () => {
- const { indexName } = this.props;
- return indexName.startsWith('metricbeat-') || indexName.startsWith('filebeat-');
- };
-
- private fixBeatsIndex = async () => {
- if (!this.isBeatsIndex()) {
- return;
- }
-
- this.setState({
- fixLoadingState: LoadingState.Loading,
- });
-
- try {
- await this.props.http.post(
- `/api/upgrade_assistant/add_query_default_field/${this.props.indexName}`,
- {
- body: JSON.stringify({
- fieldTypes: [...BEAT_DEFAULT_FIELD_TYPES],
- otherFields: [...BEAT_OTHER_DEFAULT_FIELDS],
- }),
- }
- );
-
- this.setState({
- fixLoadingState: LoadingState.Success,
- });
- } catch (e) {
- this.setState({
- fixLoadingState: LoadingState.Error,
- });
- }
- };
-}
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_table.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_table.tsx
index d7925655b556b..79c31ba0b6bb1 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_table.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_table.tsx
@@ -10,7 +10,6 @@ import React from 'react';
import { EuiBasicTable } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import { FixDefaultFieldsButton } from './default_fields/button';
import { ReindexButton } from './reindex';
import { AppContext } from '../../../../app_context';
import { EnrichedDeprecationInfo } from '../../../../../../common/types';
@@ -145,11 +144,11 @@ export class IndexDeprecationTable extends React.Component<
private generateActionsColumn() {
// NOTE: this naive implementation assumes all indices in the table are
- // should show the reindex button. This should work for known usecases.
+ // should show the reindex button. This should work for known use cases.
const { indices } = this.props;
- const showReindexButton = indices.find((i) => i.reindex === true);
- const showNeedsDefaultFieldsButton = indices.find((i) => i.needsDefaultFields === true);
- if (!showReindexButton && !showNeedsDefaultFieldsButton) {
+ const hasActionsColumn = Boolean(indices.find((i) => i.reindex === true));
+
+ if (hasActionsColumn === false) {
return null;
}
@@ -157,28 +156,20 @@ export class IndexDeprecationTable extends React.Component<
actions: [
{
render(indexDep: IndexDeprecationDetails) {
- if (showReindexButton) {
- return (
-
- {({ http, docLinks }) => {
- return (
-
- );
- }}
-
- );
- } else {
- return (
-
- {({ http }) => }
-
- );
- }
+ return (
+
+ {({ http, docLinks }) => {
+ return (
+
+ );
+ }}
+
+ );
},
},
],
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/warning_step.test.tsx.snap b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/warning_step.test.tsx.snap
index 6343bdde9fc32..dba019550f2a1 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/warning_step.test.tsx.snap
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/warning_step.test.tsx.snap
@@ -23,68 +23,6 @@ exports[`WarningsFlyoutStep renders 1`] = `
-
- _doc
- ,
- }
- }
- />
- }
- documentationUrl="https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html"
- label={
-
- _doc
- ,
- }
- }
- />
- }
- onChange={[Function]}
- warning={1}
- />
-
- }
- documentationUrl="https://www.elastic.co/guide/en/observability/master/whats-new.html"
- label={
-
- }
- onChange={[Function]}
- warning={0}
- />
{
status: undefined,
reindexTaskPercComplete: null,
errorMessage: null,
- reindexWarnings: [ReindexWarning.apmReindex],
+ reindexWarnings: [ReindexWarning.customTypeName],
hasRequiredPrivileges: true,
} as ReindexState,
};
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx
index 6ea97479fbf6d..353937d1e1d32 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx
@@ -135,34 +135,6 @@ export const ChecklistFlyoutStep: React.FunctionComponent<{
- {reindexWarnings && reindexWarnings.includes(ReindexWarning.apmReindex) && (
-
-
-
-
-
- ),
- }}
- />
- }
- color="warning"
- iconType="alert"
- />
-
- )}
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warning_step.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warning_step.test.tsx
index 0ebf42df53188..d365cd82ba86c 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warning_step.test.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warning_step.test.tsx
@@ -8,6 +8,7 @@
import { I18nProvider } from '@kbn/i18n/react';
import { mount, shallow } from 'enzyme';
import React from 'react';
+import { mockKibanaSemverVersion } from '../../../../../../../../common/constants';
import { ReindexWarning } from '../../../../../../../../common/types';
import { idForWarning, WarningsFlyoutStep } from './warnings_step';
@@ -20,6 +21,11 @@ jest.mock('../../../../../../app_context', () => {
DOC_LINK_VERSION: 'current',
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
},
+ kibanaVersionInfo: {
+ currentMajor: mockKibanaSemverVersion.major,
+ prevMajor: mockKibanaSemverVersion.major - 1,
+ nextMajor: mockKibanaSemverVersion.major + 1,
+ },
};
},
};
@@ -28,7 +34,7 @@ jest.mock('../../../../../../app_context', () => {
describe('WarningsFlyoutStep', () => {
const defaultProps = {
advanceNextStep: jest.fn(),
- warnings: [ReindexWarning.customTypeName, ReindexWarning.apmReindex],
+ warnings: [ReindexWarning.customTypeName],
closeFlyout: jest.fn(),
renderGlobalCallouts: jest.fn(),
};
@@ -37,23 +43,21 @@ describe('WarningsFlyoutStep', () => {
expect(shallow()).toMatchSnapshot();
});
- it('does not allow proceeding until all are checked', () => {
- const wrapper = mount(
-
-
-
- );
- const button = wrapper.find('EuiButton');
-
- button.simulate('click');
- expect(defaultProps.advanceNextStep).not.toHaveBeenCalled();
-
- wrapper.find(`input#${idForWarning(ReindexWarning.apmReindex)}`).simulate('change');
- button.simulate('click');
- expect(defaultProps.advanceNextStep).not.toHaveBeenCalled();
-
- wrapper.find(`input#${idForWarning(ReindexWarning.customTypeName)}`).simulate('change');
- button.simulate('click');
- expect(defaultProps.advanceNextStep).toHaveBeenCalled();
- });
+ if (mockKibanaSemverVersion.major === 7) {
+ it('does not allow proceeding until all are checked', () => {
+ const wrapper = mount(
+
+
+
+ );
+ const button = wrapper.find('EuiButton');
+
+ button.simulate('click');
+ expect(defaultProps.advanceNextStep).not.toHaveBeenCalled();
+
+ wrapper.find(`input#${idForWarning(ReindexWarning.customTypeName)}`).simulate('change');
+ button.simulate('click');
+ expect(defaultProps.advanceNextStep).toHaveBeenCalled();
+ });
+ }
});
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warnings_step.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warnings_step.tsx
index ebcd97255538c..fe29941f801cc 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warnings_step.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warnings_step.tsx
@@ -101,10 +101,9 @@ export const WarningsFlyoutStep: React.FunctionComponent
@@ -130,7 +129,7 @@ export const WarningsFlyoutStep: React.FunctionComponent
- {warnings.includes(ReindexWarning.customTypeName) && (
+ {kibanaVersionInfo.currentMajor === 7 && warnings.includes(ReindexWarning.customTypeName) && (
_doc,
}}
@@ -158,28 +156,6 @@ export const WarningsFlyoutStep: React.FunctionComponent
)}
-
- {warnings.includes(ReindexWarning.apmReindex) && (
-
- }
- description={
-
- }
- documentationUrl={`${observabilityDocBasePath}/master/whats-new.html`}
- />
- )}
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/__fixtures__/version.ts b/x-pack/plugins/upgrade_assistant/server/lib/__fixtures__/version.ts
index 6caad4f5050fc..d93fe7920f1d7 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/__fixtures__/version.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/__fixtures__/version.ts
@@ -5,16 +5,13 @@
* 2.0.
*/
-import { SemVer } from 'semver';
+import { mockKibanaSemverVersion } from '../../../common/constants';
-export const MOCK_VERSION_STRING = '8.0.0';
-
-export const getMockVersionInfo = (versionString = MOCK_VERSION_STRING) => {
- const currentVersion = new SemVer(versionString);
- const currentMajor = currentVersion.major;
+export const getMockVersionInfo = () => {
+ const currentMajor = mockKibanaSemverVersion.major;
return {
- currentVersion,
+ currentVersion: mockKibanaSemverVersion,
currentMajor,
prevMajor: currentMajor - 1,
nextMajor: currentMajor + 1,
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/apm/extract_index_patterns.ts b/x-pack/plugins/upgrade_assistant/server/lib/apm/extract_index_patterns.ts
deleted file mode 100644
index 163373bd7f419..0000000000000
--- a/x-pack/plugins/upgrade_assistant/server/lib/apm/extract_index_patterns.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { uniq, pick } from 'lodash';
-import { APMOSSConfig } from '../../../../../../src/plugins/apm_oss/server';
-
-export const extractIndexPatterns = (apmConfig: APMOSSConfig): string[] => {
- const indexConfigs = pick(apmConfig, [
- 'sourcemapIndices',
- 'errorIndices',
- 'transactionIndices',
- 'spanIndices',
- 'metricsIndices',
- 'onboardingIndices',
- ]);
-
- return uniq(Object.values(indexConfigs));
-};
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/apm/index.test.ts b/x-pack/plugins/upgrade_assistant/server/lib/apm/index.test.ts
deleted file mode 100644
index 74d36140175ff..0000000000000
--- a/x-pack/plugins/upgrade_assistant/server/lib/apm/index.test.ts
+++ /dev/null
@@ -1,136 +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 { RequestEvent } from '@elastic/elasticsearch/lib/Transport';
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import { ScopedClusterClientMock } from 'src/core/server/elasticsearch/client/mocks';
-import { elasticsearchServiceMock } from 'src/core/server/mocks';
-import { getDeprecatedApmIndices, isLegacyApmIndex } from './index';
-
-describe('getDeprecatedApmIndices', () => {
- let clusterClient: ScopedClusterClientMock;
-
- const asApiResponse = (body: T): RequestEvent =>
- ({
- body,
- } as RequestEvent);
-
- beforeEach(() => {
- clusterClient = elasticsearchServiceMock.createScopedClusterClient();
-
- clusterClient.asCurrentUser.indices.getMapping.mockResolvedValueOnce(
- asApiResponse({
- 'foo-1': {
- mappings: {},
- },
- 'foo-2': {
- mappings: {
- _meta: {
- version: '6.7.0',
- },
- },
- },
- 'foo-3': {
- mappings: {
- _meta: {
- version: '7.0.0',
- },
- },
- },
- 'foo-4': {
- mappings: {
- _meta: {
- version: '7.1.0',
- },
- },
- },
- })
- );
- });
-
- it('calls indices.getMapping', async () => {
- await getDeprecatedApmIndices(clusterClient, ['foo-*', 'bar-*']);
-
- expect(clusterClient.asCurrentUser.indices.getMapping).toHaveBeenCalledWith({
- index: 'foo-*,bar-*',
- filter_path: '*.mappings._meta.version,*.mappings.properties.@timestamp',
- });
- });
-
- it('includes mappings not yet at 7.0.0', async () => {
- const deprecations = await getDeprecatedApmIndices(clusterClient, ['foo-*']);
-
- expect(deprecations).toHaveLength(2);
- expect(deprecations[0].index).toEqual('foo-1');
- expect(deprecations[1].index).toEqual('foo-2');
- });
-
- it('formats the deprecations', async () => {
- // @ts-ignore
- const [deprecation, _] = await getDeprecatedApmIndices(clusterClient, ['foo-*']);
-
- expect(deprecation.level).toEqual('warning');
- expect(deprecation.message).toEqual('APM index requires conversion to 7.x format');
- expect(deprecation.url).toEqual(
- 'https://www.elastic.co/guide/en/apm/get-started/master/apm-release-notes.html'
- );
- expect(deprecation.details).toEqual('This index was created prior to 7.0');
- expect(deprecation.reindex).toBe(true);
- });
-});
-
-describe('isLegacyApmIndex', () => {
- it('is true when for no version', () => {
- expect(isLegacyApmIndex('foo-1', ['foo-*'], {})).toEqual(true);
- });
-
- it('is true when version is less than 7.0.0', () => {
- expect(
- isLegacyApmIndex('foo-1', ['foo-*'], {
- _meta: { version: '6.7.0' },
- })
- ).toEqual(true);
- });
-
- it('is false when version is 7.0.0', () => {
- expect(
- isLegacyApmIndex('foo-1', ['foo-*'], {
- _meta: { version: '7.0.0' },
- })
- ).toEqual(false);
- });
-
- it('is false when version is greater than 7.0.0', () => {
- expect(
- isLegacyApmIndex('foo-1', ['foo-*'], {
- _meta: { version: '7.1.0' },
- })
- ).toEqual(false);
- });
-
- it('is false when using a version qualifier', () => {
- expect(
- isLegacyApmIndex('foo-1', ['foo-*'], {
- _meta: { version: '7.0.0-rc1' },
- })
- ).toEqual(false);
- });
-
- it('handles multiple index patterns', () => {
- expect(
- isLegacyApmIndex('bar-1', ['foo-*', 'bar-*'], {
- _meta: { version: '6.7.0' },
- })
- ).toEqual(true);
-
- expect(
- isLegacyApmIndex('bar-1', ['foo-*', 'bar-*'], {
- _meta: { version: '7.0.0' },
- })
- ).toEqual(false);
- });
-});
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/apm/index.ts b/x-pack/plugins/upgrade_assistant/server/lib/apm/index.ts
deleted file mode 100644
index 8c689df78e555..0000000000000
--- a/x-pack/plugins/upgrade_assistant/server/lib/apm/index.ts
+++ /dev/null
@@ -1,493 +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 { get } from 'lodash';
-import minimatch from 'minimatch';
-import { SemVer, valid } from 'semver';
-import { IScopedClusterClient } from 'src/core/server';
-
-import { EnrichedDeprecationInfo } from '../../../common/types';
-import { FlatSettings } from '../reindexing/types';
-
-export async function getDeprecatedApmIndices(
- clusterClient: IScopedClusterClient,
- indexPatterns: string[] = []
-): Promise {
- const { body: indices } = await clusterClient.asCurrentUser.indices.getMapping({
- index: indexPatterns.join(','),
- // we include @timestamp to prevent filtering mappings without a version
- // since @timestamp is expected to always exist
- filter_path: '*.mappings._meta.version,*.mappings.properties.@timestamp',
- });
-
- return Object.keys(indices).reduce((deprecations: EnrichedDeprecationInfo[], index) => {
- if (isLegacyApmIndex(index, indexPatterns, indices[index].mappings)) {
- deprecations.push({
- level: 'warning',
- message: 'APM index requires conversion to 7.x format',
- url: 'https://www.elastic.co/guide/en/apm/get-started/master/apm-release-notes.html',
- details: 'This index was created prior to 7.0',
- reindex: true,
- index,
- });
- }
-
- return deprecations;
- }, []);
-}
-
-export const isLegacyApmIndex = (
- indexName: string,
- apmIndexPatterns: string[] = [],
- mappings: FlatSettings['mappings']
-) => {
- const defaultValue = '0.0.0';
- const version = get(mappings, '_meta.version', defaultValue);
- const clientVersion = new SemVer(valid(version) ? version : defaultValue);
-
- if (clientVersion.compareMain('7.0.0') > -1) {
- return false;
- }
-
- const find = apmIndexPatterns.find((pattern) => {
- return minimatch(indexName, pattern);
- });
-
- return Boolean(find);
-};
-
-// source: https://github.com/elastic/apm-integration-testing/blob/master/tests/server/test_upgrade.py
-export const apmReindexScript = `
- // add ecs version
- ctx._source.ecs = ['version': '1.1.0-dev'];
-
- // set processor.event
- if (ctx._source.processor == null) {
- // onboarding docs had no processor pre-6.4 - https://github.com/elastic/kibana/issues/52655
- ctx._source.processor = ["event": "onboarding"];
- }
-
- // beat -> observer
- def beat = ctx._source.remove("beat");
- if (beat != null) {
- beat.remove("name");
- ctx._source.observer = beat;
- ctx._source.observer.type = "apm-server";
- }
-
- if (! ctx._source.containsKey("observer")) {
- ctx._source.observer = new HashMap();
- }
-
- // observer.major_version
- ctx._source.observer.version_major = 7;
-
- def listening = ctx._source.remove("listening");
- if (listening != null) {
- ctx._source.observer.listening = listening;
- }
-
- // remove host[.name]
- // clarify if we can simply delete this or it will be set somewhere else in 7.0
- ctx._source.remove("host");
-
- // docker.container -> container
- def docker = ctx._source.remove("docker");
- if (docker != null && docker.containsKey("container")) {
- ctx._source.container = docker.container;
- }
-
- // rip up context
- HashMap context = ctx._source.remove("context");
- if (context != null) {
- // context.process -> process
- def process = context.remove("process");
- if (process != null) {
- def args = process.remove("argv");
- if (args != null) {
- process.args = args;
- }
- ctx._source.process = process;
- }
-
- // context.response -> http.response
- HashMap resp = context.remove("response");
- if (resp != null) {
- if (! ctx._source.containsKey("http")) {
- ctx._source.http = new HashMap();
- }
- ctx._source.http.response = resp;
- }
-
- // context.request -> http & url
- HashMap request = context.remove("request");
- if (request != null) {
- if (! ctx._source.containsKey("http")) {
- ctx._source.http = new HashMap();
- }
-
- // context.request.http_version -> http.version
- def http_version = request.remove("http_version");
- if (http_version != null) {
- ctx._source.http.version = http_version;
- }
-
- if (request.containsKey("headers")) {
- // copy user-agent header
- def ua;
- for (entry in request["headers"].entrySet()) {
- if (entry.getKey().toLowerCase() == "user-agent") {
- ua = entry.getValue();
- }
- }
- if (ua != null) {
- ctx._source.user_agent = new HashMap();
- // setting original and original.text is not possible in painless
- // as original is a keyword in ES template we cannot set it to a HashMap here,
- // so the following is the only possible solution:
- ctx._source.user_agent.original = ua.substring(0, Integer.min(1024, ua.length()));
- }
- }
-
- // context.request.socket -> request.socket
- def socket = request.remove("socket");
- if (socket != null) {
- def add_socket = false;
- def new_socket = new HashMap();
- def remote_address = socket.remove("remote_address");
- if (remote_address != null) {
- add_socket = true;
- new_socket.remote_address = remote_address;
- }
- def encrypted = socket.remove("encrypted");
- if (encrypted != null) {
- add_socket = true;
- new_socket.encrypted = encrypted;
- }
- if (add_socket) {
- request.socket = new_socket;
- }
- }
-
- // context.request.url -> url
- HashMap url = request.remove("url");
- def fragment = url.remove("hash");
- if (fragment != null) {
- url.fragment = fragment;
- }
- def domain = url.remove("hostname");
- if (domain != null) {
- url.domain = domain;
- }
- def path = url.remove("pathname");
- if (path != null) {
- url.path = path;
- }
- def scheme = url.remove("protocol");
- if (scheme != null) {
- def end = scheme.lastIndexOf(":");
- if (end > -1) {
- scheme = scheme.substring(0, end);
- }
- url.scheme = scheme
- }
- def original = url.remove("raw");
- if (original != null) {
- url.original = original;
- }
- def port = url.remove("port");
- if (port != null) {
- try {
- int portNum = Integer.parseInt(port);
- url.port = portNum;
- } catch (Exception e) {
- // toss port
- }
- }
- def query = url.remove("search");
- if (query != null) {
- url.query = query;
- }
- ctx._source.url = url;
-
- // restore what is left of request, under http
-
- def body = request.remove("body");
-
- ctx._source.http.request = request;
- ctx._source.http.request.method = ctx._source.http.request.method?.toLowerCase();
-
- // context.request.body -> http.request.body.original
- if (body != null) {
- ctx._source.http.request.body = new HashMap();
- ctx._source.http.request.body.original = body;
- }
- }
-
- // bump timestamp.us by span.start.us for spans
- // shouldn't @timestamp this already be a Date?
- if (ctx._source.processor.event == "span" && context.service.agent.name == "js-base"){
- def ts = ctx._source.get("@timestamp");
- if (ts != null && !ctx._source.containsKey("timestamp") && ctx._source.span.start.containsKey("us")) {
- // add span.start to @timestamp for rum documents v1
- ctx._source.timestamp = new HashMap();
- def tsms = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(ts).getTime();
- ctx._source['@timestamp'] = Instant.ofEpochMilli(tsms + (ctx._source.span.start.us/1000));
- ctx._source.timestamp.us = (tsms*1000) + ctx._source.span.start.us;
- }
- }
-
- // context.service.agent -> agent
- HashMap service = context.remove("service");
- ctx._source.agent = service.remove("agent");
-
- // context.service -> service
- ctx._source.service = service;
-
- // context.system -> host
- def system = context.remove("system");
- if (system != null) {
- system.os = new HashMap();
- system.os.platform = system.remove("platform");
- ctx._source.host = system;
- }
-
- // context.tags -> labels
- def tags = context.remove("tags");
- if (tags != null) {
- ctx._source.labels = tags;
- }
-
- // context.user -> user & user_agent
- if (context.containsKey("user")) {
- HashMap user = context.remove("user");
- // user.username -> user.name
- def username = user.remove("username");
- if (username != null) {
- user.name = username;
- }
-
- // context.user.ip -> client.ip
- def userip = user.remove("ip");
- if (userip != null) {
- ctx._source.client = new HashMap();
- ctx._source.client.ip = userip;
- }
-
- // move user-agent info
- // this will overwrite the value from http.request.headers if set
- def ua = user.remove("user-agent");
- if (ua != null) {
- ctx._source.user_agent = new HashMap();
- // setting original and original.text is not possible in painless
- // as original is a keyword in ES template we cannot set it to a HashMap here,
- // so the following is the only possible solution:
- ctx._source.user_agent.original = ua.substring(0, Integer.min(1024, ua.length()));
- }
-
- def pua = user.remove("user_agent");
- if (pua != null) {
- if (ctx._source.user_agent == null){
- ctx._source.user_agent = new HashMap();
- }
- def os = pua.remove("os");
- def osminor = pua.remove("os_minor");
- def osmajor = pua.remove("os_major");
- def osname = pua.remove("os_name");
-
- def newos = new HashMap();
- if (os != null){
- newos.full = os;
- }
- if (osmajor != null || osminor != null){
- newos.version = osmajor + "." + osminor;
- }
- if (osname != null){
- newos.name = osname;
- }
- ctx._source.user_agent.os = newos;
-
- def device = pua.remove("device");
- if (device != null){
- ctx._source.user_agent.device = new HashMap();
- ctx._source.user_agent.device.name = device;
- }
- // not exactly reflecting 7.0, but the closes we can get
- def major = pua.remove("major");
- if (major != null){
- def version = major;
- def minor = pua.remove("minor");
- if (minor != null){
- version += "." + minor;
- def patch = pua.remove("patch");
- if (patch != null){
- version += "." + patch
- }
- }
- ctx._source.user_agent.version = version;
- }
- }
-
- // remove unknown fields from user, like is_authenticated
- def add_user = false;
- def new_user = new HashMap();
- def email = user.remove("email");
- if (email != null) {
- add_user = true;
- new_user.email = email;
- }
- def id = user.remove("id");
- if (id != null) {
- add_user = true;
- new_user.id = String.valueOf(id);
- }
- def name = user.remove("name");
- if (name != null) {
- add_user = true;
- new_user.name = name;
- }
- if (add_user) {
- ctx._source.user = new_user;
- }
- }
-
- // context.custom -> error,transaction,span.custom
- def custom = context.remove("custom");
- if (custom != null) {
- if (ctx._source.processor.event == "span") {
- ctx._source.span.custom = custom;
- } else if (ctx._source.processor.event == "transaction") {
- ctx._source.transaction.custom = custom;
- } else if (ctx._source.processor.event == "error") {
- ctx._source.error.custom = custom;
- }
- }
-
- // context.page -> error.page,transaction.page
- def page = context.remove("page");
- if (page != null) {
- if (ctx._source.processor.event == "transaction") {
- ctx._source.transaction.page = page;
- } else if (ctx._source.processor.event == "error") {
- ctx._source.error.page = page;
- }
- }
-
- // context.db -> span.db
- def db = context.remove("db");
- if (db != null) {
- def db_user = db.remove("user");
- if (db_user != null) {
- db.user = ["name": db_user];
- }
- ctx._source.span.db = db;
- }
-
- // context.http -> span.http
- def http = context.remove("http");
- if (http != null) {
- // context.http.url -> span.http.url.original
- def url = http.remove("url");
- if (url != null) {
- http.url = ["original": url];
- }
- // context.http.status_code -> span.http.response.status_code
- def status_code = http.remove("status_code");
- if (status_code != null) {
- http.response = ["status_code": status_code];
- }
- // lowercase span.http.method
- if (http.containsKey("method")) {
- http.method = http.method.toLowerCase();
- }
- ctx._source.span.http = http;
- }
- }
-
- // per https://github.com/elastic/apm/issues/21
- // if kubernetes.node.name is set, copy it to host.hostname
- // else if other kubernetes.* is set, remove host.hostname
- // else leave it alone
- // relies on system.hostname -> host.hostname already happening earlier in this script
- if (ctx._source.kubernetes?.node?.name != null) {
- if (! ctx._source.containsKey("host")) {
- ctx._source.host = new HashMap();
- }
- ctx._source.host.hostname = ctx._source.kubernetes.node.name;
- } else if (ctx._source.containsKey("kubernetes")) {
- if (ctx._source.host?.hostname != null) {
- ctx._source.host.remove("hostname");
- }
- }
-
- if (ctx._source.processor.event == "span") {
- def hex_id = ctx._source.span.remove("hex_id");
- def span_id = ctx._source.span.remove("id");
- if (hex_id != null) {
- ctx._source.span.id = hex_id;
- } else if (span_id != null){
- ctx._source.span.id = span_id.toString();
- }
- def parent = ctx._source.span.remove("parent");
- def tr_id = ctx._source.transaction.get("id");
- if (ctx._source.parent == null) {
- if (parent != null) {
- ctx._source.parent = ["id": parent.toString()];
- } else if (tr_id != null) {
- // 7.x UI requires a value for parent.id - https://github.com/elastic/kibana/issues/52763
- ctx._source.parent = ["id": tr_id];
- }
- }
- }
-
- // create trace.id
- if (ctx._source.processor.event == "transaction" || ctx._source.processor.event == "span" || ctx._source.processor.event == "error") {
- if (ctx._source.containsKey("transaction")) {
- def tr_id = ctx._source.transaction.get("id");
- if (ctx._source.trace == null && tr_id != null) {
- // create a trace id from the transaction.id
- // v1 transaction.id was a UUID, should have 122 random bits or so
- ctx._source.trace = new HashMap();
- ctx._source.trace.id = tr_id.replace("-", "");
- }
- }
-
- // create timestamp.us from @timestamp
- def ts = ctx._source.get("@timestamp");
- if (ts != null && !ctx._source.containsKey("timestamp")) {
- //set timestamp.microseconds to @timestamp
- ctx._source.timestamp = new HashMap();
- ctx._source.timestamp.us = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(ts).getTime()*1000;
- }
-
- }
-
- // transaction.span_count.dropped.total -> transaction.span_count.dropped
- if (ctx._source.processor.event == "transaction") {
- // transaction.span_count.dropped.total -> transaction.span_count.dropped
- if (ctx._source.transaction.containsKey("span_count")) {
- def dropped = ctx._source.transaction.span_count.remove("dropped");
- if (dropped != null) {
- ctx._source.transaction.span_count.dropped = dropped.total;
- }
- }
- }
-
- if (ctx._source.processor.event == "error") {
- // culprit is now a keyword, so trim it down to 1024 chars
- def culprit = ctx._source.error.remove("culprit");
- if (culprit != null) {
- ctx._source.error.culprit = culprit.substring(0, Integer.min(1024, culprit.length()));
- }
-
- // error.exception is now a list (exception chain)
- def exception = ctx._source.error.remove("exception");
- if (exception != null) {
- ctx._source.error.exception = [exception];
- }
- }
-`;
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/apm/mapping.json b/x-pack/plugins/upgrade_assistant/server/lib/apm/mapping.json
deleted file mode 100644
index f518b824f1108..0000000000000
--- a/x-pack/plugins/upgrade_assistant/server/lib/apm/mapping.json
+++ /dev/null
@@ -1,1598 +0,0 @@
-{
- "_meta": {
- "beat": "apm",
- "version": "7.0.0"
- },
- "date_detection": false,
- "dynamic_templates": [
- {
- "container.labels": {
- "mapping": {
- "type": "keyword"
- },
- "match_mapping_type": "string",
- "path_match": "container.labels.*"
- }
- },
- {
- "fields": {
- "mapping": {
- "type": "keyword"
- },
- "match_mapping_type": "string",
- "path_match": "fields.*"
- }
- },
- {
- "docker.container.labels": {
- "mapping": {
- "type": "keyword"
- },
- "match_mapping_type": "string",
- "path_match": "docker.container.labels.*"
- }
- },
- {
- "labels": {
- "mapping": {
- "type": "keyword"
- },
- "match_mapping_type": "string",
- "path_match": "labels.*"
- }
- },
- {
- "labels": {
- "mapping": {
- "type": "boolean"
- },
- "match_mapping_type": "boolean",
- "path_match": "labels.*"
- }
- },
- {
- "labels": {
- "mapping": {
- "scaling_factor": 1000000,
- "type": "scaled_float"
- },
- "match_mapping_type": "*",
- "path_match": "labels.*"
- }
- },
- {
- "transaction.marks": {
- "mapping": {
- "type": "keyword"
- },
- "match_mapping_type": "string",
- "path_match": "transaction.marks.*"
- }
- },
- {
- "transaction.marks.*.*": {
- "mapping": {
- "scaling_factor": 1000000,
- "type": "scaled_float"
- },
- "match_mapping_type": "*",
- "path_match": "transaction.marks.*.*"
- }
- },
- {
- "strings_as_keyword": {
- "mapping": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "match_mapping_type": "string"
- }
- }
- ],
- "properties": {
- "@timestamp": {
- "type": "date"
- },
- "agent": {
- "dynamic": false,
- "properties": {
- "ephemeral_id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "hostname": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "type": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "client": {
- "dynamic": false,
- "properties": {
- "address": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "bytes": {
- "type": "long"
- },
- "domain": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "geo": {
- "properties": {
- "city_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "continent_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "country_iso_code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "country_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "location": {
- "type": "geo_point"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region_iso_code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region_name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "ip": {
- "type": "ip"
- },
- "mac": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "packets": {
- "type": "long"
- },
- "port": {
- "type": "long"
- }
- }
- },
- "cloud": {
- "properties": {
- "account": {
- "properties": {
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "availability_zone": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "instance": {
- "properties": {
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "machine": {
- "properties": {
- "type": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "project": {
- "properties": {
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "provider": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "container": {
- "dynamic": false,
- "properties": {
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "image": {
- "properties": {
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "tag": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "labels": {
- "type": "object"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "runtime": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "destination": {
- "properties": {
- "address": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "bytes": {
- "type": "long"
- },
- "domain": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "geo": {
- "properties": {
- "city_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "continent_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "country_iso_code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "country_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "location": {
- "type": "geo_point"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region_iso_code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region_name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "ip": {
- "type": "ip"
- },
- "mac": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "packets": {
- "type": "long"
- },
- "port": {
- "type": "long"
- }
- }
- },
- "docker": {
- "properties": {
- "container": {
- "properties": {
- "labels": {
- "type": "object"
- }
- }
- }
- }
- },
- "ecs": {
- "properties": {
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "error": {
- "dynamic": false,
- "properties": {
- "code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "culprit": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "exception": {
- "properties": {
- "code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "handled": {
- "type": "boolean"
- },
- "message": {
- "norms": false,
- "type": "text"
- },
- "module": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "type": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "grouping_key": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "log": {
- "properties": {
- "level": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "logger_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "message": {
- "norms": false,
- "type": "text"
- },
- "param_message": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "message": {
- "norms": false,
- "type": "text"
- },
- "type": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "event": {
- "properties": {
- "action": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "category": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "created": {
- "type": "date"
- },
- "dataset": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "duration": {
- "type": "long"
- },
- "end": {
- "type": "date"
- },
- "hash": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "kind": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "module": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "original": {
- "doc_values": false,
- "ignore_above": 1024,
- "index": false,
- "type": "keyword"
- },
- "outcome": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "risk_score": {
- "type": "float"
- },
- "risk_score_norm": {
- "type": "float"
- },
- "severity": {
- "type": "long"
- },
- "start": {
- "type": "date"
- },
- "timezone": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "type": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "fields": {
- "type": "object"
- },
- "file": {
- "properties": {
- "ctime": {
- "type": "date"
- },
- "device": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "extension": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "gid": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "group": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "inode": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "mode": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "mtime": {
- "type": "date"
- },
- "owner": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "path": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "size": {
- "type": "long"
- },
- "target_path": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "type": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "uid": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "group": {
- "properties": {
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "host": {
- "dynamic": false,
- "properties": {
- "architecture": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "geo": {
- "properties": {
- "city_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "continent_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "country_iso_code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "country_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "location": {
- "type": "geo_point"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region_iso_code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region_name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "hostname": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "ip": {
- "type": "ip"
- },
- "mac": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "os": {
- "properties": {
- "family": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "full": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "kernel": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "platform": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "type": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "http": {
- "dynamic": false,
- "properties": {
- "request": {
- "properties": {
- "body": {
- "properties": {
- "bytes": {
- "type": "long"
- },
- "content": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "bytes": {
- "type": "long"
- },
- "method": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "referrer": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "response": {
- "properties": {
- "body": {
- "properties": {
- "bytes": {
- "type": "long"
- },
- "content": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "bytes": {
- "type": "long"
- },
- "finished": {
- "type": "boolean"
- },
- "status_code": {
- "type": "long"
- }
- }
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "kubernetes": {
- "dynamic": false,
- "properties": {
- "annotations": {
- "type": "object"
- },
- "container": {
- "properties": {
- "image": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "labels": {
- "type": "object"
- },
- "namespace": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "node": {
- "properties": {
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "pod": {
- "properties": {
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "uid": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- }
- }
- },
- "labels": {
- "dynamic": true,
- "type": "object"
- },
- "log": {
- "properties": {
- "level": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "original": {
- "doc_values": false,
- "ignore_above": 1024,
- "index": false,
- "type": "keyword"
- }
- }
- },
- "message": {
- "norms": false,
- "type": "text"
- },
- "network": {
- "properties": {
- "application": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "bytes": {
- "type": "long"
- },
- "community_id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "direction": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "forwarded_ip": {
- "type": "ip"
- },
- "iana_number": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "packets": {
- "type": "long"
- },
- "protocol": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "transport": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "type": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "observer": {
- "dynamic": false,
- "properties": {
- "geo": {
- "properties": {
- "city_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "continent_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "country_iso_code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "country_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "location": {
- "type": "geo_point"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region_iso_code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region_name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "hostname": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "ip": {
- "type": "ip"
- },
- "listening": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "mac": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "os": {
- "properties": {
- "family": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "full": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "kernel": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "platform": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "serial_number": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "type": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "vendor": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "version_major": {
- "type": "byte"
- }
- }
- },
- "organization": {
- "properties": {
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "os": {
- "properties": {
- "family": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "full": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "kernel": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "platform": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "parent": {
- "dynamic": false,
- "properties": {
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "process": {
- "dynamic": false,
- "properties": {
- "args": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "executable": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "pid": {
- "type": "long"
- },
- "ppid": {
- "type": "long"
- },
- "start": {
- "type": "date"
- },
- "thread": {
- "properties": {
- "id": {
- "type": "long"
- }
- }
- },
- "title": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "working_directory": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "processor": {
- "properties": {
- "event": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "related": {
- "properties": {
- "ip": {
- "type": "ip"
- }
- }
- },
- "server": {
- "properties": {
- "address": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "bytes": {
- "type": "long"
- },
- "domain": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "geo": {
- "properties": {
- "city_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "continent_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "country_iso_code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "country_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "location": {
- "type": "geo_point"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region_iso_code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region_name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "ip": {
- "type": "ip"
- },
- "mac": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "packets": {
- "type": "long"
- },
- "port": {
- "type": "long"
- }
- }
- },
- "service": {
- "dynamic": false,
- "properties": {
- "environment": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "ephemeral_id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "framework": {
- "properties": {
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "language": {
- "properties": {
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "runtime": {
- "properties": {
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "state": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "type": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "source": {
- "properties": {
- "address": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "bytes": {
- "type": "long"
- },
- "domain": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "geo": {
- "properties": {
- "city_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "continent_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "country_iso_code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "country_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "location": {
- "type": "geo_point"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region_iso_code": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "region_name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "ip": {
- "type": "ip"
- },
- "mac": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "packets": {
- "type": "long"
- },
- "port": {
- "type": "long"
- }
- }
- },
- "sourcemap": {
- "dynamic": false,
- "properties": {
- "bundle_filepath": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "service": {
- "properties": {
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- }
- }
- },
- "span": {
- "dynamic": false,
- "properties": {
- "action": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "duration": {
- "properties": {
- "us": {
- "type": "long"
- }
- }
- },
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "start": {
- "properties": {
- "us": {
- "type": "long"
- }
- }
- },
- "subtype": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "sync": {
- "type": "boolean"
- },
- "type": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "system": {
- "properties": {
- "cpu": {
- "properties": {
- "total": {
- "properties": {
- "norm": {
- "properties": {
- "pct": {
- "scaling_factor": 1000,
- "type": "scaled_float"
- }
- }
- }
- }
- }
- }
- },
- "memory": {
- "properties": {
- "actual": {
- "properties": {
- "free": {
- "type": "long"
- }
- }
- },
- "total": {
- "type": "long"
- }
- }
- },
- "process": {
- "properties": {
- "cpu": {
- "properties": {
- "total": {
- "properties": {
- "norm": {
- "properties": {
- "pct": {
- "scaling_factor": 1000,
- "type": "scaled_float"
- }
- }
- }
- }
- }
- }
- },
- "memory": {
- "properties": {
- "rss": {
- "properties": {
- "bytes": {
- "type": "long"
- }
- }
- },
- "size": {
- "type": "long"
- }
- }
- }
- }
- }
- }
- },
- "tags": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "timestamp": {
- "properties": {
- "us": {
- "type": "long"
- }
- }
- },
- "trace": {
- "dynamic": false,
- "properties": {
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "transaction": {
- "dynamic": false,
- "properties": {
- "duration": {
- "properties": {
- "us": {
- "type": "long"
- }
- }
- },
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "marks": {
- "dynamic": true,
- "properties": {
- "*": {
- "properties": {
- "*": {
- "dynamic": true,
- "type": "object"
- }
- }
- }
- },
- "type": "object"
- },
- "name": {
- "fields": {
- "text": {
- "norms": false,
- "type": "text"
- }
- },
- "ignore_above": 1024,
- "type": "keyword"
- },
- "result": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "sampled": {
- "type": "boolean"
- },
- "span_count": {
- "properties": {
- "dropped": {
- "type": "long"
- }
- }
- },
- "type": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "url": {
- "dynamic": false,
- "properties": {
- "domain": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "fragment": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "full": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "original": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "password": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "path": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "port": {
- "type": "long"
- },
- "query": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "scheme": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "username": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "user": {
- "dynamic": false,
- "properties": {
- "email": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "full_name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "group": {
- "properties": {
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "hash": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "id": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "user_agent": {
- "dynamic": false,
- "properties": {
- "device": {
- "properties": {
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "original": {
- "fields": {
- "text": {
- "norms": false,
- "type": "text"
- }
- },
- "ignore_above": 1024,
- "type": "keyword"
- },
- "os": {
- "properties": {
- "family": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "full": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "kernel": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "name": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "platform": {
- "ignore_above": 1024,
- "type": "keyword"
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "version": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
- },
- "view spans": {
- "ignore_above": 1024,
- "type": "keyword"
- }
- }
-}
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/es_migration_apis.ts b/x-pack/plugins/upgrade_assistant/server/lib/es_migration_apis.ts
index 4985cad8bd750..aeee9a925ed70 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/es_migration_apis.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/es_migration_apis.ts
@@ -12,7 +12,6 @@ import {
UpgradeAssistantStatus,
} from '../../common/types';
-import { getDeprecatedApmIndices } from './apm';
import { isSystemIndex } from './reindexing';
import { esIndicesStateCheck } from './es_indices_state_check';
@@ -20,15 +19,13 @@ import { esIndicesStateCheck } from './es_indices_state_check';
export async function getUpgradeAssistantStatus(
dataClient: IScopedClusterClient,
isCloudEnabled: boolean,
- apmIndices: string[]
): Promise {
- const [{ body: deprecations }, apmIndexDeprecations] = await Promise.all([
+ const [{ body: deprecations }] = await Promise.all([
dataClient.asCurrentUser.migration.deprecations(),
- getDeprecatedApmIndices(dataClient, apmIndices),
]);
const cluster = getClusterDeprecations(deprecations, isCloudEnabled);
- const indices = getCombinedIndexInfos(deprecations, apmIndexDeprecations);
+ const indices = getCombinedIndexInfos(deprecations);
const indexNames = indices.map(({ index }) => index!);
@@ -55,14 +52,10 @@ export async function getUpgradeAssistantStatus(
// Reformats the index deprecations to an array of deprecation warnings extended with an index field.
const getCombinedIndexInfos = (
deprecations: DeprecationAPIResponse,
- apmIndexDeprecations: EnrichedDeprecationInfo[]
) => {
- const apmIndices = apmIndexDeprecations.reduce((acc, dep) => acc.add(dep.index), new Set());
return (
Object.keys(deprecations.index_settings)
- // prevent APM indices from showing up for general re-indexing
- .filter((indexName) => !apmIndices.has(indexName))
.reduce((indexDeprecations, indexName) => {
return indexDeprecations.concat(
deprecations.index_settings[indexName].map(
@@ -70,7 +63,7 @@ const getCombinedIndexInfos = (
({
...d,
index: indexName,
- reindex: /Index created before/.test(d.message) && !apmIndices.has(indexName),
+ reindex: /Index created before/.test(d.message),
needsDefaultFields: /Number of fields exceeds automatic field expansion limit/.test(
d.message
),
@@ -79,9 +72,8 @@ const getCombinedIndexInfos = (
);
}, [] as EnrichedDeprecationInfo[])
// Filter out warnings for system indices until we know more about what changes are required for the
- // next upgrade in a future minor version. Note, we're still including APM depercations below.
+ // next upgrade in a future minor version.
.filter((deprecation) => !isSystemIndex(deprecation.index!))
- .concat(apmIndexDeprecations)
);
};
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/es_version_precheck.test.ts b/x-pack/plugins/upgrade_assistant/server/lib/es_version_precheck.test.ts
index 25dcd2521525d..f4631f3ba459d 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/es_version_precheck.test.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/es_version_precheck.test.ts
@@ -9,7 +9,8 @@ import { SemVer } from 'semver';
import { IScopedClusterClient, kibanaResponseFactory } from 'src/core/server';
import { coreMock } from 'src/core/server/mocks';
import { licensingMock } from '../../../../plugins/licensing/server/mocks';
-import { MOCK_VERSION_STRING, getMockVersionInfo } from './__fixtures__/version';
+import { mockKibanaVersion } from '../../common/constants';
+import { getMockVersionInfo } from './__fixtures__/version';
import {
esVersionCheck,
@@ -97,7 +98,7 @@ describe('verifyAllMatchKibanaVersion', () => {
describe('EsVersionPrecheck', () => {
beforeEach(() => {
- versionService.setup(MOCK_VERSION_STRING);
+ versionService.setup(mockKibanaVersion);
});
it('returns a 403 when callCluster fails with a 403', async () => {
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts
index c86f54b0fdda4..f778981b95054 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts
@@ -5,9 +5,10 @@
* 2.0.
*/
+import { mockKibanaSemverVersion, mockKibanaVersion } from '../../../common/constants';
import { ReindexWarning } from '../../../common/types';
import { versionService } from '../version';
-import { MOCK_VERSION_STRING, getMockVersionInfo } from '../__fixtures__/version';
+import { getMockVersionInfo } from '../__fixtures__/version';
import {
generateNewIndexName,
@@ -124,7 +125,7 @@ describe('transformFlatSettings', () => {
describe('sourceNameForIndex', () => {
beforeEach(() => {
- versionService.setup(MOCK_VERSION_STRING);
+ versionService.setup(mockKibanaVersion);
});
it('parses internal indices', () => {
@@ -145,7 +146,7 @@ describe('sourceNameForIndex', () => {
describe('generateNewIndexName', () => {
beforeEach(() => {
- versionService.setup(MOCK_VERSION_STRING);
+ versionService.setup(mockKibanaVersion);
});
it('parses internal indices', () => {
@@ -179,21 +180,25 @@ describe('getReindexWarnings', () => {
).toEqual([]);
});
- it('returns customTypeName for non-_doc mapping types', () => {
- expect(
- getReindexWarnings({
- settings: {},
- mappings: { doc: {} },
- })
- ).toEqual([ReindexWarning.customTypeName]);
- });
-
- it('does not return customTypeName for _doc mapping types', () => {
- expect(
- getReindexWarnings({
- settings: {},
- mappings: { _doc: {} },
- })
- ).toEqual([]);
- });
+ if (mockKibanaSemverVersion.major === 7) {
+ describe('customTypeName warning', () => {
+ it('returns customTypeName for non-_doc mapping types', () => {
+ expect(
+ getReindexWarnings({
+ settings: {},
+ mappings: { doc: {} },
+ })
+ ).toEqual([ReindexWarning.customTypeName]);
+ });
+
+ it('does not return customTypeName for _doc mapping types', () => {
+ expect(
+ getReindexWarnings({
+ settings: {},
+ mappings: { _doc: {} },
+ })
+ ).toEqual([]);
+ });
+ });
+ }
});
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts
index 797f0de4ac95d..d85efb3882643 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts
@@ -7,12 +7,8 @@
import { flow, omit } from 'lodash';
import { ReindexWarning } from '../../../common/types';
-import { isLegacyApmIndex } from '../apm';
import { versionService } from '../version';
import { FlatSettings, FlatSettingsWithTypeName } from './types';
-
-export const DEFAULT_TYPE_NAME = '_doc';
-
export interface ParsedIndexName {
cleanIndexName: string;
baseName: string;
@@ -73,31 +69,22 @@ export const generateNewIndexName = (indexName: string): string => {
* @param flatSettings
*/
export const getReindexWarnings = (
- flatSettings: FlatSettingsWithTypeName,
- apmIndexPatterns: string[] = []
+ flatSettings: FlatSettingsWithTypeName | FlatSettings
): ReindexWarning[] => {
- const indexName = flatSettings.settings['index.provided_name'];
- const typeName = Object.getOwnPropertyNames(flatSettings.mappings)[0];
- const apmReindexWarning = isLegacyApmIndex(
- indexName,
- apmIndexPatterns,
- flatSettings.mappings[typeName]
- );
- const typeNameWarning = usesCustomTypeName(flatSettings);
-
- const warnings = [
- [ReindexWarning.apmReindex, apmReindexWarning],
- [ReindexWarning.customTypeName, typeNameWarning],
- ] as Array<[ReindexWarning, boolean]>;
+ const warnings = [] as Array<[ReindexWarning, boolean]>;
- return warnings.filter(([_, applies]) => applies).map(([warning, _]) => warning);
-};
+ if (versionService.getMajorVersion() === 7) {
+ const DEFAULT_TYPE_NAME = '_doc';
+ // In 7+ it's not possible to have more than one type anyways, so always grab the first
+ // (and only) key.
+ const typeName = Object.getOwnPropertyNames(flatSettings.mappings)[0];
-const usesCustomTypeName = (flatSettings: FlatSettingsWithTypeName) => {
- // In 7+ it's not possible to have more than one type anyways, so always grab the first
- // (and only) key.
- const typeName = Object.getOwnPropertyNames(flatSettings.mappings)[0];
- return typeName && typeName !== DEFAULT_TYPE_NAME;
+ const typeNameWarning = Boolean(typeName && typeName !== DEFAULT_TYPE_NAME);
+
+ warnings.push([ReindexWarning.customTypeName, typeNameWarning]);
+ }
+
+ return warnings.filter(([_, applies]) => applies).map(([warning, _]) => warning);
};
const removeUnsettableSettings = (settings: FlatSettings['settings']) =>
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.test.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.test.ts
index 59c83a05aa551..592c2d15b9c0c 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.test.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.test.ts
@@ -19,9 +19,10 @@ import {
ReindexStatus,
ReindexStep,
} from '../../../common/types';
+import { mockKibanaVersion } from '../../../common/constants';
import { versionService } from '../version';
import { LOCK_WINDOW, ReindexActions, reindexActionsFactory } from './reindex_actions';
-import { MOCK_VERSION_STRING, getMockVersionInfo } from '../__fixtures__/version';
+import { getMockVersionInfo } from '../__fixtures__/version';
const { currentMajor, prevMajor } = getMockVersionInfo();
@@ -53,7 +54,7 @@ describe('ReindexActions', () => {
describe('createReindexOp', () => {
beforeEach(() => {
- versionService.setup(MOCK_VERSION_STRING);
+ versionService.setup(mockKibanaVersion);
client.create.mockResolvedValue();
});
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.ts
index c4b15b1453754..798d5f7d44747 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.ts
@@ -21,6 +21,7 @@ import {
ReindexStatus,
ReindexStep,
} from '../../../common/types';
+import { versionService } from '../version';
import { generateNewIndexName } from './index_settings';
import { FlatSettings, FlatSettingsWithTypeName } from './types';
@@ -85,7 +86,7 @@ export interface ReindexActions {
* Retrieve index settings (in flat, dot-notation style) and mappings.
* @param indexName
*/
- getFlatSettings(indexName: string): Promise;
+ getFlatSettings(indexName: string): Promise;
/**
* Retrieve index settings (in flat, dot-notation style) and mappings with the type name included.
@@ -243,18 +244,33 @@ export const reindexActionsFactory = (
},
async getFlatSettings(indexName: string) {
- const { body: flatSettings } = await esClient.indices.get<{
- [indexName: string]: FlatSettings;
- }>({
- index: indexName,
- flat_settings: true,
- });
+ let flatSettings;
+
+ if (versionService.getMajorVersion() === 7) {
+ // On 7.x, we need to get index settings with mapping type
+ flatSettings = await esClient.indices.get<{
+ [indexName: string]: FlatSettingsWithTypeName;
+ }>({
+ index: indexName,
+ flat_settings: true,
+ // This @ts-ignore is needed on master since the flag is deprecated on >7.x
+ // @ts-ignore
+ include_type_name: true,
+ });
+ } else {
+ flatSettings = await esClient.indices.get<{
+ [indexName: string]: FlatSettings;
+ }>({
+ index: indexName,
+ flat_settings: true,
+ });
+ }
- if (!flatSettings[indexName]) {
+ if (!flatSettings.body[indexName]) {
return null;
}
- return flatSettings[indexName];
+ return flatSettings.body[indexName];
},
async getFlatSettingsWithTypeName(indexName: string) {
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts
index 90ff699d79a72..06e6ad9d646e8 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts
@@ -20,12 +20,11 @@ import {
ReindexStatus,
ReindexStep,
} from '../../../common/types';
+import { mockKibanaVersion } from '../../../common/constants';
import { licensingMock } from '../../../../licensing/server/mocks';
import { LicensingPluginSetup } from '../../../../licensing/server';
-import { apmReindexScript } from '../apm';
-import apmMappings from '../apm/mapping.json';
-import { MOCK_VERSION_STRING, getMockVersionInfo } from '../__fixtures__/version';
+import { getMockVersionInfo } from '../__fixtures__/version';
import { esIndicesStateCheck } from '../es_indices_state_check';
import { versionService } from '../version';
@@ -89,10 +88,9 @@ describe('reindexService', () => {
actions,
log,
licensingPluginSetup,
- ['apm-*']
);
- versionService.setup(MOCK_VERSION_STRING);
+ versionService.setup(mockKibanaVersion);
});
describe('hasRequiredPrivileges', () => {
@@ -846,46 +844,6 @@ describe('reindexService', () => {
});
});
- it('used APM mapping for legacy APM index', async () => {
- const indexName = 'apm-1';
- const newIndexName = 'apm-1-reindexed';
-
- actions.getFlatSettings.mockResolvedValueOnce({
- settings: {
- 'index.number_of_replicas': 5,
- },
- mappings: {
- _meta: {
- version: '6.7.0',
- },
- },
- });
-
- clusterClient.asCurrentUser.indices.create.mockResolvedValueOnce(
- asApiResponse({ acknowledged: true })
- );
-
- await service.processNextStep({
- id: '1',
- attributes: {
- ...defaultAttributes,
- indexName,
- newIndexName,
- lastCompletedStep: ReindexStep.readonly,
- },
- } as ReindexSavedObject);
-
- expect(clusterClient.asCurrentUser.indices.create).toHaveBeenCalledWith({
- index: newIndexName,
- body: {
- mappings: apmMappings,
- settings: {
- 'index.number_of_replicas': 5,
- },
- },
- });
- });
-
it('fails if create index is not acknowledged', async () => {
clusterClient.asCurrentUser.indices.get.mockResolvedValueOnce(
asApiResponse({ myIndex: settingsMappings })
@@ -958,44 +916,6 @@ describe('reindexService', () => {
});
});
- it('uses APM script for legacy APM index', async () => {
- const indexName = 'apm-1';
- const newIndexName = 'apm-1-reindexed';
-
- clusterClient.asCurrentUser.reindex.mockResolvedValueOnce(asApiResponse({ task: 'xyz' }));
-
- actions.getFlatSettings.mockResolvedValueOnce({
- settings: {},
- mappings: {
- _meta: {
- version: '6.7.0',
- },
- },
- });
-
- await service.processNextStep({
- id: '1',
- attributes: {
- ...defaultAttributes,
- indexName,
- newIndexName,
- lastCompletedStep: ReindexStep.newIndexCreated,
- },
- } as ReindexSavedObject);
- expect(clusterClient.asCurrentUser.reindex).toHaveBeenLastCalledWith({
- refresh: true,
- wait_for_completion: false,
- body: {
- source: { index: indexName },
- dest: { index: newIndexName },
- script: {
- lang: 'painless',
- source: apmReindexScript,
- },
- },
- });
- });
-
it('fails if starting reindex fails', async () => {
clusterClient.asCurrentUser.reindex.mockRejectedValueOnce(new Error('blah!'));
const updatedOp = await service.processNextStep(reindexOp);
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts
index 92eab9be21d95..b6c4140bd4169 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts
@@ -17,8 +17,7 @@ import {
ReindexStep,
ReindexWarning,
} from '../../../common/types';
-import { apmReindexScript, isLegacyApmIndex } from '../apm';
-import apmMappings from '../apm/mapping.json';
+
import { esIndicesStateCheck } from '../es_indices_state_check';
@@ -137,7 +136,6 @@ export const reindexServiceFactory = (
actions: ReindexActions,
log: Logger,
licensing: LicensingPluginSetup,
- apmIndexPatterns: string[] = []
): ReindexService => {
// ------ Utility functions
@@ -318,13 +316,12 @@ export const reindexServiceFactory = (
}
const { settings, mappings } = transformFlatSettings(flatSettings);
- const legacyApmIndex = isLegacyApmIndex(indexName, apmIndexPatterns, flatSettings.mappings);
const { body: createIndex } = await esClient.indices.create({
index: newIndexName,
body: {
settings,
- mappings: legacyApmIndex ? apmMappings : mappings,
+ mappings,
},
});
@@ -353,28 +350,18 @@ export const reindexServiceFactory = (
await esClient.indices.open({ index: indexName });
}
- const reindexBody = {
- source: { index: indexName },
- dest: { index: reindexOp.attributes.newIndexName },
- } as any;
-
const flatSettings = await actions.getFlatSettings(indexName);
if (!flatSettings) {
throw error.indexNotFound(`Index ${indexName} does not exist.`);
}
- const legacyApmIndex = isLegacyApmIndex(indexName, apmIndexPatterns, flatSettings.mappings);
- if (legacyApmIndex) {
- reindexBody.script = {
- lang: 'painless',
- source: apmReindexScript,
- };
- }
-
const { body: startReindexResponse } = await esClient.reindex({
refresh: true,
wait_for_completion: false,
- body: reindexBody,
+ body: {
+ source: { index: indexName },
+ dest: { index: reindexOp.attributes.newIndexName },
+ },
});
return actions.updateReindexOp(reindexOp, {
@@ -569,7 +556,7 @@ export const reindexServiceFactory = (
if (!flatSettings) {
return null;
} else {
- return getReindexWarnings(flatSettings, apmIndexPatterns);
+ return getReindexWarnings(flatSettings);
}
},
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/types.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/types.ts
index f96eeec36963b..c26dbbb1bf4c0 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/types.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/types.ts
@@ -28,6 +28,10 @@ export interface FlatSettings {
};
}
+<<<<<<< HEAD
+=======
+// Specific to 7.x-8 upgrade
+>>>>>>> fe6bd2ecbb4... [Upgrade Assistant] Align code between branches (#91862)
export interface FlatSettingsWithTypeName {
settings: {
[key: string]: string;
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts
index 1163f36733287..6d55b1e8007f0 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts
@@ -53,7 +53,6 @@ export class ReindexWorker {
private clusterClient: IClusterClient,
log: Logger,
private licensing: LicensingPluginSetup,
- private apmIndexPatterns: string[]
) {
this.log = log.get('reindex_worker');
if (ReindexWorker.workerSingleton) {
@@ -67,7 +66,6 @@ export class ReindexWorker {
reindexActionsFactory(this.client, callAsInternalUser),
log,
this.licensing,
- apmIndexPatterns
);
ReindexWorker.workerSingleton = this;
@@ -157,7 +155,6 @@ export class ReindexWorker {
actions,
this.log,
this.licensing,
- this.apmIndexPatterns
);
};
@@ -239,7 +236,6 @@ export class ReindexWorker {
actions,
this.log,
this.licensing,
- this.apmIndexPatterns
);
reindexOp = await swallowExceptions(service.processNextStep, this.log)(reindexOp);
diff --git a/x-pack/plugins/upgrade_assistant/server/plugin.ts b/x-pack/plugins/upgrade_assistant/server/plugin.ts
index b6b9b5390b004..1c7483f8ebc35 100644
--- a/x-pack/plugins/upgrade_assistant/server/plugin.ts
+++ b/x-pack/plugins/upgrade_assistant/server/plugin.ts
@@ -5,7 +5,6 @@
* 2.0.
*/
-import { first } from 'rxjs/operators';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import {
@@ -21,9 +20,6 @@ import {
import { CloudSetup } from '../../cloud/server';
import { PluginSetupContract as FeaturesPluginSetup } from '../../features/server';
import { LicensingPluginSetup } from '../../licensing/server';
-import { APMOSSPluginSetup } from '../../../../src/plugins/apm_oss/server';
-
-import { extractIndexPatterns } from './lib/apm/extract_index_patterns';
import { CredentialStore, credentialStoreFactory } from './lib/reindexing/credential_store';
import { ReindexWorker } from './lib/reindexing';
@@ -41,7 +37,6 @@ import { RouteDependencies } from './types';
interface PluginsSetup {
usageCollection: UsageCollectionSetup;
licensing: LicensingPluginSetup;
- apmOss: APMOSSPluginSetup;
features: FeaturesPluginSetup;
cloud?: CloudSetup;
}
@@ -53,7 +48,6 @@ export class UpgradeAssistantServerPlugin implements Plugin {
// Properties set at setup
private licensing?: LicensingPluginSetup;
- private apmOSS?: APMOSSPluginSetup;
// Properties set at start
private savedObjectsServiceStart?: SavedObjectsServiceStart;
@@ -74,10 +68,9 @@ export class UpgradeAssistantServerPlugin implements Plugin {
setup(
{ http, getStartServices, capabilities, savedObjects }: CoreSetup,
- { usageCollection, cloud, features, licensing, apmOss: apmOSS }: PluginsSetup
+ { usageCollection, cloud, features, licensing }: PluginsSetup
) {
this.licensing = licensing;
- this.apmOSS = apmOSS;
savedObjects.registerType(reindexOperationSavedObjectType);
savedObjects.registerType(telemetrySavedObjectType);
@@ -100,7 +93,6 @@ export class UpgradeAssistantServerPlugin implements Plugin {
const dependencies: RouteDependencies = {
cloud,
router,
- apmOSS,
credentialStore: this.credentialStore,
log: this.logger,
getSavedObjectsService: () => {
@@ -143,10 +135,6 @@ export class UpgradeAssistantServerPlugin implements Plugin {
// process jobs without the browser staying on the page, but will require that jobs go into
// a paused state if no Kibana nodes have the required credentials.
- const apmIndexPatterns = extractIndexPatterns(
- await this.apmOSS!.config$.pipe(first()).toPromise()
- );
-
this.worker = createReindexWorker({
credentialStore: this.credentialStore,
licensing: this.licensing!,
@@ -155,7 +143,6 @@ export class UpgradeAssistantServerPlugin implements Plugin {
savedObjects: new SavedObjectsClient(
this.savedObjectsServiceStart.createInternalRepository()
),
- apmIndexPatterns,
});
this.worker!.start();
diff --git a/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.test.ts b/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.test.ts
index 6b831a8e591f7..a5da4741b10eb 100644
--- a/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.test.ts
+++ b/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.test.ts
@@ -6,7 +6,6 @@
*/
import { kibanaResponseFactory } from 'src/core/server';
-import { apmOSSPluginSetupMock } from '../../../../../src/plugins/apm_oss/server/mocks';
import { createMockRouter, MockRouter, routeHandlerContextMock } from './__mocks__/routes.mock';
import { createRequestMock } from './__mocks__/request.mock';
@@ -36,7 +35,6 @@ describe('cluster checkup API', () => {
cloud: {
isCloudEnabled: true,
},
- apmOSS: apmOSSPluginSetupMock.create({ indexPattern: 'apm-*' }),
router: mockRouter,
};
registerClusterCheckupRoutes(routeDependencies);
@@ -64,25 +62,6 @@ describe('cluster checkup API', () => {
});
});
- describe('with APM enabled', () => {
- it('is provided to getUpgradeAssistantStatus', async () => {
- const spy = jest.spyOn(MigrationApis, 'getUpgradeAssistantStatus');
-
- MigrationApis.getUpgradeAssistantStatus.mockResolvedValue({
- cluster: [],
- indices: [],
- nodes: [],
- });
-
- await routeDependencies.router.getHandler({
- method: 'get',
- pathPattern: '/api/upgrade_assistant/status',
- })(routeHandlerContextMock, createRequestMock(), kibanaResponseFactory);
-
- expect(spy.mock.calls[0][2]).toEqual(['apm-*']);
- });
- });
-
describe('GET /api/upgrade_assistant/reindex/{indexName}.json', () => {
it('returns state', async () => {
MigrationApis.getUpgradeAssistantStatus.mockResolvedValue({
diff --git a/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.ts b/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.ts
index 923fc547071b8..fc3ad98401594 100644
--- a/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.ts
+++ b/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.ts
@@ -5,10 +5,8 @@
* 2.0.
*/
-import { first } from 'rxjs/operators';
import { getUpgradeAssistantStatus } from '../lib/es_migration_apis';
import { versionCheckHandlerWrapper } from '../lib/es_version_precheck';
-import { extractIndexPatterns } from '../lib/apm/extract_index_patterns';
import { RouteDependencies } from '../types';
import { reindexActionsFactory } from '../lib/reindexing/reindex_actions';
import { reindexServiceFactory } from '../lib/reindexing';
@@ -16,7 +14,6 @@ import { reindexServiceFactory } from '../lib/reindexing';
export function registerClusterCheckupRoutes({
cloud,
router,
- apmOSS,
licensing,
log,
}: RouteDependencies) {
@@ -39,10 +36,7 @@ export function registerClusterCheckupRoutes({
response
) => {
try {
- const apmConfig = await apmOSS.config$.pipe(first()).toPromise();
- const indexPatterns = extractIndexPatterns(apmConfig);
-
- const status = await getUpgradeAssistantStatus(client, isCloudEnabled, indexPatterns);
+ const status = await getUpgradeAssistantStatus(client, isCloudEnabled);
const asCurrentUser = client.asCurrentUser;
const reindexActions = reindexActionsFactory(savedObjectsClient, asCurrentUser);
diff --git a/x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.test.ts b/x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.test.ts
index b74a52db7da16..21dded346bbd3 100644
--- a/x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.test.ts
+++ b/x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.test.ts
@@ -7,7 +7,6 @@
import { kibanaResponseFactory } from 'src/core/server';
import { licensingMock } from '../../../../licensing/server/mocks';
-import { apmOSSPluginSetupMock } from '../../../../../../src/plugins/apm_oss/server/mocks';
import { createMockRouter, MockRouter, routeHandlerContextMock } from '../__mocks__/routes.mock';
import { createRequestMock } from '../__mocks__/request.mock';
@@ -61,7 +60,6 @@ describe('reindex API', () => {
routeDependencies = {
credentialStore,
router: mockRouter,
- apmOSS: apmOSSPluginSetupMock.create(),
licensing: licensingMock.createSetup(),
};
registerReindexIndicesRoutes(routeDependencies, () => worker);
@@ -91,7 +89,9 @@ describe('reindex API', () => {
mockReindexService.findReindexOperation.mockResolvedValueOnce({
attributes: { indexName: 'wowIndex', status: ReindexStatus.inProgress },
});
- mockReindexService.detectReindexWarnings.mockResolvedValueOnce([ReindexWarning.apmReindex]);
+ mockReindexService.detectReindexWarnings.mockResolvedValueOnce([
+ ReindexWarning.customTypeName,
+ ]);
const resp = await routeDependencies.router.getHandler({
method: 'get',
diff --git a/x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.ts b/x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.ts
index bfc794e6493f8..28730012b51b6 100644
--- a/x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.ts
+++ b/x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.ts
@@ -45,7 +45,6 @@ interface CreateReindexWorker {
credentialStore: CredentialStore;
savedObjects: SavedObjectsClient;
licensing: LicensingPluginSetup;
- apmIndexPatterns: string[];
}
export function createReindexWorker({
@@ -54,7 +53,6 @@ export function createReindexWorker({
credentialStore,
savedObjects,
licensing,
- apmIndexPatterns,
}: CreateReindexWorker) {
const esClient = elasticsearchService.client;
return new ReindexWorker(
@@ -63,7 +61,6 @@ export function createReindexWorker({
esClient,
logger,
licensing,
- apmIndexPatterns
);
}
diff --git a/x-pack/plugins/upgrade_assistant/server/types.ts b/x-pack/plugins/upgrade_assistant/server/types.ts
index ad450a3fdaf1c..80c60e3f310bc 100644
--- a/x-pack/plugins/upgrade_assistant/server/types.ts
+++ b/x-pack/plugins/upgrade_assistant/server/types.ts
@@ -9,11 +9,9 @@ import { IRouter, Logger, SavedObjectsServiceStart } from 'src/core/server';
import { CloudSetup } from '../../cloud/server';
import { CredentialStore } from './lib/reindexing/credential_store';
import { LicensingPluginSetup } from '../../licensing/server';
-import { APMOSSPluginSetup } from '../../../../src/plugins/apm_oss/server';
export interface RouteDependencies {
router: IRouter;
- apmOSS: APMOSSPluginSetup;
credentialStore: CredentialStore;
log: Logger;
getSavedObjectsService: () => SavedObjectsServiceStart;
diff --git a/x-pack/plugins/upgrade_assistant/tsconfig.json b/x-pack/plugins/upgrade_assistant/tsconfig.json
index 2f6bdd371ad0d..220ae4d0f0160 100644
--- a/x-pack/plugins/upgrade_assistant/tsconfig.json
+++ b/x-pack/plugins/upgrade_assistant/tsconfig.json
@@ -19,7 +19,6 @@
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../../../src/plugins/management/tsconfig.json" },
{ "path": "../../../src/plugins/usage_collection/tsconfig.json" },
- { "path": "../../../src/plugins/apm_oss/tsconfig.json"},
{ "path": "../cloud/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" },