From 30d377a964c920888905f8e5ffcdc4b82dcb50e2 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Mon, 11 Nov 2024 13:59:25 +0100 Subject: [PATCH 01/10] Migrate /test/apm_api_integration/tests/diagnostics to be deployment-agnostic API tests --- .../apm}/diagnostics/apm_events.spec.ts | 16 ++++++----- .../apm}/diagnostics/data_streams.spec.ts | 22 ++++++++------- .../observability/apm/diagnostics/index.ts | 19 +++++++++++++ .../index_pattern_settings.spec.ts} | 23 +++++++++------- .../apm}/diagnostics/index_templates.spec.ts | 21 ++++++++------- .../apm}/diagnostics/indices.spec.ts | 27 ++++++++++--------- .../apm}/diagnostics/privileges.spec.ts | 9 +++---- .../apis/observability/apm/index.ts | 1 + 8 files changed, 85 insertions(+), 53 deletions(-) rename x-pack/test/{apm_api_integration/tests => api_integration/deployment_agnostic/apis/observability/apm}/diagnostics/apm_events.spec.ts (93%) rename x-pack/test/{apm_api_integration/tests => api_integration/deployment_agnostic/apis/observability/apm}/diagnostics/data_streams.spec.ts (80%) create mode 100644 x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index.ts rename x-pack/test/{apm_api_integration/tests/diagnostics/index_pattern_settings.ts => api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts} (79%) rename x-pack/test/{apm_api_integration/tests => api_integration/deployment_agnostic/apis/observability/apm}/diagnostics/index_templates.spec.ts (75%) rename x-pack/test/{apm_api_integration/tests => api_integration/deployment_agnostic/apis/observability/apm}/diagnostics/indices.spec.ts (86%) rename x-pack/test/{apm_api_integration/tests => api_integration/deployment_agnostic/apis/observability/apm}/diagnostics/privileges.spec.ts (90%) diff --git a/x-pack/test/apm_api_integration/tests/diagnostics/apm_events.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/apm_events.spec.ts similarity index 93% rename from x-pack/test/apm_api_integration/tests/diagnostics/apm_events.spec.ts rename to x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/apm_events.spec.ts index 1abace6c77f4c..1c6fad6520a11 100644 --- a/x-pack/test/apm_api_integration/tests/diagnostics/apm_events.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/apm_events.spec.ts @@ -9,19 +9,18 @@ import expect from '@kbn/expect'; import { apm, timerange } from '@kbn/apm-synthtrace-client'; import { APIReturnType } from '@kbn/apm-plugin/public/services/rest/create_call_apm_api'; import { sumBy } from 'lodash'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; -export default function ApiTest({ getService }: FtrProviderContext) { - const registry = getService('registry'); - const apmApiClient = getService('apmApiClient'); +export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { + const apmApiClient = getService('apmApi'); const es = getService('es'); - const apmSynthtraceEsClient = getService('apmSynthtraceEsClient'); + const synthtrace = getService('synthtrace'); const start = new Date('2021-01-01T00:00:00.000Z').getTime(); const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; - // FLAKY: https://github.com/elastic/kibana/issues/177144 - registry.when('Diagnostics: APM Events', { config: 'basic', archives: [] }, () => { + describe('Diagnostics: APM Events', () => { describe('When there is no data', () => { before(async () => { // delete APM data streams @@ -38,10 +37,13 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); describe('When data is ingested', () => { + let apmSynthtraceEsClient: ApmSynthtraceEsClient; + before(async () => { const instance = apm .service({ name: 'synth-go', environment: 'production', agentName: 'go' }) .instance('instance-a'); + apmSynthtraceEsClient = await synthtrace.createApmSynthtraceEsClient(); await apmSynthtraceEsClient.index( timerange(start, end) diff --git a/x-pack/test/apm_api_integration/tests/diagnostics/data_streams.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/data_streams.spec.ts similarity index 80% rename from x-pack/test/apm_api_integration/tests/diagnostics/data_streams.spec.ts rename to x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/data_streams.spec.ts index 80fa34dbaa002..844e1fa5ea372 100644 --- a/x-pack/test/apm_api_integration/tests/diagnostics/data_streams.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/data_streams.spec.ts @@ -7,20 +7,18 @@ import expect from '@kbn/expect'; import { apm, timerange } from '@kbn/apm-synthtrace-client'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; -export default function ApiTest({ getService }: FtrProviderContext) { - const registry = getService('registry'); - const apmApiClient = getService('apmApiClient'); +export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { + const apmApiClient = getService('apmApi'); const es = getService('es'); - const apmSynthtraceEsClient = getService('apmSynthtraceEsClient'); - const synthtraceKibanaClient = getService('synthtraceKibanaClient'); + const synthtrace = getService('synthtrace'); const start = new Date('2021-01-01T00:00:00.000Z').getTime(); const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; - // FLAKY: https://github.com/elastic/kibana/issues/177245 - registry.when('Diagnostics: Data streams', { config: 'basic', archives: [] }, () => { + describe('Diagnostics: Data streams', () => { describe('When there is no data', () => { before(async () => { // delete APM data streams @@ -45,9 +43,13 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); describe('When data is ingested', () => { + let apmSynthtraceEsClient: ApmSynthtraceEsClient; + before(async () => { - const latestVersion = await synthtraceKibanaClient.fetchLatestApmPackageVersion(); - await synthtraceKibanaClient.installApmPackage(latestVersion); + apmSynthtraceEsClient = await synthtrace.createApmSynthtraceEsClient(); + const apmSynthtraceKibanaClient = synthtrace.apmSynthtraceKibanaClient; + const latestVersion = await apmSynthtraceKibanaClient.fetchLatestApmPackageVersion(); + await apmSynthtraceKibanaClient.installApmPackage(latestVersion); const instance = apm .service({ name: 'synth-go', environment: 'production', agentName: 'go' }) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index.ts new file mode 100644 index 0000000000000..d9444430c2e5d --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index.ts @@ -0,0 +1,19 @@ +/* + * 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 { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { + describe('diagnostics', () => { + loadTestFile(require.resolve('./apm_events.spec.ts')); + loadTestFile(require.resolve('./data_streams.spec.ts')); + loadTestFile(require.resolve('./index_pattern_settings.spec.ts')); + loadTestFile(require.resolve('./index_templates.spec.ts')); + loadTestFile(require.resolve('./indices.spec.ts')); + loadTestFile(require.resolve('./privileges.spec.ts')); + }); +} diff --git a/x-pack/test/apm_api_integration/tests/diagnostics/index_pattern_settings.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts similarity index 79% rename from x-pack/test/apm_api_integration/tests/diagnostics/index_pattern_settings.ts rename to x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts index d0ba7b1850d31..33259185490e5 100644 --- a/x-pack/test/apm_api_integration/tests/diagnostics/index_pattern_settings.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts @@ -7,23 +7,22 @@ import expect from '@kbn/expect'; import { apm, timerange } from '@kbn/apm-synthtrace-client'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; import { getApmIndexTemplateNames } from '@kbn/apm-plugin/server/routes/diagnostics/helpers/get_apm_index_template_names'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; -export default function ApiTest({ getService }: FtrProviderContext) { - const registry = getService('registry'); - const apmApiClient = getService('apmApiClient'); +export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { + const apmApiClient = getService('apmApi'); const es = getService('es'); - const apmSynthtraceEsClient = getService('apmSynthtraceEsClient'); - const synthtraceKibanaClient = getService('synthtraceKibanaClient'); + const synthtrace = getService('synthtrace'); const start = new Date('2021-01-01T00:00:00.000Z').getTime(); const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; - registry.when('Diagnostics: Index pattern settings', { config: 'basic', archives: [] }, () => { + describe.skip('Diagnostics: Index pattern settings', () => { describe('When there is no data', () => { before(async () => { - // delete APM index templates + // delete all APM index templates await es.indices.deleteIndexTemplate({ name: Object.values(getApmIndexTemplateNames()).flat(), }); @@ -44,9 +43,13 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); describe('When data is ingested', () => { + let apmSynthtraceEsClient: ApmSynthtraceEsClient; + before(async () => { - const latestVersion = await synthtraceKibanaClient.fetchLatestApmPackageVersion(); - await synthtraceKibanaClient.installApmPackage(latestVersion); + apmSynthtraceEsClient = await synthtrace.createApmSynthtraceEsClient(); + const apmSynthtraceKibanaClient = synthtrace.apmSynthtraceKibanaClient; + const latestVersion = await apmSynthtraceKibanaClient.fetchLatestApmPackageVersion(); + await apmSynthtraceKibanaClient.installApmPackage(latestVersion); const instance = apm .service({ name: 'synth-go', environment: 'production', agentName: 'go' }) diff --git a/x-pack/test/apm_api_integration/tests/diagnostics/index_templates.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts similarity index 75% rename from x-pack/test/apm_api_integration/tests/diagnostics/index_templates.spec.ts rename to x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts index 1bbc799b3bf78..70436b575c641 100644 --- a/x-pack/test/apm_api_integration/tests/diagnostics/index_templates.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts @@ -8,19 +8,18 @@ import expect from '@kbn/expect'; import { apm, timerange } from '@kbn/apm-synthtrace-client'; import { getApmIndexTemplateNames } from '@kbn/apm-plugin/server/routes/diagnostics/helpers/get_apm_index_template_names'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; -export default function ApiTest({ getService }: FtrProviderContext) { - const registry = getService('registry'); - const apmApiClient = getService('apmApiClient'); +export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { + const apmApiClient = getService('apmApi'); const es = getService('es'); - const apmSynthtraceEsClient = getService('apmSynthtraceEsClient'); - const synthtraceKibanaClient = getService('synthtraceKibanaClient'); + const synthtrace = getService('synthtrace'); const start = new Date('2021-01-01T00:00:00.000Z').getTime(); const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; - registry.when.skip('Diagnostics: Index Templates', { config: 'basic', archives: [] }, () => { + describe.skip('Diagnostics: Index Templates', () => { describe('When there is no data', () => { before(async () => { // delete APM index templates @@ -42,9 +41,13 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); describe('When data is ingested', () => { + let apmSynthtraceEsClient: ApmSynthtraceEsClient; + before(async () => { - const latestVersion = await synthtraceKibanaClient.fetchLatestApmPackageVersion(); - await synthtraceKibanaClient.installApmPackage(latestVersion); + apmSynthtraceEsClient = await synthtrace.createApmSynthtraceEsClient(); + const apmSynthtraceKibanaClient = synthtrace.apmSynthtraceKibanaClient; + const latestVersion = await apmSynthtraceKibanaClient.fetchLatestApmPackageVersion(); + await apmSynthtraceKibanaClient.installApmPackage(latestVersion); const instance = apm .service({ name: 'synth-go', environment: 'production', agentName: 'go' }) diff --git a/x-pack/test/apm_api_integration/tests/diagnostics/indices.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/indices.spec.ts similarity index 86% rename from x-pack/test/apm_api_integration/tests/diagnostics/indices.spec.ts rename to x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/indices.spec.ts index 477824524b48c..cee70a78190fb 100644 --- a/x-pack/test/apm_api_integration/tests/diagnostics/indices.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/indices.spec.ts @@ -8,20 +8,20 @@ import expect from '@kbn/expect'; import { apm, timerange } from '@kbn/apm-synthtrace-client'; import { omit } from 'lodash'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; -export default function ApiTest({ getService }: FtrProviderContext) { - const registry = getService('registry'); - const apmApiClient = getService('apmApiClient'); - const apmSynthtraceEsClient = getService('apmSynthtraceEsClient'); +export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { + const apmApiClient = getService('apmApi'); + const synthtrace = getService('synthtrace'); const es = getService('es'); - const synthtraceKibanaClient = getService('synthtraceKibanaClient'); const start = new Date('2021-01-01T00:00:00.000Z').getTime(); const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; - // FLAKY: https://github.com/elastic/kibana/pull/177039 - registry.when.skip('Diagnostics: Indices', { config: 'basic', archives: [] }, () => { + let apmSynthtraceEsClient: ApmSynthtraceEsClient; + + describe('Diagnostics: Indices', () => { describe.skip('When there is no data', () => { it('returns empty response`', async () => { const { status, body } = await apmApiClient.adminUser({ @@ -39,6 +39,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { const instance = apm .service({ name: 'synth-go', environment: 'production', agentName: 'go' }) .instance('instance-a'); + apmSynthtraceEsClient = await synthtrace.createApmSynthtraceEsClient(); await apmSynthtraceEsClient.index( timerange(start, end) @@ -92,8 +93,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { after(async () => { await es.indices.delete({ index: 'traces-apm-default' }); - const latestVersion = await synthtraceKibanaClient.fetchLatestApmPackageVersion(); - await synthtraceKibanaClient.installApmPackage(latestVersion); + const apmSynthtraceKibanaClient = synthtrace.apmSynthtraceKibanaClient; + const latestVersion = await apmSynthtraceKibanaClient.fetchLatestApmPackageVersion(); + await apmSynthtraceKibanaClient.installApmPackage(latestVersion); await apmSynthtraceEsClient.clean(); }); @@ -136,8 +138,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); after(async () => { - const latestVersion = await synthtraceKibanaClient.fetchLatestApmPackageVersion(); - await synthtraceKibanaClient.installApmPackage(latestVersion); + const apmSynthtraceKibanaClient = synthtrace.apmSynthtraceKibanaClient; + const latestVersion = await apmSynthtraceKibanaClient.fetchLatestApmPackageVersion(); + await apmSynthtraceKibanaClient.installApmPackage(latestVersion); await apmSynthtraceEsClient.clean(); }); diff --git a/x-pack/test/apm_api_integration/tests/diagnostics/privileges.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/privileges.spec.ts similarity index 90% rename from x-pack/test/apm_api_integration/tests/diagnostics/privileges.spec.ts rename to x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/privileges.spec.ts index 2d9652b612010..fa46ff08cc8ed 100644 --- a/x-pack/test/apm_api_integration/tests/diagnostics/privileges.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/privileges.spec.ts @@ -7,13 +7,12 @@ import { APIReturnType } from '@kbn/apm-plugin/public/services/rest/create_call_apm_api'; import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; -export default function ApiTest({ getService }: FtrProviderContext) { - const registry = getService('registry'); - const apmApiClient = getService('apmApiClient'); +export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { + const apmApiClient = getService('apmApi'); - registry.when('Diagnostics: Privileges', { config: 'basic', archives: [] }, () => { + describe('Diagnostics: Privileges', () => { describe('superuser', () => { let body: APIReturnType<'GET /internal/apm/diagnostics'>; diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/index.ts index a62c11d40b1af..2fc7ac5be5627 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/index.ts @@ -12,5 +12,6 @@ export default function apmApiIntegrationTests({ }: DeploymentAgnosticFtrProviderContext) { describe('APM', function () { loadTestFile(require.resolve('./agent_explorer')); + loadTestFile(require.resolve('./diagnostics')); }); } From 3f29f99476a792c51ef1be6d8c8ce3d9db33e84e Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Tue, 12 Nov 2024 15:16:50 +0100 Subject: [PATCH 02/10] unskip tests --- .../index_pattern_settings.spec.ts | 88 +++++++++---------- .../apm/diagnostics/index_templates.spec.ts | 23 +---- 2 files changed, 42 insertions(+), 69 deletions(-) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts index 33259185490e5..838bc52fa2e5b 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts @@ -8,40 +8,17 @@ import expect from '@kbn/expect'; import { apm, timerange } from '@kbn/apm-synthtrace-client'; import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; -import { getApmIndexTemplateNames } from '@kbn/apm-plugin/server/routes/diagnostics/helpers/get_apm_index_template_names'; +import { uniq } from 'lodash'; import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { const apmApiClient = getService('apmApi'); - const es = getService('es'); const synthtrace = getService('synthtrace'); const start = new Date('2021-01-01T00:00:00.000Z').getTime(); const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; - describe.skip('Diagnostics: Index pattern settings', () => { - describe('When there is no data', () => { - before(async () => { - // delete all APM index templates - await es.indices.deleteIndexTemplate({ - name: Object.values(getApmIndexTemplateNames()).flat(), - }); - }); - - it('returns the built-in (non-APM) index templates`', async () => { - const { status, body } = await apmApiClient.adminUser({ - endpoint: 'GET /internal/apm/diagnostics', - }); - expect(status).to.be(200); - - const templateNames = body.indexTemplatesByIndexPattern.flatMap(({ indexTemplates }) => { - return indexTemplates?.map(({ templateName }) => templateName); - }); - - expect(templateNames).to.eql(['logs', 'metrics']); - }); - }); - + describe('Diagnostics: Index pattern settings', () => { describe('When data is ingested', () => { let apmSynthtraceEsClient: ApmSynthtraceEsClient; @@ -76,32 +53,49 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon }); expect(status).to.be(200); - const templateNames = body.indexTemplatesByIndexPattern.flatMap(({ indexTemplates }) => { - return indexTemplates?.map(({ templateName }) => templateName); - }); + const templateNames = uniq( + body.indexTemplatesByIndexPattern.flatMap(({ indexTemplates }) => { + return indexTemplates?.map(({ templateName }) => templateName); + }) + ); expect(templateNames).to.eql([ - 'logs-apm.error', - 'logs-apm.app', + 'logs-apm.error@template', + 'logs-apm.app@template', + 'logs-otel@template', 'logs', - 'metrics-apm.service_transaction.60m', - 'metrics-apm.service_destination.10m', - 'metrics-apm.transaction.1m', - 'metrics-apm.service_destination.1m', - 'metrics-apm.service_transaction.10m', - 'metrics-apm.service_transaction.1m', - 'metrics-apm.transaction.60m', - 'metrics-apm.service_destination.60m', - 'metrics-apm.service_summary.1m', - 'metrics-apm.transaction.10m', - 'metrics-apm.internal', - 'metrics-apm.service_summary.10m', - 'metrics-apm.service_summary.60m', - 'metrics-apm.app', + 'metrics-apm.service_transaction.1m@template', + 'metrics-apm.transaction.10m@template', + 'metrics-apm.service_summary.10m@template', + 'metrics-apm.internal@template', + 'metrics-apm.service_destination.1m@template', + 'metrics-apm.service_summary.60m@template', + 'metrics-apm.service_summary.1m@template', + 'metrics-apm.transaction.1m@template', + 'metrics-apm.service_destination.60m@template', + 'metrics-apm.service_transaction.60m@template', + 'metrics-apm.service_destination.10m@template', + 'metrics-apm.service_transaction.10m@template', + 'metrics-apm.transaction.60m@template', + 'metrics-apm.app@template', + 'metrics-otel@template', 'metrics', - 'traces-apm', - 'traces-apm.rum', - 'traces-apm.sampled', + 'metrics-service_transaction.10m.otel@template', + 'metrics-transaction.10m.otel@template', + 'metrics-service_summary.1m.otel@template', + 'metrics-service_transaction.60m.otel@template', + 'metrics-service_summary.60m.otel@template', + 'metrics-service_destination.1m@template', + 'metrics-service_destination.10m@template', + 'metrics-service_summary.10m.otel@template', + 'metrics-transaction.1m.otel@template', + 'metrics-transaction.60m.otel@template', + 'metrics-service_transaction.1m.otel@template', + 'metrics-service_destination.60m@template', + 'traces-apm.rum@template', + 'traces-apm@template', + 'traces-apm.sampled@template', + 'traces-otel@template', ]); }); }); diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts index 70436b575c641..548ed489f6aed 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts @@ -7,7 +7,6 @@ import expect from '@kbn/expect'; import { apm, timerange } from '@kbn/apm-synthtrace-client'; -import { getApmIndexTemplateNames } from '@kbn/apm-plugin/server/routes/diagnostics/helpers/get_apm_index_template_names'; import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; @@ -19,27 +18,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon const start = new Date('2021-01-01T00:00:00.000Z').getTime(); const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; - describe.skip('Diagnostics: Index Templates', () => { - describe('When there is no data', () => { - before(async () => { - // delete APM index templates - await es.indices.deleteIndexTemplate({ - name: Object.values(getApmIndexTemplateNames()).flat(), - }); - }); - - it('verifies that none of the default APM index templates exists`', async () => { - const { status, body } = await apmApiClient.adminUser({ - endpoint: 'GET /internal/apm/diagnostics', - }); - expect(status).to.be(200); - const noApmIndexTemplateExists = body.apmIndexTemplates.every( - ({ exists }) => exists === false - ); - expect(noApmIndexTemplateExists).to.eql(true); - }); - }); - + describe('Diagnostics: Index Templates', () => { describe('When data is ingested', () => { let apmSynthtraceEsClient: ApmSynthtraceEsClient; From b2d307a9988925ce856a8c8f893d910fe961c934 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Tue, 12 Nov 2024 16:17:38 +0100 Subject: [PATCH 03/10] filter out apm index templates --- .../diagnostics/index_pattern_settings.spec.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts index 838bc52fa2e5b..bf275661f0089 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts @@ -48,22 +48,27 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon after(() => apmSynthtraceEsClient.clean()); it('returns APM index templates', async () => { + const apmIndexTemplatesPatterns = ['apm', 'otel']; + const { status, body } = await apmApiClient.adminUser({ endpoint: 'GET /internal/apm/diagnostics', }); expect(status).to.be(200); - const templateNames = uniq( + const uniqueTemplateNames = uniq( body.indexTemplatesByIndexPattern.flatMap(({ indexTemplates }) => { return indexTemplates?.map(({ templateName }) => templateName); }) ); - expect(templateNames).to.eql([ + const apmTemplateNames = uniqueTemplateNames.filter((templateName) => + apmIndexTemplatesPatterns.some((pattern) => templateName.includes(pattern)) + ); + + expect(apmTemplateNames).to.eql([ 'logs-apm.error@template', 'logs-apm.app@template', 'logs-otel@template', - 'logs', 'metrics-apm.service_transaction.1m@template', 'metrics-apm.transaction.10m@template', 'metrics-apm.service_summary.10m@template', @@ -79,19 +84,15 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon 'metrics-apm.transaction.60m@template', 'metrics-apm.app@template', 'metrics-otel@template', - 'metrics', 'metrics-service_transaction.10m.otel@template', 'metrics-transaction.10m.otel@template', 'metrics-service_summary.1m.otel@template', 'metrics-service_transaction.60m.otel@template', 'metrics-service_summary.60m.otel@template', - 'metrics-service_destination.1m@template', - 'metrics-service_destination.10m@template', 'metrics-service_summary.10m.otel@template', 'metrics-transaction.1m.otel@template', 'metrics-transaction.60m.otel@template', 'metrics-service_transaction.1m.otel@template', - 'metrics-service_destination.60m@template', 'traces-apm.rum@template', 'traces-apm@template', 'traces-apm.sampled@template', From dd0a870f65bd055e5d4216199d35580180283955 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Tue, 12 Nov 2024 18:30:24 +0100 Subject: [PATCH 04/10] type check fix --- .../apis/observability/apm/diagnostics/index_templates.spec.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts index 548ed489f6aed..38a319e6d1233 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts @@ -12,7 +12,6 @@ import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provi export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { const apmApiClient = getService('apmApi'); - const es = getService('es'); const synthtrace = getService('synthtrace'); const start = new Date('2021-01-01T00:00:00.000Z').getTime(); From 11ce02a9cb9bfcbfdf436cbfb6c3daadbd741f86 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Wed, 13 Nov 2024 13:05:40 +0100 Subject: [PATCH 05/10] Migrate /test/apm_api_integration/tests/service_nodes to be deployment-agnostic API tests --- .../apis/observability/apm/index.ts | 1 + .../service_nodes/get_service_nodes.spec.ts | 100 ++++++++++++++++++ .../observability/apm/service_nodes/index.ts | 14 +++ .../service_nodes/get_service_nodes.spec.ts | 96 ----------------- 4 files changed, 115 insertions(+), 96 deletions(-) create mode 100644 x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/get_service_nodes.spec.ts create mode 100644 x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/index.ts delete mode 100644 x-pack/test/apm_api_integration/tests/service_nodes/get_service_nodes.spec.ts diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/index.ts index 8cde7cb77bca8..221d63de0877f 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/index.ts @@ -23,5 +23,6 @@ export default function apmApiIntegrationTests({ loadTestFile(require.resolve('./entities')); loadTestFile(require.resolve('./cold_start')); loadTestFile(require.resolve('./infrastructure')); + loadTestFile(require.resolve('./service_nodes')); }); } diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/get_service_nodes.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/get_service_nodes.spec.ts new file mode 100644 index 0000000000000..95f0b8defa989 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/get_service_nodes.spec.ts @@ -0,0 +1,100 @@ +/* + * 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 expect from '@kbn/expect'; +import { apm, timerange } from '@kbn/apm-synthtrace-client'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { + const apmApiClient = getService('apmApi'); + const synthtrace = getService('synthtrace'); + + const start = new Date('2021-01-01T00:00:00.000Z').getTime(); + const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; + const serviceName = 'synth-go'; + const instanceName = 'instance-a'; + + async function callApi() { + return await apmApiClient.readUser({ + endpoint: 'GET /internal/apm/services/{serviceName}/metrics/nodes', + params: { + path: { serviceName }, + query: { + start: new Date(start).toISOString(), + end: new Date(end).toISOString(), + kuery: '', + environment: 'ENVIRONMENT_ALL', + }, + }, + }); + } + + describe('Service nodes', () => { + describe('when data is not loaded', () => { + it('handles the empty state', async () => { + const response = await callApi(); + + expect(response.status).to.be(200); + + expectSnapshot(response.body).toMatchInline(` + Object { + "serviceNodes": Array [], + } + `); + }); + }); + + describe('when data is loaded', () => { + let apmSynthtraceEsClient: ApmSynthtraceEsClient; + + before(async () => { + apmSynthtraceEsClient = await synthtrace.createApmSynthtraceEsClient(); + const instance = apm + .service({ name: serviceName, environment: 'production', agentName: 'go' }) + .instance(instanceName); + await apmSynthtraceEsClient.index( + timerange(start, end) + .interval('1m') + .rate(1) + .generator((timestamp) => + instance + .appMetrics({ + 'system.process.cpu.total.norm.pct': 1, + 'jvm.memory.heap.used': 1000, + 'jvm.memory.non_heap.used': 100, + 'jvm.thread.count': 25, + }) + .timestamp(timestamp) + ) + ); + }); + after(() => apmSynthtraceEsClient.clean()); + + it('returns service nodes', async () => { + const response = await callApi(); + + expect(response.status).to.be(200); + + expectSnapshot(response.body).toMatchInline(` + Object { + "serviceNodes": Array [ + Object { + "cpu": 1, + "heapMemory": 1000, + "hostName": "instance-a", + "name": "instance-a", + "nonHeapMemory": 100, + "threadCount": 25, + }, + ], + } + `); + }); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/index.ts new file mode 100644 index 0000000000000..123a76e96e5eb --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/index.ts @@ -0,0 +1,14 @@ +/* + * 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 { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; + +export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { + describe('agent_explorer', () => { + loadTestFile(require.resolve('./get_service_nodes.spec.ts')); + }); +} diff --git a/x-pack/test/apm_api_integration/tests/service_nodes/get_service_nodes.spec.ts b/x-pack/test/apm_api_integration/tests/service_nodes/get_service_nodes.spec.ts deleted file mode 100644 index 6b24587b6bc13..0000000000000 --- a/x-pack/test/apm_api_integration/tests/service_nodes/get_service_nodes.spec.ts +++ /dev/null @@ -1,96 +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 expect from '@kbn/expect'; -import { apm, timerange } from '@kbn/apm-synthtrace-client'; -import { FtrProviderContext } from '../../common/ftr_provider_context'; - -export default function ApiTest({ getService }: FtrProviderContext) { - const apmApiClient = getService('apmApiClient'); - const registry = getService('registry'); - const apmSynthtraceEsClient = getService('apmSynthtraceEsClient'); - - const start = new Date('2021-01-01T00:00:00.000Z').getTime(); - const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1; - const serviceName = 'synth-go'; - const instanceName = 'instance-a'; - - async function callApi() { - return await apmApiClient.readUser({ - endpoint: 'GET /internal/apm/services/{serviceName}/metrics/nodes', - params: { - path: { serviceName }, - query: { - start: new Date(start).toISOString(), - end: new Date(end).toISOString(), - kuery: '', - environment: 'ENVIRONMENT_ALL', - }, - }, - }); - } - - registry.when('Service nodes when data is not loaded', { config: 'basic', archives: [] }, () => { - it('handles the empty state', async () => { - const response = await callApi(); - - expect(response.status).to.be(200); - - expectSnapshot(response.body).toMatchInline(` - Object { - "serviceNodes": Array [], - } - `); - }); - }); - - // FLAKY: https://github.com/elastic/kibana/issues/177496 - registry.when('Service nodes when data is loaded', { config: 'basic', archives: [] }, () => { - before(async () => { - const instance = apm - .service({ name: serviceName, environment: 'production', agentName: 'go' }) - .instance(instanceName); - await apmSynthtraceEsClient.index( - timerange(start, end) - .interval('1m') - .rate(1) - .generator((timestamp) => - instance - .appMetrics({ - 'system.process.cpu.total.norm.pct': 1, - 'jvm.memory.heap.used': 1000, - 'jvm.memory.non_heap.used': 100, - 'jvm.thread.count': 25, - }) - .timestamp(timestamp) - ) - ); - }); - after(() => apmSynthtraceEsClient.clean()); - - it('returns service nodes', async () => { - const response = await callApi(); - - expect(response.status).to.be(200); - - expectSnapshot(response.body).toMatchInline(` - Object { - "serviceNodes": Array [ - Object { - "cpu": 1, - "heapMemory": 1000, - "hostName": "instance-a", - "name": "instance-a", - "nonHeapMemory": 100, - "threadCount": 25, - }, - ], - } - `); - }); - }); -} From ec4c5ccf71f326a099dcc27591f4028f64ebc0f3 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski <38698566+miloszmarcinkowski@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:40:30 +0100 Subject: [PATCH 06/10] Correct describe block title Co-authored-by: Sergi Romeu --- .../apis/observability/apm/service_nodes/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/index.ts index 123a76e96e5eb..54512db4be1ed 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/index.ts @@ -8,7 +8,7 @@ import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { - describe('agent_explorer', () => { + describe('service_nodes', () => { loadTestFile(require.resolve('./get_service_nodes.spec.ts')); }); } From 2bd7daeb9f5121fa9cca124df599b89bea124edc Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Thu, 14 Nov 2024 12:03:01 +0100 Subject: [PATCH 07/10] remove duplicated apm package instalation --- .../apis/observability/apm/diagnostics/data_streams.spec.ts | 3 --- .../apm/diagnostics/index_pattern_settings.spec.ts | 3 --- .../observability/apm/diagnostics/index_templates.spec.ts | 3 --- .../apis/observability/apm/diagnostics/indices.spec.ts | 6 ------ 4 files changed, 15 deletions(-) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/data_streams.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/data_streams.spec.ts index 844e1fa5ea372..1d37c668e91f5 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/data_streams.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/data_streams.spec.ts @@ -47,9 +47,6 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon before(async () => { apmSynthtraceEsClient = await synthtrace.createApmSynthtraceEsClient(); - const apmSynthtraceKibanaClient = synthtrace.apmSynthtraceKibanaClient; - const latestVersion = await apmSynthtraceKibanaClient.fetchLatestApmPackageVersion(); - await apmSynthtraceKibanaClient.installApmPackage(latestVersion); const instance = apm .service({ name: 'synth-go', environment: 'production', agentName: 'go' }) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts index bf275661f0089..5af745432ba10 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts @@ -24,9 +24,6 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon before(async () => { apmSynthtraceEsClient = await synthtrace.createApmSynthtraceEsClient(); - const apmSynthtraceKibanaClient = synthtrace.apmSynthtraceKibanaClient; - const latestVersion = await apmSynthtraceKibanaClient.fetchLatestApmPackageVersion(); - await apmSynthtraceKibanaClient.installApmPackage(latestVersion); const instance = apm .service({ name: 'synth-go', environment: 'production', agentName: 'go' }) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts index 38a319e6d1233..aa45a93a3ce73 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_templates.spec.ts @@ -23,9 +23,6 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon before(async () => { apmSynthtraceEsClient = await synthtrace.createApmSynthtraceEsClient(); - const apmSynthtraceKibanaClient = synthtrace.apmSynthtraceKibanaClient; - const latestVersion = await apmSynthtraceKibanaClient.fetchLatestApmPackageVersion(); - await apmSynthtraceKibanaClient.installApmPackage(latestVersion); const instance = apm .service({ name: 'synth-go', environment: 'production', agentName: 'go' }) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/indices.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/indices.spec.ts index cee70a78190fb..92976e6bce883 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/indices.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/indices.spec.ts @@ -93,9 +93,6 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon after(async () => { await es.indices.delete({ index: 'traces-apm-default' }); - const apmSynthtraceKibanaClient = synthtrace.apmSynthtraceKibanaClient; - const latestVersion = await apmSynthtraceKibanaClient.fetchLatestApmPackageVersion(); - await apmSynthtraceKibanaClient.installApmPackage(latestVersion); await apmSynthtraceEsClient.clean(); }); @@ -138,9 +135,6 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon }); after(async () => { - const apmSynthtraceKibanaClient = synthtrace.apmSynthtraceKibanaClient; - const latestVersion = await apmSynthtraceKibanaClient.fetchLatestApmPackageVersion(); - await apmSynthtraceKibanaClient.installApmPackage(latestVersion); await apmSynthtraceEsClient.clean(); }); From 28c1ba67070dd0781883ce57057f61efa8e20f48 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Thu, 14 Nov 2024 12:09:53 +0100 Subject: [PATCH 08/10] convert to Type-Only imports in `apm/*` tests --- .../apis/observability/apm/agent_explorer/index.ts | 2 +- .../observability/apm/alerts/error_count_threshold.spec.ts | 2 +- .../apis/observability/apm/alerts/index.ts | 2 +- .../apm/alerts/preview_chart_error_count.spec.ts | 2 +- .../observability/apm/alerts/preview_chart_error_rate.spec.ts | 2 +- .../apis/observability/apm/cold_start/index.ts | 2 +- .../apis/observability/apm/correlations/index.ts | 2 +- .../apis/observability/apm/custom_dashboards/index.ts | 2 +- .../apis/observability/apm/data_view/index.ts | 2 +- .../apis/observability/apm/dependencies/index.ts | 2 +- .../observability/apm/dependencies/top_dependencies.spec.ts | 2 +- .../apis/observability/apm/diagnostics/apm_events.spec.ts | 2 +- .../apis/observability/apm/diagnostics/index.ts | 2 +- .../apis/observability/apm/entities/index.ts | 2 +- .../apis/observability/apm/environment/index.ts | 2 +- .../apis/observability/apm/error_rate/index.ts | 2 +- .../apis/observability/apm/error_rate/service_apis.spec.ts | 2 +- .../apis/observability/apm/error_rate/service_maps.spec.ts | 4 ++-- .../apis/observability/apm/historical_data/has_data.spec.ts | 4 ++-- .../apis/observability/apm/historical_data/index.ts | 2 +- .../deployment_agnostic/apis/observability/apm/index.ts | 2 +- .../apis/observability/apm/infrastructure/index.ts | 2 +- .../apm/infrastructure/infrastructure_attributes.spec.ts | 2 +- .../apis/observability/apm/latency/index.ts | 2 +- .../apis/observability/apm/latency/service_apis.spec.ts | 4 ++-- .../apis/observability/apm/latency/service_maps.spec.ts | 4 ++-- .../apis/observability/apm/mobile/generate_mobile_data.ts | 2 +- .../apis/observability/apm/mobile/index.ts | 2 +- .../apis/observability/apm/observability_overview/index.ts | 2 +- .../apm/observability_overview/observability_overview.spec.ts | 2 +- .../apis/observability/apm/service_groups/index.ts | 2 +- .../apm/service_groups/save_service_group.spec.ts | 2 +- .../service_group_count/service_group_count.spec.ts | 4 ++-- .../service_group_with_overflow.spec.ts | 4 ++-- .../apis/observability/apm/service_nodes/index.ts | 2 +- 35 files changed, 41 insertions(+), 41 deletions(-) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/agent_explorer/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/agent_explorer/index.ts index f77b13923930a..ae05cb6b89cbe 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/agent_explorer/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/agent_explorer/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('agent_explorer', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/error_count_threshold.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/error_count_threshold.spec.ts index 16493e8220f68..b7fadc305de54 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/error_count_threshold.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/error_count_threshold.spec.ts @@ -10,7 +10,7 @@ import { errorCountActionVariables } from '@kbn/apm-plugin/server/routes/alerts/ import { apm, timerange } from '@kbn/apm-synthtrace-client'; import expect from '@kbn/expect'; import { omit } from 'lodash'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; import type { RoleCredentials, SupertestWithRoleScopeType } from '../../../../services'; import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; import { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/index.ts index 71661e4cbc8bc..3796b4253e60e 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('alerts', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/preview_chart_error_count.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/preview_chart_error_count.spec.ts index d6792400fc2bc..38bf9d4eade4d 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/preview_chart_error_count.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/preview_chart_error_count.spec.ts @@ -7,7 +7,7 @@ import type { PreviewChartResponseItem } from '@kbn/apm-plugin/server/routes/alerts/route'; import expect from '@kbn/expect'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; import { ERROR_GROUP_ID, SERVICE_ENVIRONMENT, diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/preview_chart_error_rate.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/preview_chart_error_rate.spec.ts index 3e5c0753fbc1d..167b114e755c3 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/preview_chart_error_rate.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/alerts/preview_chart_error_rate.spec.ts @@ -13,7 +13,7 @@ import { } from '@kbn/observability-shared-plugin/common'; import type { PreviewChartResponseItem } from '@kbn/apm-plugin/server/routes/alerts/route'; import expect from '@kbn/expect'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; import { generateErrorData } from './generate_data'; diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/cold_start/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/cold_start/index.ts index a5d8045f227d3..108340514a0c2 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/cold_start/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/cold_start/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('cold_start', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/correlations/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/correlations/index.ts index 660556edb8d79..ffa54dbe7bb5c 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/correlations/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/correlations/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('correlations', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/custom_dashboards/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/custom_dashboards/index.ts index 77f12ca0f88d5..a46024ff1ab10 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/custom_dashboards/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/custom_dashboards/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('custom_dashboards', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/data_view/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/data_view/index.ts index 9412ddca7cbcb..c81b643e62638 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/data_view/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/data_view/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('data_view', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/dependencies/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/dependencies/index.ts index 2acf449ce923d..46ad399380550 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/dependencies/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/dependencies/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('custom_dashboards', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/dependencies/top_dependencies.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/dependencies/top_dependencies.spec.ts index 0fa88b67d3379..21e990a1dbb52 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/dependencies/top_dependencies.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/dependencies/top_dependencies.spec.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { APIReturnType } from '@kbn/apm-plugin/public/services/rest/create_call_apm_api'; import { NodeType, DependencyNode } from '@kbn/apm-plugin/common/connections'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; import { dataConfig, generateData } from './generate_data'; import { roundNumber } from '../utils/common'; diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/apm_events.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/apm_events.spec.ts index 1c6fad6520a11..4ca60e15fa190 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/apm_events.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/apm_events.spec.ts @@ -9,7 +9,7 @@ import expect from '@kbn/expect'; import { apm, timerange } from '@kbn/apm-synthtrace-client'; import { APIReturnType } from '@kbn/apm-plugin/public/services/rest/create_call_apm_api'; import { sumBy } from 'lodash'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index.ts index d9444430c2e5d..192771d3fc75e 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('diagnostics', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/entities/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/entities/index.ts index d7a36e3e447b7..71be4955fe523 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/entities/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/entities/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('entities', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/environment/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/environment/index.ts index 4a77e610d5000..e48a8f88d74c4 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/environment/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/environment/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('environment', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/error_rate/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/error_rate/index.ts index a3dd89f0ddb1a..04ed9b3be1ff0 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/error_rate/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/error_rate/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('error_rate', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/error_rate/service_apis.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/error_rate/service_apis.spec.ts index 56dded824a32d..6a8bca2eefaca 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/error_rate/service_apis.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/error_rate/service_apis.spec.ts @@ -13,7 +13,7 @@ import { isFiniteNumber } from '@kbn/apm-plugin/common/utils/is_finite_number'; import { ApmDocumentType } from '@kbn/apm-plugin/common/document_type'; import { RollupInterval } from '@kbn/apm-plugin/common/rollup'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; const GO_PROD_LIST_RATE = 75; const GO_PROD_LIST_ERROR_RATE = 25; diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/error_rate/service_maps.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/error_rate/service_maps.spec.ts index 462ad8db4bdda..c45f3fd9457d8 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/error_rate/service_maps.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/error_rate/service_maps.spec.ts @@ -5,13 +5,13 @@ * 2.0. */ import { apm, timerange } from '@kbn/apm-synthtrace-client'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; import expect from '@kbn/expect'; import { meanBy } from 'lodash'; import { ApmDocumentType } from '@kbn/apm-plugin/common/document_type'; import { RollupInterval } from '@kbn/apm-plugin/common/rollup'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; const GO_PROD_LIST_RATE = 75; const GO_PROD_LIST_ERROR_RATE = 25; diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/historical_data/has_data.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/historical_data/has_data.spec.ts index 6ac96b8e38154..b6eaca65cad1c 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/historical_data/has_data.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/historical_data/has_data.spec.ts @@ -8,8 +8,8 @@ import expect from '@kbn/expect'; import { apm, timerange } from '@kbn/apm-synthtrace-client'; import moment from 'moment'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { const apmApiClient = getService('apmApi'); diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/historical_data/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/historical_data/index.ts index 49f0068ee313b..0b9c76d21d3b4 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/historical_data/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/historical_data/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('historical_data', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/index.ts index 944672f553f81..e975849983d5a 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; export default function apmApiIntegrationTests({ loadTestFile, diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/infrastructure/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/infrastructure/index.ts index 1351a44d41c8e..3379e3f0fdc23 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/infrastructure/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/infrastructure/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('infrastructure', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/infrastructure/infrastructure_attributes.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/infrastructure/infrastructure_attributes.spec.ts index ca70d8d1fa002..fe9b0246c505b 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/infrastructure/infrastructure_attributes.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/infrastructure/infrastructure_attributes.spec.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; import { generateData } from './generate_data'; -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { const apmApiClient = getService('apmApi'); diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/latency/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/latency/index.ts index 0b9a71293f687..2ff9ec1896c78 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/latency/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/latency/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('latency', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/latency/service_apis.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/latency/service_apis.spec.ts index dee5f27b7a61d..2219a873c0f2d 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/latency/service_apis.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/latency/service_apis.spec.ts @@ -12,8 +12,8 @@ import { isFiniteNumber } from '@kbn/apm-plugin/common/utils/is_finite_number'; import { ApmDocumentType } from '@kbn/apm-plugin/common/document_type'; import { RollupInterval } from '@kbn/apm-plugin/common/rollup'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { const apmApiClient = getService('apmApi'); diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/latency/service_maps.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/latency/service_maps.spec.ts index fa088e4f12dc9..e0bb69306a03f 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/latency/service_maps.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/latency/service_maps.spec.ts @@ -10,8 +10,8 @@ import { meanBy } from 'lodash'; import { ApmDocumentType } from '@kbn/apm-plugin/common/document_type'; import { RollupInterval } from '@kbn/apm-plugin/common/rollup'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { const apmApiClient = getService('apmApi'); diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/generate_mobile_data.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/generate_mobile_data.ts index a4420b3f53c7c..fa3323c411d61 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/generate_mobile_data.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/generate_mobile_data.ts @@ -5,7 +5,7 @@ * 2.0. */ import { apm, timerange } from '@kbn/apm-synthtrace-client'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; export const SERVICE_VERSIONS = ['2.3', '1.2', '1.1']; diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/index.ts index 97d8e13256d60..d54eb187b29c6 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/mobile/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('Mobile', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/observability_overview/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/observability_overview/index.ts index c43e15d005bb9..bbb35976f8175 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/observability_overview/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/observability_overview/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('observability_overview', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/observability_overview/observability_overview.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/observability_overview/observability_overview.spec.ts index 740dd432b670b..796ef08f70250 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/observability_overview/observability_overview.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/observability_overview/observability_overview.spec.ts @@ -9,7 +9,7 @@ import expect from '@kbn/expect'; import { meanBy, sumBy } from 'lodash'; import { ApmDocumentType } from '@kbn/apm-plugin/common/document_type'; import { RollupInterval } from '@kbn/apm-plugin/common/rollup'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; import { roundNumber } from '../../../../../../apm_api_integration/utils'; import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/index.ts index e88208d48a9b5..458361077c208 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('service_groups', () => { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/save_service_group.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/save_service_group.spec.ts index a0ed02739cf9f..0b4db96e880e3 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/save_service_group.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/save_service_group.spec.ts @@ -5,7 +5,7 @@ * 2.0. */ import expect from '@kbn/expect'; -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; import { ApmApiError } from '../../../../../../apm_api_integration/common/apm_api_supertest'; import { expectToReject } from '../../../../../../apm_api_integration/common/utils/expect_to_reject'; import { diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/service_group_count/service_group_count.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/service_group_count/service_group_count.spec.ts index 21ac03197a422..cbb29e2729dcb 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/service_group_count/service_group_count.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/service_group_count/service_group_count.spec.ts @@ -5,8 +5,8 @@ * 2.0. */ import expect from '@kbn/expect'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; -import { DeploymentAgnosticFtrProviderContext } from '../../../../../ftr_provider_context'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../../ftr_provider_context'; import { createServiceGroupApi, deleteAllServiceGroups, diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/service_group_with_overflow/service_group_with_overflow.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/service_group_with_overflow/service_group_with_overflow.spec.ts index 9324dee60d4e7..b5cbf1ae2566c 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/service_group_with_overflow/service_group_with_overflow.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_groups/service_group_with_overflow/service_group_with_overflow.spec.ts @@ -9,8 +9,8 @@ import { ValuesType } from 'utility-types'; import { ENVIRONMENT_ALL } from '@kbn/apm-plugin/common/environment_filter_values'; import { ApmDocumentType } from '@kbn/apm-plugin/common/document_type'; import { RollupInterval } from '@kbn/apm-plugin/common/rollup'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; -import { DeploymentAgnosticFtrProviderContext } from '../../../../../ftr_provider_context'; +import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../../ftr_provider_context'; import { createServiceGroupApi, deleteAllServiceGroups } from '../service_groups_api_methods'; import { createServiceTransactionMetricsDocs } from './es_utils'; import { generateData } from './generate_data'; diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/index.ts index 54512db4be1ed..18315aade3b31 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/service_nodes/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { describe('service_nodes', () => { From 7a56f8cb65b883e0429ffe4ff435c3bd47cb71f4 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Thu, 14 Nov 2024 13:05:38 +0100 Subject: [PATCH 09/10] adjust index_pattern_settings.spec.ts to work in all testing environments --- .../index_pattern_settings.spec.ts | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts index 5af745432ba10..8235e2a179d4c 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/diagnostics/index_pattern_settings.spec.ts @@ -52,47 +52,54 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon }); expect(status).to.be(200); + // filtering the array for unique index templates because they get duplicated across different index patterns const uniqueTemplateNames = uniq( body.indexTemplatesByIndexPattern.flatMap(({ indexTemplates }) => { return indexTemplates?.map(({ templateName }) => templateName); }) ); - const apmTemplateNames = uniqueTemplateNames.filter((templateName) => - apmIndexTemplatesPatterns.some((pattern) => templateName.includes(pattern)) + // filter only APM releated indices + const apmTemplateNames = uniqueTemplateNames.filter( + (templateName) => + templateName.endsWith('@template') && + apmIndexTemplatesPatterns.some((pattern) => templateName.includes(pattern)) ); - expect(apmTemplateNames).to.eql([ - 'logs-apm.error@template', + // sort alphabeticaly before comparing because an order is different between testing environments + const sortedApmTemplates = apmTemplateNames.sort(); + + expect(sortedApmTemplates).to.eql([ 'logs-apm.app@template', + 'logs-apm.error@template', 'logs-otel@template', - 'metrics-apm.service_transaction.1m@template', - 'metrics-apm.transaction.10m@template', - 'metrics-apm.service_summary.10m@template', + 'metrics-apm.app@template', 'metrics-apm.internal@template', + 'metrics-apm.service_destination.10m@template', 'metrics-apm.service_destination.1m@template', - 'metrics-apm.service_summary.60m@template', - 'metrics-apm.service_summary.1m@template', - 'metrics-apm.transaction.1m@template', 'metrics-apm.service_destination.60m@template', - 'metrics-apm.service_transaction.60m@template', - 'metrics-apm.service_destination.10m@template', + 'metrics-apm.service_summary.10m@template', + 'metrics-apm.service_summary.1m@template', + 'metrics-apm.service_summary.60m@template', 'metrics-apm.service_transaction.10m@template', + 'metrics-apm.service_transaction.1m@template', + 'metrics-apm.service_transaction.60m@template', + 'metrics-apm.transaction.10m@template', + 'metrics-apm.transaction.1m@template', 'metrics-apm.transaction.60m@template', - 'metrics-apm.app@template', 'metrics-otel@template', - 'metrics-service_transaction.10m.otel@template', - 'metrics-transaction.10m.otel@template', + 'metrics-service_summary.10m.otel@template', 'metrics-service_summary.1m.otel@template', - 'metrics-service_transaction.60m.otel@template', 'metrics-service_summary.60m.otel@template', - 'metrics-service_summary.10m.otel@template', + 'metrics-service_transaction.10m.otel@template', + 'metrics-service_transaction.1m.otel@template', + 'metrics-service_transaction.60m.otel@template', + 'metrics-transaction.10m.otel@template', 'metrics-transaction.1m.otel@template', 'metrics-transaction.60m.otel@template', - 'metrics-service_transaction.1m.otel@template', 'traces-apm.rum@template', - 'traces-apm@template', 'traces-apm.sampled@template', + 'traces-apm@template', 'traces-otel@template', ]); }); From 2e2d1106ad0c0e35e082c453c0b15dd92f095804 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:23:44 +0000 Subject: [PATCH 10/10] [CI] Auto-commit changed files from 'make api-docs' --- oas_docs/output/kibana.serverless.yaml | 12 +++--------- oas_docs/output/kibana.yaml | 12 +++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 32d38c3569148..9f0c38baded7d 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -16693,14 +16693,10 @@ paths: type: object properties: active: - description: >- - When false, the enrollment API key is revoked and - cannot be used for enrolling Elastic Agents. + description: When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. type: boolean api_key: - description: >- - The enrollment API key (token) used for enrolling - Elastic Agents. + description: The enrollment API key (token) used for enrolling Elastic Agents. type: string api_key_id: description: The ID of the API key in the Security API. @@ -16713,9 +16709,7 @@ paths: description: The name of the enrollment API key. type: string policy_id: - description: >- - The ID of the agent policy the Elastic Agent will be - enrolled in. + description: The ID of the agent policy the Elastic Agent will be enrolled in. type: string required: - id diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 8a3d4d3634b8d..50fd92fdc8a9c 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -19477,14 +19477,10 @@ paths: type: object properties: active: - description: >- - When false, the enrollment API key is revoked and - cannot be used for enrolling Elastic Agents. + description: When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. type: boolean api_key: - description: >- - The enrollment API key (token) used for enrolling - Elastic Agents. + description: The enrollment API key (token) used for enrolling Elastic Agents. type: string api_key_id: description: The ID of the API key in the Security API. @@ -19497,9 +19493,7 @@ paths: description: The name of the enrollment API key. type: string policy_id: - description: >- - The ID of the agent policy the Elastic Agent will be - enrolled in. + description: The ID of the agent policy the Elastic Agent will be enrolled in. type: string required: - id