From a0474ba4d324949ecdd50b1a9344a6541cb0d2f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Thu, 30 Apr 2020 13:38:41 +0200 Subject: [PATCH 1/2] [APM] Fix duplicate index patterns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An index pattern with the id “apm_static_index_pattern_id” is automatically created when opening the APM app. It is also possible to manually create the index pattern by clicking “Load Kibana Objects” in the Getting Started Guide, however this will create an index pattern with a different id (“apm-*). This fixes it by making sure the index pattern id is always “apm_static_index_pattern_id”. --- x-pack/plugins/apm/server/tutorial/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x-pack/plugins/apm/server/tutorial/index.ts b/x-pack/plugins/apm/server/tutorial/index.ts index d8cbff9a1c27d..0c26f5a718c73 100644 --- a/x-pack/plugins/apm/server/tutorial/index.ts +++ b/x-pack/plugins/apm/server/tutorial/index.ts @@ -14,6 +14,9 @@ import { TutorialsCategory } from '../../../../../src/plugins/home/server'; +// duplicated in x-pack/plugins/apm/common/index_pattern_constants.ts +const APM_STATIC_INDEX_PATTERN_ID = 'apm_static_index_pattern_id'; + const apmIntro = i18n.translate('xpack.apm.tutorial.introduction', { defaultMessage: 'Collect in-depth performance metrics and errors from inside your applications.' @@ -39,6 +42,7 @@ export const tutorialProvider = ({ const savedObjects = [ { ...apmIndexPattern, + id: APM_STATIC_INDEX_PATTERN_ID, attributes: { ...apmIndexPattern.attributes, title: indexPatternTitle From 7002fa878bf4829e423f209d9f6608c74a7ad907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Mon, 4 May 2020 13:53:01 +0200 Subject: [PATCH 2/2] Import APM_STATIC_INDEX_PATTERN_ID --- x-pack/plugins/apm/server/tutorial/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x-pack/plugins/apm/server/tutorial/index.ts b/x-pack/plugins/apm/server/tutorial/index.ts index 0c26f5a718c73..76e2456afa5df 100644 --- a/x-pack/plugins/apm/server/tutorial/index.ts +++ b/x-pack/plugins/apm/server/tutorial/index.ts @@ -13,9 +13,7 @@ import { ArtifactsSchema, TutorialsCategory } from '../../../../../src/plugins/home/server'; - -// duplicated in x-pack/plugins/apm/common/index_pattern_constants.ts -const APM_STATIC_INDEX_PATTERN_ID = 'apm_static_index_pattern_id'; +import { APM_STATIC_INDEX_PATTERN_ID } from '../../common/index_pattern_constants'; const apmIntro = i18n.translate('xpack.apm.tutorial.introduction', { defaultMessage: