diff --git a/.buildkite/pipeline-utils/ci-stats/on_complete.ts b/.buildkite/pipeline-utils/ci-stats/on_complete.ts index 0b93fd6b0673f..e0ef78a2f61c2 100644 --- a/.buildkite/pipeline-utils/ci-stats/on_complete.ts +++ b/.buildkite/pipeline-utils/ci-stats/on_complete.ts @@ -26,7 +26,12 @@ export async function onComplete() { return; } - const report = await ciStats.getPrReport(process.env.CI_STATS_BUILD_ID); + const backfillJobIds: string[] = []; + if (process.env.KIBANA_REUSABLE_BUILD_JOB_ID) { + backfillJobIds.push(process.env.KIBANA_REUSABLE_BUILD_JOB_ID); + } + + const report = await ciStats.getPrReport(process.env.CI_STATS_BUILD_ID, backfillJobIds); if (report?.md) { buildkite.setMetadata('pr_comment:ci_stats_report:body', report.md); diff --git a/.buildkite/scripts/lifecycle/pre_build.sh b/.buildkite/scripts/lifecycle/pre_build.sh index 107e555a430c9..62f94dd493fa8 100755 --- a/.buildkite/scripts/lifecycle/pre_build.sh +++ b/.buildkite/scripts/lifecycle/pre_build.sh @@ -20,3 +20,11 @@ if [[ ! "${ES_SNAPSHOT_MANIFEST:-}" ]]; then ES_SNAPSHOT_MANIFEST_DEFAULT="https://storage.googleapis.com/$BUCKET/manifest.json" buildkite-agent meta-data set ES_SNAPSHOT_MANIFEST_DEFAULT "$ES_SNAPSHOT_MANIFEST_DEFAULT" fi + +if [[ "${KIBANA_BUILD_ID:-}" && "${KIBANA_REUSABLE_BUILD_JOB_URL:-}" ]]; then + cat << EOF | buildkite-agent annotate --style default --context kibana-reusable-build + This build is using the Kibana distributable built from a different job, as the changes since this build do not seem to require a rebuild. + + See job here: $KIBANA_REUSABLE_BUILD_JOB_URL +EOF +fi diff --git a/fleet_packages.json b/fleet_packages.json index 4088209fae406..0f443687a54c7 100644 --- a/fleet_packages.json +++ b/fleet_packages.json @@ -31,6 +31,6 @@ }, { "name": "synthetics", - "version": "0.9.4" + "version": "0.10.1" } ] diff --git a/src/plugins/saved_objects/public/finder/saved_object_finder.test.tsx b/src/plugins/saved_objects/public/finder/saved_object_finder.test.tsx index 260c74cded3ec..bb33de184f6ce 100644 --- a/src/plugins/saved_objects/public/finder/saved_object_finder.test.tsx +++ b/src/plugins/saved_objects/public/finder/saved_object_finder.test.tsx @@ -48,6 +48,7 @@ describe('SavedObjectsFinder', () => { name: 'Search', getIconForSavedObject: () => 'search' as IconType, showSavedObject: () => true, + defaultSearchField: 'name', }, ]; @@ -73,7 +74,7 @@ describe('SavedObjectsFinder', () => { search: undefined, page: 1, perPage: 10, - searchFields: ['title^3', 'description'], + searchFields: ['title^3', 'description', 'name'], defaultSearchOperator: 'AND', }); }); @@ -228,7 +229,7 @@ describe('SavedObjectsFinder', () => { search: 'abc*', page: 1, perPage: 10, - searchFields: ['title^3', 'description'], + searchFields: ['title^3', 'description', 'name'], defaultSearchOperator: 'AND', }); }); diff --git a/src/plugins/saved_objects/public/finder/saved_object_finder.tsx b/src/plugins/saved_objects/public/finder/saved_object_finder.tsx index 3eb5fd97142a1..b3cf81cbbdf85 100644 --- a/src/plugins/saved_objects/public/finder/saved_object_finder.tsx +++ b/src/plugins/saved_objects/public/finder/saved_object_finder.tsx @@ -48,6 +48,7 @@ export interface SavedObjectMetaData { showSavedObject?(savedObject: SimpleSavedObject): boolean; getSavedObjectSubType?(savedObject: SimpleSavedObject): string; includeFields?: string[]; + defaultSearchField?: string; } interface FinderAttributes { @@ -125,6 +126,13 @@ class SavedObjectFinderUi extends React.Component< .map((metaData) => metaData.includeFields || []) .reduce((allFields, currentFields) => allFields.concat(currentFields), ['title', 'name']); + const additionalSearchFields = Object.values(metaDataMap).reduce((col, item) => { + if (item.defaultSearchField) { + col.push(item.defaultSearchField); + } + return col; + }, []); + const perPage = this.props.uiSettings.get(LISTING_LIMIT_SETTING); const resp = await this.props.savedObjects.client.find({ type: Object.keys(metaDataMap), @@ -132,7 +140,7 @@ class SavedObjectFinderUi extends React.Component< search: query ? `${query}*` : undefined, page: 1, perPage, - searchFields: ['title^3', 'description'], + searchFields: ['title^3', 'description', ...additionalSearchFields], defaultSearchOperator: 'AND', }); diff --git a/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx b/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx index 51a5c5b47156a..4316845b8972f 100644 --- a/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx +++ b/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx @@ -86,6 +86,7 @@ export class SearchSelection extends React.Component { defaultMessage: 'Data view', } ), + defaultSearchField: 'name', }, ]} fixedPageSize={this.fixedPageSize} diff --git a/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap b/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap index b212d4bee63ab..1c7d4dddab38c 100644 --- a/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap +++ b/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap @@ -11,8 +11,6 @@ exports[`Error AGENT_NAME 1`] = `"java"`; exports[`Error AGENT_VERSION 1`] = `"agent version"`; -exports[`Error CLIENT_GEO 1`] = `undefined`; - exports[`Error CLIENT_GEO_COUNTRY_ISO_CODE 1`] = `undefined`; exports[`Error CLOUD 1`] = ` @@ -39,8 +37,6 @@ exports[`Error CLOUD_REGION 1`] = `"europe-west1"`; exports[`Error CLOUD_SERVICE_NAME 1`] = `undefined`; -exports[`Error CLS_FIELD 1`] = `undefined`; - exports[`Error CONTAINER_ID 1`] = `undefined`; exports[`Error DESTINATION_ADDRESS 1`] = `undefined`; @@ -71,10 +67,6 @@ exports[`Error FAAS_ID 1`] = `undefined`; exports[`Error FAAS_TRIGGER_TYPE 1`] = `undefined`; -exports[`Error FCP_FIELD 1`] = `undefined`; - -exports[`Error FID_FIELD 1`] = `undefined`; - exports[`Error HOST 1`] = ` Object { "hostname": "my hostname", @@ -95,8 +87,6 @@ exports[`Error KUBERNETES 1`] = `undefined`; exports[`Error LABEL_NAME 1`] = `undefined`; -exports[`Error LCP_FIELD 1`] = `undefined`; - exports[`Error METRIC_CGROUP_MEMORY_LIMIT_BYTES 1`] = `undefined`; exports[`Error METRIC_CGROUP_MEMORY_USAGE_BYTES 1`] = `undefined`; @@ -145,8 +135,6 @@ exports[`Error PROFILE_ALLOC_SPACE 1`] = `undefined`; exports[`Error PROFILE_CPU_NS 1`] = `undefined`; -exports[`Error PROFILE_DURATION 1`] = `undefined`; - exports[`Error PROFILE_ID 1`] = `undefined`; exports[`Error PROFILE_INUSE_OBJECTS 1`] = `undefined`; @@ -217,12 +205,8 @@ exports[`Error SPAN_SUBTYPE 1`] = `undefined`; exports[`Error SPAN_TYPE 1`] = `undefined`; -exports[`Error TBT_FIELD 1`] = `undefined`; - exports[`Error TRACE_ID 1`] = `"trace id"`; -exports[`Error TRANSACTION_DOM_INTERACTIVE 1`] = `undefined`; - exports[`Error TRANSACTION_DURATION 1`] = `undefined`; exports[`Error TRANSACTION_DURATION_HISTOGRAM 1`] = `undefined`; @@ -239,8 +223,6 @@ exports[`Error TRANSACTION_ROOT 1`] = `undefined`; exports[`Error TRANSACTION_SAMPLED 1`] = `undefined`; -exports[`Error TRANSACTION_TIME_TO_FIRST_BYTE 1`] = `undefined`; - exports[`Error TRANSACTION_TYPE 1`] = `"request"`; exports[`Error TRANSACTION_URL 1`] = `undefined`; @@ -268,8 +250,6 @@ exports[`Span AGENT_NAME 1`] = `"java"`; exports[`Span AGENT_VERSION 1`] = `"agent version"`; -exports[`Span CLIENT_GEO 1`] = `undefined`; - exports[`Span CLIENT_GEO_COUNTRY_ISO_CODE 1`] = `undefined`; exports[`Span CLOUD 1`] = ` @@ -296,8 +276,6 @@ exports[`Span CLOUD_REGION 1`] = `"europe-west1"`; exports[`Span CLOUD_SERVICE_NAME 1`] = `undefined`; -exports[`Span CLS_FIELD 1`] = `undefined`; - exports[`Span CONTAINER_ID 1`] = `undefined`; exports[`Span DESTINATION_ADDRESS 1`] = `undefined`; @@ -328,10 +306,6 @@ exports[`Span FAAS_ID 1`] = `undefined`; exports[`Span FAAS_TRIGGER_TYPE 1`] = `undefined`; -exports[`Span FCP_FIELD 1`] = `undefined`; - -exports[`Span FID_FIELD 1`] = `undefined`; - exports[`Span HOST 1`] = `undefined`; exports[`Span HOST_HOSTNAME 1`] = `undefined`; @@ -348,8 +322,6 @@ exports[`Span KUBERNETES 1`] = `undefined`; exports[`Span LABEL_NAME 1`] = `undefined`; -exports[`Span LCP_FIELD 1`] = `undefined`; - exports[`Span METRIC_CGROUP_MEMORY_LIMIT_BYTES 1`] = `undefined`; exports[`Span METRIC_CGROUP_MEMORY_USAGE_BYTES 1`] = `undefined`; @@ -398,8 +370,6 @@ exports[`Span PROFILE_ALLOC_SPACE 1`] = `undefined`; exports[`Span PROFILE_CPU_NS 1`] = `undefined`; -exports[`Span PROFILE_DURATION 1`] = `undefined`; - exports[`Span PROFILE_ID 1`] = `undefined`; exports[`Span PROFILE_INUSE_OBJECTS 1`] = `undefined`; @@ -466,12 +436,8 @@ exports[`Span SPAN_SUBTYPE 1`] = `"my subtype"`; exports[`Span SPAN_TYPE 1`] = `"span type"`; -exports[`Span TBT_FIELD 1`] = `undefined`; - exports[`Span TRACE_ID 1`] = `"trace id"`; -exports[`Span TRANSACTION_DOM_INTERACTIVE 1`] = `undefined`; - exports[`Span TRANSACTION_DURATION 1`] = `undefined`; exports[`Span TRANSACTION_DURATION_HISTOGRAM 1`] = `undefined`; @@ -488,8 +454,6 @@ exports[`Span TRANSACTION_ROOT 1`] = `undefined`; exports[`Span TRANSACTION_SAMPLED 1`] = `undefined`; -exports[`Span TRANSACTION_TIME_TO_FIRST_BYTE 1`] = `undefined`; - exports[`Span TRANSACTION_TYPE 1`] = `undefined`; exports[`Span TRANSACTION_URL 1`] = `undefined`; @@ -517,8 +481,6 @@ exports[`Transaction AGENT_NAME 1`] = `"java"`; exports[`Transaction AGENT_VERSION 1`] = `"agent version"`; -exports[`Transaction CLIENT_GEO 1`] = `undefined`; - exports[`Transaction CLIENT_GEO_COUNTRY_ISO_CODE 1`] = `undefined`; exports[`Transaction CLOUD 1`] = ` @@ -545,8 +507,6 @@ exports[`Transaction CLOUD_REGION 1`] = `"europe-west1"`; exports[`Transaction CLOUD_SERVICE_NAME 1`] = `undefined`; -exports[`Transaction CLS_FIELD 1`] = `undefined`; - exports[`Transaction CONTAINER_ID 1`] = `"container1234567890abcdef"`; exports[`Transaction DESTINATION_ADDRESS 1`] = `undefined`; @@ -577,10 +537,6 @@ exports[`Transaction FAAS_ID 1`] = `undefined`; exports[`Transaction FAAS_TRIGGER_TYPE 1`] = `undefined`; -exports[`Transaction FCP_FIELD 1`] = `undefined`; - -exports[`Transaction FID_FIELD 1`] = `undefined`; - exports[`Transaction HOST 1`] = ` Object { "hostname": "my hostname", @@ -607,8 +563,6 @@ Object { exports[`Transaction LABEL_NAME 1`] = `undefined`; -exports[`Transaction LCP_FIELD 1`] = `undefined`; - exports[`Transaction METRIC_CGROUP_MEMORY_LIMIT_BYTES 1`] = `undefined`; exports[`Transaction METRIC_CGROUP_MEMORY_USAGE_BYTES 1`] = `undefined`; @@ -657,8 +611,6 @@ exports[`Transaction PROFILE_ALLOC_SPACE 1`] = `undefined`; exports[`Transaction PROFILE_CPU_NS 1`] = `undefined`; -exports[`Transaction PROFILE_DURATION 1`] = `undefined`; - exports[`Transaction PROFILE_ID 1`] = `undefined`; exports[`Transaction PROFILE_INUSE_OBJECTS 1`] = `undefined`; @@ -729,12 +681,8 @@ exports[`Transaction SPAN_SUBTYPE 1`] = `undefined`; exports[`Transaction SPAN_TYPE 1`] = `undefined`; -exports[`Transaction TBT_FIELD 1`] = `undefined`; - exports[`Transaction TRACE_ID 1`] = `"trace id"`; -exports[`Transaction TRANSACTION_DOM_INTERACTIVE 1`] = `undefined`; - exports[`Transaction TRANSACTION_DURATION 1`] = `1337`; exports[`Transaction TRANSACTION_DURATION_HISTOGRAM 1`] = `undefined`; @@ -751,8 +699,6 @@ exports[`Transaction TRANSACTION_ROOT 1`] = `undefined`; exports[`Transaction TRANSACTION_SAMPLED 1`] = `true`; -exports[`Transaction TRANSACTION_TIME_TO_FIRST_BYTE 1`] = `undefined`; - exports[`Transaction TRANSACTION_TYPE 1`] = `"transaction type"`; exports[`Transaction TRANSACTION_URL 1`] = `"http://www.elastic.co"`; diff --git a/x-pack/plugins/apm/common/dependencies.ts b/x-pack/plugins/apm/common/dependencies.ts index 51f0d505d5df8..de7dc69639b6d 100644 --- a/x-pack/plugins/apm/common/dependencies.ts +++ b/x-pack/plugins/apm/common/dependencies.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { ProcessorEvent } from './processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { PROCESSOR_EVENT, SPAN_DESTINATION_SERVICE_RESOURCE, diff --git a/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts b/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts index e4970ea2ac067..43d58a6f60a98 100644 --- a/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts +++ b/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts @@ -128,23 +128,10 @@ export const CLIENT_GEO_COUNTRY_ISO_CODE = 'client.geo.country_iso_code'; // RUM Labels export const TRANSACTION_URL = 'url.full'; -export const CLIENT_GEO = 'client.geo'; export const USER_AGENT_DEVICE = 'user_agent.device.name'; export const USER_AGENT_OS = 'user_agent.os.name'; -export const TRANSACTION_TIME_TO_FIRST_BYTE = - 'transaction.marks.agent.timeToFirstByte'; -export const TRANSACTION_DOM_INTERACTIVE = - 'transaction.marks.agent.domInteractive'; - -export const FCP_FIELD = 'transaction.marks.agent.firstContentfulPaint'; -export const LCP_FIELD = 'transaction.marks.agent.largestContentfulPaint'; -export const TBT_FIELD = 'transaction.experience.tbt'; -export const FID_FIELD = 'transaction.experience.fid'; -export const CLS_FIELD = 'transaction.experience.cls'; - export const PROFILE_ID = 'profile.id'; -export const PROFILE_DURATION = 'profile.duration'; export const PROFILE_TOP_ID = 'profile.top.id'; export const PROFILE_STACK = 'profile.stack'; diff --git a/x-pack/plugins/apm/common/processor_event.ts b/x-pack/plugins/apm/common/processor_event.ts index 38f9fd7838db0..ba4626e85ee2e 100644 --- a/x-pack/plugins/apm/common/processor_event.ts +++ b/x-pack/plugins/apm/common/processor_event.ts @@ -4,16 +4,9 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import * as t from 'io-ts'; -export enum ProcessorEvent { - transaction = 'transaction', - error = 'error', - metric = 'metric', - span = 'span', - profile = 'profile', -} - export const processorEventRt = t.union([ t.literal(ProcessorEvent.transaction), t.literal(ProcessorEvent.error), diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/comparison.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/comparison.spec.ts similarity index 68% rename from x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/comparison.ts rename to x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/comparison.spec.ts index 00455444b414b..d3ac4cc0e095f 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/comparison.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/comparison.spec.ts @@ -8,14 +8,9 @@ import { synthtrace } from '../../../../synthtrace'; import { opbeans } from '../../../fixtures/synthtrace/opbeans'; -const settingsPath = '/app/management/kibana/settings'; - const start = '2021-10-10T00:00:00.000Z'; const end = '2021-10-10T00:15:00.000Z'; -describe.skip('Comparison feature flag', () => { - const comparisonToggle = - '[data-test-subj="advancedSetting-editField-observability:enableComparisonByDefault"]'; - +describe('Comparison feature flag', () => { before(async () => { await synthtrace.index( opbeans({ @@ -29,17 +24,9 @@ describe.skip('Comparison feature flag', () => { await synthtrace.clean(); }); - beforeEach(() => { - cy.loginAsEditorUser(); - }); - describe('when comparison feature is enabled', () => { - it('shows the flag as enabled in kibana advanced settings', () => { - cy.visit(settingsPath); - - cy.get(comparisonToggle) - .should('have.attr', 'aria-checked') - .and('equal', 'true'); + beforeEach(() => { + cy.loginAsEditorUser(); }); it('shows the comparison feature enabled in services overview', () => { @@ -62,24 +49,19 @@ describe.skip('Comparison feature flag', () => { }); describe('when comparison feature is disabled', () => { - // Reverts to default state, which is comparison enabled - after(() => { - cy.visit(settingsPath); - cy.get(comparisonToggle).click(); - cy.contains('Save changes').should('not.be.disabled'); - cy.contains('Save changes').click(); + beforeEach(() => { + cy.loginAsEditorUser().then(() => { + // Disables comparison feature on advanced settings + cy.updateAdvancedSettings({ + 'observability:enableComparisonByDefault': false, + }); + }); }); - it('shows the flag as disabled in kibana advanced settings', () => { - cy.visit(settingsPath); - cy.get(comparisonToggle).click(); - cy.contains('Save changes').should('not.be.disabled'); - cy.contains('Save changes').click(); - cy.get(comparisonToggle).should('not.be.checked'); - - cy.get(comparisonToggle) - .should('have.attr', 'aria-checked') - .and('equal', 'false'); + after(() => { + cy.updateAdvancedSettings({ + 'observability:enableComparisonByDefault': true, + }); }); it('shows the comparison feature disabled in services overview', () => { @@ -89,7 +71,11 @@ describe.skip('Comparison feature flag', () => { }); it('shows the comparison feature disabled in dependencies overview page', () => { + cy.intercept('GET', '/internal/apm/dependencies/top_dependencies?*').as( + 'topDependenciesRequest' + ); cy.visit('/app/apm/dependencies'); + cy.wait('@topDependenciesRequest', { requestTimeout: 10000 }); cy.get('input[type="checkbox"]#comparison').should('not.be.checked'); cy.get('[data-test-subj="comparisonSelect"]').should('be.disabled'); }); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/infrastructure.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/infrastructure.spec.ts index d64c84883a071..99178c810067e 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/infrastructure.spec.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/infrastructure.spec.ts @@ -8,16 +8,12 @@ import { synthtrace } from '../../../../synthtrace'; import { opbeans } from '../../../fixtures/synthtrace/opbeans'; -const settingsPath = '/app/management/kibana/settings'; const serviceOverviewPath = '/app/apm/services/opbeans-python/overview'; const start = '2021-10-10T00:00:00.000Z'; const end = '2021-10-10T00:15:00.000Z'; -describe.skip('Infrastracture feature flag', () => { - const infraToggle = - '[data-test-subj="advancedSetting-editField-observability:enableInfrastructureView"]'; - +describe('Infrastracture feature flag', () => { before(async () => { await synthtrace.index( opbeans({ @@ -31,17 +27,14 @@ describe.skip('Infrastracture feature flag', () => { await synthtrace.clean(); }); - beforeEach(() => { - cy.loginAsEditorUser(); - }); - describe('when infrastracture feature is enabled', () => { - it('shows the flag as enabled in kibana advanced settings', () => { - cy.visit(settingsPath); - - cy.get(infraToggle) - .should('have.attr', 'aria-checked') - .and('equal', 'true'); + beforeEach(() => { + cy.loginAsEditorUser().then(() => { + // enables infrastructure view feature on advanced settings + cy.updateAdvancedSettings({ + 'observability:enableInfrastructureView': true, + }); + }); }); it('shows infrastructure tab in service overview page', () => { @@ -51,15 +44,13 @@ describe.skip('Infrastracture feature flag', () => { }); describe('when infrastracture feature is disabled', () => { - it('shows the flag as disabled in kibana advanced settings', () => { - cy.visit(settingsPath); - cy.get(infraToggle).click(); - cy.contains('Save changes').should('not.be.disabled'); - cy.contains('Save changes').click(); - - cy.get(infraToggle) - .should('have.attr', 'aria-checked') - .and('equal', 'false'); + beforeEach(() => { + cy.loginAsEditorUser().then(() => { + // enables infrastructure view feature on advanced settings + cy.updateAdvancedSettings({ + 'observability:enableInfrastructureView': false, + }); + }); }); it('hides infrastructure tab in service overview page', () => { diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts b/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts index 94c1f44cbcffc..0559b07b1cbf2 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts @@ -11,11 +11,11 @@ import moment from 'moment'; import { AXE_CONFIG, AXE_OPTIONS } from '@kbn/axe-config'; Cypress.Commands.add('loginAsViewerUser', () => { - cy.loginAs({ username: 'viewer', password: 'changeme' }); + return cy.loginAs({ username: 'viewer', password: 'changeme' }); }); Cypress.Commands.add('loginAsEditorUser', () => { - cy.loginAs({ username: 'editor', password: 'changeme' }); + return cy.loginAs({ username: 'editor', password: 'changeme' }); }); Cypress.Commands.add( @@ -23,7 +23,7 @@ Cypress.Commands.add( ({ username, password }: { username: string; password: string }) => { cy.log(`Logging in as ${username}`); const kibanaUrl = Cypress.env('KIBANA_URL'); - cy.request({ + return cy.request({ log: false, method: 'POST', url: `${kibanaUrl}/internal/security/login`, @@ -84,6 +84,22 @@ Cypress.Commands.add( } ); +Cypress.Commands.add( + 'updateAdvancedSettings', + (settings: Record) => { + const kibanaUrl = Cypress.env('KIBANA_URL'); + cy.request({ + log: false, + method: 'POST', + url: `${kibanaUrl}/api/kibana/settings`, + body: { changes: settings }, + headers: { + 'kbn-xsrf': 'e2e_test', + }, + }); + } +); + // A11y configuration const axeConfig = { diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts b/x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts index 0230ab1ef23a1..f46a54142de0e 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts @@ -7,14 +7,18 @@ declare namespace Cypress { interface Chainable { - loginAsViewerUser(): void; - loginAsEditorUser(): void; - loginAs(params: { username: string; password: string }): void; + loginAsViewerUser(): Cypress.Chainable>; + loginAsEditorUser(): Cypress.Chainable>; + loginAs(params: { + username: string; + password: string; + }): Cypress.Chainable>; changeTimeRange(value: string): void; selectAbsoluteTimeRange(start: string, end: string): void; expectAPIsToHaveBeenCalledWith(params: { apisIntercepted: string[]; value: string; }): void; + updateAdvancedSettings(settings: Record): void; } } diff --git a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx index e9093a28cbab9..8ca7c096d994e 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx @@ -28,6 +28,7 @@ import { i18n } from '@kbn/i18n'; import { useUiTracker } from '@kbn/observability-plugin/public'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { asPercent, asPreciseDecimal, @@ -55,7 +56,6 @@ import { OnAddFilter } from './context_popover/top_values'; import { useFailedTransactionsCorrelations } from './use_failed_transactions_correlations'; import { getTransactionDistributionChartData } from './get_transaction_distribution_chart_data'; import { ChartTitleToolTip } from './chart_title_tool_tip'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { MIN_TAB_TITLE_HEIGHT } from '../../shared/charts/duration_distribution_chart_with_scrubber'; import { TotalDocCountLabel } from '../../shared/charts/duration_distribution_chart/total_doc_count_label'; diff --git a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx index fde85387be4fa..35941d960d62e 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx @@ -27,6 +27,7 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { useUiTracker } from '@kbn/observability-plugin/public'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { asPreciseDecimal } from '../../../../common/utils/formatters'; import { LatencyCorrelation } from '../../../../common/correlations/latency_correlations/types'; import { FieldStats } from '../../../../common/correlations/field_stats_types'; @@ -51,7 +52,6 @@ import { getTransactionDistributionChartData } from './get_transaction_distribut import { useTheme } from '../../../hooks/use_theme'; import { ChartTitleToolTip } from './chart_title_tool_tip'; import { getLatencyCorrelationImpactLabel } from './utils/get_failed_transactions_correlation_impact_label'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { MIN_TAB_TITLE_HEIGHT } from '../../shared/charts/duration_distribution_chart_with_scrubber'; export function FallbackCorrelationBadge() { diff --git a/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/dependendecy_operation_distribution_chart.tsx b/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/dependendecy_operation_distribution_chart.tsx index be4a6f407ed7d..8d53c90887f01 100644 --- a/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/dependendecy_operation_distribution_chart.tsx +++ b/x-pack/plugins/apm/public/components/app/dependency_operation_detail_view/dependendecy_operation_distribution_chart.tsx @@ -5,9 +5,9 @@ * 2.0. */ import { i18n } from '@kbn/i18n'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import React from 'react'; import { DEFAULT_PERCENTILE_THRESHOLD } from '../../../../common/correlations/constants'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { useApmParams } from '../../../hooks/use_apm_params'; import { useFetcher } from '../../../hooks/use_fetcher'; import { useSampleChartSelection } from '../../../hooks/use_sample_chart_selection'; diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx index 495ecca256428..fcc70bed96e28 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx @@ -10,6 +10,7 @@ import { EuiSpacer } from '@elastic/eui'; import React from 'react'; import { useHistory } from 'react-router-dom'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; @@ -17,7 +18,6 @@ import type { TabContentProps } from '../types'; import { useWaterfallFetcher } from '../use_waterfall_fetcher'; import { WaterfallWithSummary } from '../waterfall_with_summary'; -import { ProcessorEvent } from '../../../../../common/processor_event'; import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; import { useApmParams } from '../../../../hooks/use_apm_params'; import { useTimeRange } from '../../../../hooks/use_time_range'; diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/index.tsx index 825da91c7d385..35329fe4bf17a 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/index.tsx @@ -21,6 +21,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { isEmpty } from 'lodash'; import React, { Fragment } from 'react'; import { Span } from '../../../../../../../../typings/es_schemas/ui/span'; @@ -40,7 +41,6 @@ import { ResponsiveFlyout } from '../responsive_flyout'; import { SpanLinksCount } from '../waterfall_helpers/waterfall_helpers'; import { SpanDatabase } from './span_db'; import { StickySpanProperties } from './sticky_span_properties'; -import { ProcessorEvent } from '../../../../../../../../common/processor_event'; function formatType(type: string) { switch (type) { diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/transaction_flyout/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/transaction_flyout/index.tsx index 9e8661fd523fb..b2b5539851a7e 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/transaction_flyout/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/transaction_flyout/index.tsx @@ -17,8 +17,8 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import React from 'react'; -import { ProcessorEvent } from '../../../../../../../../common/processor_event'; import { Transaction } from '../../../../../../../../typings/es_schemas/ui/transaction'; import { TransactionMetadata } from '../../../../../../shared/metadata_table/transaction_metadata'; import { getSpanLinksTabContent } from '../../../../../../shared/span_links/span_links_tab_content'; diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_helpers/waterfall_helpers.ts b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_helpers/waterfall_helpers.ts index cf53606afd9b4..e787f02aae4f8 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_helpers/waterfall_helpers.ts +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_helpers/waterfall_helpers.ts @@ -7,11 +7,11 @@ import { euiPaletteColorBlind } from '@elastic/eui'; import { first, flatten, groupBy, isEmpty, sortBy, uniq } from 'lodash'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import type { APIReturnType } from '../../../../../../../services/rest/create_call_apm_api'; import type { APMError } from '../../../../../../../../typings/es_schemas/ui/apm_error'; import type { Span } from '../../../../../../../../typings/es_schemas/ui/span'; import type { Transaction } from '../../../../../../../../typings/es_schemas/ui/transaction'; -import { ProcessorEvent } from '../../../../../../../../common/processor_event'; type TraceAPIResponse = APIReturnType<'GET /internal/apm/traces/{traceId}'>; diff --git a/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart/index.tsx index 03e2af308a798..8e688832f7f36 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart/index.tsx @@ -31,6 +31,7 @@ import { i18n } from '@kbn/i18n'; import { useChartTheme } from '@kbn/observability-plugin/public'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getDurationFormatter } from '../../../../../common/utils/formatters'; import type { HistogramItem } from '../../../../../common/correlations/types'; import { DEFAULT_PERCENTILE_THRESHOLD } from '../../../../../common/correlations/constants'; @@ -39,7 +40,6 @@ import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; import { useTheme } from '../../../../hooks/use_theme'; import { ChartContainer } from '../chart_container'; -import { ProcessorEvent } from '../../../../../common/processor_event'; const NUMBER_OF_TRANSACTIONS_LABEL = i18n.translate( 'xpack.apm.durationDistribution.chart.numberOfTransactionsLabel', diff --git a/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart/total_doc_count_label.tsx b/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart/total_doc_count_label.tsx index 06b290afee8aa..ec601b77005e2 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart/total_doc_count_label.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart/total_doc_count_label.tsx @@ -9,7 +9,7 @@ import { useEuiTheme } from '@elastic/eui'; import { EuiText } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { ProcessorEvent } from '../../../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; interface Props { eventType: ProcessorEvent.transaction | ProcessorEvent.span; diff --git a/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart_with_scrubber/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart_with_scrubber/index.tsx index 25d10b7f60edf..0cd1c0f2b639a 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart_with_scrubber/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/duration_distribution_chart_with_scrubber/index.tsx @@ -17,6 +17,7 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { ChartTitleToolTip } from '../../../app/correlations/chart_title_tool_tip'; import { getDurationFormatter } from '../../../../../common/utils/formatters'; import { @@ -25,7 +26,6 @@ import { } from '../duration_distribution_chart'; import { TotalDocCountLabel } from '../duration_distribution_chart/total_doc_count_label'; import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; -import { ProcessorEvent } from '../../../../../common/processor_event'; // Format the selected latency range for the "Clear selection" badge. // If the two values share the same unit, it will only displayed once. diff --git a/x-pack/plugins/apm/public/components/shared/kuery_bar/use_processor_event.ts b/x-pack/plugins/apm/public/components/shared/kuery_bar/use_processor_event.ts index 11098d014c83a..d8abb49e42277 100644 --- a/x-pack/plugins/apm/public/components/shared/kuery_bar/use_processor_event.ts +++ b/x-pack/plugins/apm/public/components/shared/kuery_bar/use_processor_event.ts @@ -5,11 +5,9 @@ * 2.0. */ +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { useLocation } from 'react-router-dom'; -import { - ProcessorEvent, - UIProcessorEvent, -} from '../../../../common/processor_event'; +import { UIProcessorEvent } from '../../../../common/processor_event'; /** * Infer the processor.event to used based on the route path diff --git a/x-pack/plugins/apm/public/components/shared/metadata_table/error_metadata/index.tsx b/x-pack/plugins/apm/public/components/shared/metadata_table/error_metadata/index.tsx index cfc15905dbe0b..95b19328367c9 100644 --- a/x-pack/plugins/apm/public/components/shared/metadata_table/error_metadata/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/metadata_table/error_metadata/index.tsx @@ -6,11 +6,11 @@ */ import React, { useMemo } from 'react'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { APMError } from '../../../../../typings/es_schemas/ui/apm_error'; import { getSectionsFromFields } from '../helper'; import { MetadataTable } from '..'; import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; -import { ProcessorEvent } from '../../../../../common/processor_event'; interface Props { error: APMError; diff --git a/x-pack/plugins/apm/public/components/shared/metadata_table/span_metadata/index.tsx b/x-pack/plugins/apm/public/components/shared/metadata_table/span_metadata/index.tsx index 922f83586805c..6b00d20b060e0 100644 --- a/x-pack/plugins/apm/public/components/shared/metadata_table/span_metadata/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/metadata_table/span_metadata/index.tsx @@ -6,11 +6,11 @@ */ import React, { useMemo } from 'react'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { Span } from '../../../../../typings/es_schemas/ui/span'; import { getSectionsFromFields } from '../helper'; import { MetadataTable } from '..'; import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; -import { ProcessorEvent } from '../../../../../common/processor_event'; interface Props { span: Span; diff --git a/x-pack/plugins/apm/public/components/shared/metadata_table/transaction_metadata/index.tsx b/x-pack/plugins/apm/public/components/shared/metadata_table/transaction_metadata/index.tsx index bc2eb72a4f8ca..d24ac369e050d 100644 --- a/x-pack/plugins/apm/public/components/shared/metadata_table/transaction_metadata/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/metadata_table/transaction_metadata/index.tsx @@ -6,10 +6,10 @@ */ import React, { useMemo } from 'react'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { Transaction } from '../../../../../typings/es_schemas/ui/transaction'; import { getSectionsFromFields } from '../helper'; import { MetadataTable } from '..'; -import { ProcessorEvent } from '../../../../../common/processor_event'; import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; interface Props { diff --git a/x-pack/plugins/apm/public/components/shared/span_links/index.tsx b/x-pack/plugins/apm/public/components/shared/span_links/index.tsx index 0dc0213e92d44..77d0451adca55 100644 --- a/x-pack/plugins/apm/public/components/shared/span_links/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/span_links/index.tsx @@ -13,6 +13,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useMemo, useState } from 'react'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { useApmParams } from '../../../hooks/use_apm_params'; import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; import { useTimeRange } from '../../../hooks/use_time_range'; @@ -20,7 +21,6 @@ import { SpanLinksCount } from '../../app/transaction_details/waterfall_with_sum import { KueryBar } from '../kuery_bar'; import { SpanLinksCallout } from './span_links_callout'; import { SpanLinksTable } from './span_links_table'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { useLocalStorage } from '../../../hooks/use_local_storage'; interface Props { diff --git a/x-pack/plugins/apm/public/components/shared/span_links/span_links_tab_content.tsx b/x-pack/plugins/apm/public/components/shared/span_links/span_links_tab_content.tsx index c0e806f80b52f..21b404482e419 100644 --- a/x-pack/plugins/apm/public/components/shared/span_links/span_links_tab_content.tsx +++ b/x-pack/plugins/apm/public/components/shared/span_links/span_links_tab_content.tsx @@ -7,8 +7,8 @@ import { EuiNotificationBadge, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { SpanLinks } from '.'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { SpanLinksCount } from '../../app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_helpers/waterfall_helpers'; import { TechnicalPreviewBadge } from '../technical_preview_badge'; diff --git a/x-pack/plugins/apm/server/index.ts b/x-pack/plugins/apm/server/index.ts index 5058b86249f2d..5dbee19cbf866 100644 --- a/x-pack/plugins/apm/server/index.ts +++ b/x-pack/plugins/apm/server/index.ts @@ -126,5 +126,3 @@ export type { APIEndpoint, } from './routes/apm_routes/get_global_apm_server_route_repository'; export type { APMRouteHandlerResources } from './routes/typings'; - -export type { ProcessorEvent } from '../common/processor_event'; diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts index 3be864fe8127e..fd369cd1328f2 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts @@ -10,13 +10,13 @@ import { Logger } from '@kbn/core/server'; import { snakeCase } from 'lodash'; import moment from 'moment'; import uuid from 'uuid/v4'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { ML_ERRORS } from '../../../common/anomaly_detection'; import { METRICSET_NAME, PROCESSOR_EVENT, } from '../../../common/elasticsearch_fieldnames'; import { Environment } from '../../../common/environment_rt'; -import { ProcessorEvent } from '../../../common/processor_event'; import { environmentQuery } from '../../../common/utils/environment_query'; import { withApmSpan } from '../../utils/with_apm_span'; import { Setup } from '../helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts b/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts index 838091a1ef657..f315c0a1ce521 100644 --- a/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts +++ b/x-pack/plugins/apm/server/lib/apm_telemetry/collect_data_telemetry/tasks.ts @@ -7,8 +7,8 @@ import { fromKueryExpression } from '@kbn/es-query'; import { flatten, merge, sortBy, sum, pickBy } from 'lodash'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { asMutableArray } from '../../../../common/utils/as_mutable_array'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { TelemetryTask } from '.'; import { AGENT_NAMES, RUM_AGENT_NAMES } from '../../../../common/agent_name'; import { diff --git a/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_destination_map.ts b/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_destination_map.ts index bb3defa93ac0c..54b487ebf36e5 100644 --- a/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_destination_map.ts +++ b/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_destination_map.ts @@ -8,6 +8,7 @@ import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import objectHash from 'object-hash'; import { rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; import { ENVIRONMENT_NOT_DEFINED } from '../../../../common/environment_filter_values'; import { asMutableArray } from '../../../../common/utils/as_mutable_array'; @@ -23,7 +24,6 @@ import { SPAN_SUBTYPE, SPAN_TYPE, } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { Setup } from '../../helpers/setup_request'; import { withApmSpan } from '../../../utils/with_apm_span'; import { Node, NodeType } from '../../../../common/connections'; diff --git a/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_stats.ts b/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_stats.ts index 3f7fe3d168a9a..7057847c34c0c 100644 --- a/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_stats.ts +++ b/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_stats.ts @@ -9,6 +9,7 @@ import { sum } from 'lodash'; import objectHash from 'object-hash'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { AgentName } from '../../../../typings/es_schemas/ui/fields/agent'; import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; import { ENVIRONMENT_NOT_DEFINED } from '../../../../common/environment_filter_values'; @@ -24,7 +25,6 @@ import { SPAN_SUBTYPE, SPAN_TYPE, } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { getBucketSize } from '../../helpers/get_bucket_size'; import { EventOutcome } from '../../../../common/event_outcome'; import { Setup } from '../../helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.ts b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.ts index a3291aa1dd7e0..9488c993bc08b 100644 --- a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.ts +++ b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.ts @@ -20,9 +20,9 @@ import { } from '@kbn/core/types/elasticsearch'; import { unwrapEsResponse } from '@kbn/observability-plugin/server'; import { omit } from 'lodash'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { Profile } from '../../../../../typings/es_schemas/ui/profile'; import { withApmSpan } from '../../../../utils/with_apm_span'; -import { ProcessorEvent } from '../../../../../common/processor_event'; import { APMError } from '../../../../../typings/es_schemas/ui/apm_error'; import { Metric } from '../../../../../typings/es_schemas/ui/metric'; import { Span } from '../../../../../typings/es_schemas/ui/span'; diff --git a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/unpack_processor_events.ts b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/unpack_processor_events.ts index 3ef5a715e2c20..ea83728b64ac0 100644 --- a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/unpack_processor_events.ts +++ b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/unpack_processor_events.ts @@ -7,8 +7,8 @@ import { uniq, defaultsDeep, cloneDeep } from 'lodash'; import { ESSearchRequest, ESFilter } from '@kbn/core/types/elasticsearch'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { PROCESSOR_EVENT } from '../../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../../common/processor_event'; import { ApmIndicesConfig } from '../../../../routes/settings/apm_indices/get_apm_indices'; const processorEventIndexMap = { diff --git a/x-pack/plugins/apm/server/lib/helpers/setup_request.test.ts b/x-pack/plugins/apm/server/lib/helpers/setup_request.test.ts index db4825680eae0..3b6ea992aa078 100644 --- a/x-pack/plugins/apm/server/lib/helpers/setup_request.test.ts +++ b/x-pack/plugins/apm/server/lib/helpers/setup_request.test.ts @@ -9,7 +9,7 @@ import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; import { setupRequest } from './setup_request'; import { APMConfig } from '../..'; import { APMRouteHandlerResources } from '../../routes/typings'; -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getApmIndices } from '../../routes/settings/apm_indices/get_apm_indices'; jest.mock('../../routes/settings/apm_indices/get_apm_indices', () => ({ diff --git a/x-pack/plugins/apm/server/lib/helpers/spans/get_is_using_service_destination_metrics.ts b/x-pack/plugins/apm/server/lib/helpers/spans/get_is_using_service_destination_metrics.ts index c39ac6c8eb475..438f4b5d7eb5c 100644 --- a/x-pack/plugins/apm/server/lib/helpers/spans/get_is_using_service_destination_metrics.ts +++ b/x-pack/plugins/apm/server/lib/helpers/spans/get_is_using_service_destination_metrics.ts @@ -11,6 +11,7 @@ import { rangeQuery, termQuery, } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { METRICSET_NAME, SPAN_DESTINATION_SERVICE_RESPONSE_TIME_COUNT, @@ -18,7 +19,6 @@ import { SPAN_DURATION, SPAN_NAME, } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { Setup } from '../setup_request'; export function getProcessorEventForServiceDestinationStatistics( diff --git a/x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.ts b/x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.ts index 7db898af4a810..6f28c966142fb 100644 --- a/x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.ts +++ b/x-pack/plugins/apm/server/lib/helpers/transactions/get_is_using_transaction_events.ts @@ -6,9 +6,9 @@ */ import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getSearchAggregatedTransactions } from '.'; import { Setup } from '../setup_request'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { APMEventClient } from '../create_es_client/create_apm_event_client'; import { SearchAggregatedTransactionSetting } from '../../../../common/aggregated_transactions'; diff --git a/x-pack/plugins/apm/server/lib/helpers/transactions/index.ts b/x-pack/plugins/apm/server/lib/helpers/transactions/index.ts index f98540a85b761..afaaf37c3362c 100644 --- a/x-pack/plugins/apm/server/lib/helpers/transactions/index.ts +++ b/x-pack/plugins/apm/server/lib/helpers/transactions/index.ts @@ -6,8 +6,8 @@ */ import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { SearchAggregatedTransactionSetting } from '../../../../common/aggregated_transactions'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { TRANSACTION_DURATION, TRANSACTION_DURATION_HISTOGRAM, diff --git a/x-pack/plugins/apm/server/routes/alerts/chart_preview/get_transaction_error_count.ts b/x-pack/plugins/apm/server/routes/alerts/chart_preview/get_transaction_error_count.ts index f283a912bc3cd..1de9744914e27 100644 --- a/x-pack/plugins/apm/server/routes/alerts/chart_preview/get_transaction_error_count.ts +++ b/x-pack/plugins/apm/server/routes/alerts/chart_preview/get_transaction_error_count.ts @@ -6,8 +6,8 @@ */ import { rangeQuery, termQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { SERVICE_NAME } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { AlertParams } from '../route'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { Setup } from '../../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/alerts/register_anomaly_alert_type.ts b/x-pack/plugins/apm/server/routes/alerts/register_anomaly_alert_type.ts index 7f978c4f61161..b63be80438189 100644 --- a/x-pack/plugins/apm/server/routes/alerts/register_anomaly_alert_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/register_anomaly_alert_type.ts @@ -18,6 +18,7 @@ import { ESSearchResponse } from '@kbn/core/types/elasticsearch'; import { KibanaRequest } from '@kbn/core/server'; import { termQuery } from '@kbn/observability-plugin/server'; import { createLifecycleRuleTypeFactory } from '@kbn/rule-registry-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { AlertType, ALERT_TYPES_CONFIG, @@ -40,7 +41,6 @@ import { getEnvironmentLabel, } from '../../../common/environment_filter_values'; import { ANOMALY_SEVERITY } from '../../../common/ml_constants'; -import { ProcessorEvent } from '../../../common/processor_event'; import { asMutableArray } from '../../../common/utils/as_mutable_array'; import { getAlertUrlTransaction } from '../../../common/utils/formatters'; import { getMLJobs } from '../service_map/get_service_anomalies'; diff --git a/x-pack/plugins/apm/server/routes/alerts/register_error_count_alert_type.ts b/x-pack/plugins/apm/server/routes/alerts/register_error_count_alert_type.ts index 7c9422d34948d..3cf88aaac8d4e 100644 --- a/x-pack/plugins/apm/server/routes/alerts/register_error_count_alert_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/register_error_count_alert_type.ts @@ -14,6 +14,7 @@ import { } from '@kbn/rule-data-utils'; import { createLifecycleRuleTypeFactory } from '@kbn/rule-registry-plugin/server'; import { termQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { ENVIRONMENT_NOT_DEFINED, getEnvironmentEsField, @@ -31,7 +32,6 @@ import { SERVICE_ENVIRONMENT, SERVICE_NAME, } from '../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../common/processor_event'; import { environmentQuery } from '../../../common/utils/environment_query'; import { getApmIndices } from '../settings/apm_indices/get_apm_indices'; import { apmActionVariables } from './action_variables'; diff --git a/x-pack/plugins/apm/server/routes/alerts/register_transaction_duration_alert_type.ts b/x-pack/plugins/apm/server/routes/alerts/register_transaction_duration_alert_type.ts index 58fd9323f8702..492feffb4dc94 100644 --- a/x-pack/plugins/apm/server/routes/alerts/register_transaction_duration_alert_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/register_transaction_duration_alert_type.ts @@ -15,6 +15,7 @@ import { import { firstValueFrom } from 'rxjs'; import { asDuration } from '@kbn/observability-plugin/common/utils/formatters'; import { createLifecycleRuleTypeFactory } from '@kbn/rule-registry-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getAlertUrlTransaction } from '../../../common/utils/formatters'; import { SearchAggregatedTransactionSetting } from '../../../common/aggregated_transactions'; import { @@ -33,7 +34,6 @@ import { getEnvironmentEsField, getEnvironmentLabel, } from '../../../common/environment_filter_values'; -import { ProcessorEvent } from '../../../common/processor_event'; import { environmentQuery } from '../../../common/utils/environment_query'; import { getDurationFormatter } from '../../../common/utils/formatters'; import { diff --git a/x-pack/plugins/apm/server/routes/alerts/register_transaction_error_rate_alert_type.ts b/x-pack/plugins/apm/server/routes/alerts/register_transaction_error_rate_alert_type.ts index ceecaeb961dd6..c6d80d70c4ef7 100644 --- a/x-pack/plugins/apm/server/routes/alerts/register_transaction_error_rate_alert_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/register_transaction_error_rate_alert_type.ts @@ -15,6 +15,7 @@ import { import { createLifecycleRuleTypeFactory } from '@kbn/rule-registry-plugin/server'; import { asPercent } from '@kbn/observability-plugin/common/utils/formatters'; import { termQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { ENVIRONMENT_NOT_DEFINED, getEnvironmentEsField, @@ -35,7 +36,6 @@ import { TRANSACTION_TYPE, } from '../../../common/elasticsearch_fieldnames'; import { EventOutcome } from '../../../common/event_outcome'; -import { ProcessorEvent } from '../../../common/processor_event'; import { asDecimalOrInteger } from '../../../common/utils/formatters'; import { environmentQuery } from '../../../common/utils/environment_query'; import { getApmIndices } from '../settings/apm_indices/get_apm_indices'; diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_correlation.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_correlation.ts index f076aec310c9c..4fb5f8da74c1c 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_correlation.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_correlation.ts @@ -6,6 +6,7 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { SPAN_DURATION, TRANSACTION_DURATION, @@ -13,7 +14,6 @@ import { import type { CommonCorrelationsQueryParams } from '../../../../common/correlations/types'; import { Setup } from '../../../lib/helpers/setup_request'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { getCommonCorrelationsQuery } from './get_common_correlations_query'; export const fetchDurationCorrelation = async ({ diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts index 323bb78806100..c73bea223635c 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts @@ -7,6 +7,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { ES_FIELD_TYPES } from '@kbn/field-types'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import type { CommonCorrelationsQueryParams } from '../../../../common/correlations/types'; import { FIELD_PREFIX_TO_EXCLUDE_AS_CANDIDATE, @@ -17,7 +18,6 @@ import { import { hasPrefixToInclude } from '../../../../common/correlations/utils'; import { Setup } from '../../../lib/helpers/setup_request'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { getCommonCorrelationsQuery } from './get_common_correlations_query'; const SUPPORTED_ES_FIELD_TYPES = [ diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_fractions.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_fractions.ts index 5e0fe08f8bf4d..3a1aeae80c081 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_fractions.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_fractions.ts @@ -7,12 +7,12 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { CommonCorrelationsQueryParams } from '../../../../common/correlations/types'; import { SPAN_DURATION, TRANSACTION_DURATION, } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { Setup } from '../../../lib/helpers/setup_request'; import { getCommonCorrelationsQuery } from './get_common_correlations_query'; diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_field_value_pairs.ts b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_field_value_pairs.ts index e18f9d4f71e32..83f9e2cb3dbda 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/fetch_field_value_pairs.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/fetch_field_value_pairs.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import type { FieldValuePair, CommonCorrelationsQueryParams, @@ -13,7 +14,6 @@ import { TERMS_SIZE } from '../../../../common/correlations/constants'; import { splitAllSettledPromises } from '../utils'; import { Setup } from '../../../lib/helpers/setup_request'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { getCommonCorrelationsQuery } from './get_common_correlations_query'; export const fetchFieldValuePairs = async ({ diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_boolean_field_stats.ts b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_boolean_field_stats.ts index d479a10fda45e..0d03843fd2088 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_boolean_field_stats.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_boolean_field_stats.ts @@ -5,13 +5,13 @@ * 2.0. */ +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { CommonCorrelationsQueryParams, FieldValuePair, } from '../../../../../common/correlations/types'; import { BooleanFieldStats } from '../../../../../common/correlations/field_stats_types'; import { Setup } from '../../../../lib/helpers/setup_request'; -import { ProcessorEvent } from '../../../../../common/processor_event'; import { getCommonCorrelationsQuery } from '../get_common_correlations_query'; export const fetchBooleanFieldStats = async ({ diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_field_value_field_stats.ts b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_field_value_field_stats.ts index b7236b6a603c7..9208a8ad682d3 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_field_value_field_stats.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_field_value_field_stats.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { CommonCorrelationsQueryParams, FieldValuePair, @@ -14,7 +15,6 @@ import { TopValueBucket, } from '../../../../../common/correlations/field_stats_types'; import { Setup } from '../../../../lib/helpers/setup_request'; -import { ProcessorEvent } from '../../../../../common/processor_event'; import { getCommonCorrelationsQuery } from '../get_common_correlations_query'; export const fetchFieldValueFieldStats = async ({ diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_fields_stats.ts b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_fields_stats.ts index 05da7d77c281d..2cd1843c6d008 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_fields_stats.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_fields_stats.ts @@ -7,6 +7,7 @@ import { chunk } from 'lodash'; import { ES_FIELD_TYPES } from '@kbn/field-types'; import { rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { CommonCorrelationsQueryParams, FieldValuePair, @@ -16,7 +17,6 @@ import { fetchKeywordFieldStats } from './fetch_keyword_field_stats'; import { fetchNumericFieldStats } from './fetch_numeric_field_stats'; import { fetchBooleanFieldStats } from './fetch_boolean_field_stats'; import { Setup } from '../../../../lib/helpers/setup_request'; -import { ProcessorEvent } from '../../../../../common/processor_event'; export const fetchFieldsStats = async ({ setup, diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_keyword_field_stats.ts b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_keyword_field_stats.ts index 6803f7a248f1f..30e88c0eb8efb 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_keyword_field_stats.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_keyword_field_stats.ts @@ -5,13 +5,13 @@ * 2.0. */ +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { CommonCorrelationsQueryParams, FieldValuePair, } from '../../../../../common/correlations/types'; import { KeywordFieldStats } from '../../../../../common/correlations/field_stats_types'; import { Setup } from '../../../../lib/helpers/setup_request'; -import { ProcessorEvent } from '../../../../../common/processor_event'; import { getCommonCorrelationsQuery } from '../get_common_correlations_query'; export const fetchKeywordFieldStats = async ({ diff --git a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_numeric_field_stats.ts b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_numeric_field_stats.ts index a2e512a30fda8..04b43e09d182a 100644 --- a/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_numeric_field_stats.ts +++ b/x-pack/plugins/apm/server/routes/correlations/queries/field_stats/fetch_numeric_field_stats.ts @@ -6,6 +6,7 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { NumericFieldStats, TopValueBucket, @@ -15,7 +16,6 @@ import { FieldValuePair, } from '../../../../../common/correlations/types'; import { Setup } from '../../../../lib/helpers/setup_request'; -import { ProcessorEvent } from '../../../../../common/processor_event'; import { getCommonCorrelationsQuery } from '../get_common_correlations_query'; export const fetchNumericFieldStats = async ({ diff --git a/x-pack/plugins/apm/server/routes/correlations/route.ts b/x-pack/plugins/apm/server/routes/correlations/route.ts index 8d451c08647e0..4000dcb53676e 100644 --- a/x-pack/plugins/apm/server/routes/correlations/route.ts +++ b/x-pack/plugins/apm/server/routes/correlations/route.ts @@ -12,6 +12,7 @@ import { i18n } from '@kbn/i18n'; import { toNumberRt } from '@kbn/io-ts-utils'; import { termQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { isActivePlatinumLicense } from '../../../common/license_check'; import { setupRequest } from '../../lib/helpers/setup_request'; @@ -19,7 +20,6 @@ import { setupRequest } from '../../lib/helpers/setup_request'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; import { fetchDurationFieldCandidates } from './queries/fetch_duration_field_candidates'; -import { ProcessorEvent } from '../../../common/processor_event'; import { SERVICE_NAME, TRANSACTION_NAME, diff --git a/x-pack/plugins/apm/server/routes/correlations/utils/get_event_type.ts b/x-pack/plugins/apm/server/routes/correlations/utils/get_event_type.ts index da6534beb353f..aa3afb27f6014 100644 --- a/x-pack/plugins/apm/server/routes/correlations/utils/get_event_type.ts +++ b/x-pack/plugins/apm/server/routes/correlations/utils/get_event_type.ts @@ -5,8 +5,8 @@ * 2.0. */ +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { LatencyDistributionChartType } from '../../../../common/latency_distribution_chart_types'; -import { ProcessorEvent } from '../../../../common/processor_event'; const { transactionLatency, diff --git a/x-pack/plugins/apm/server/routes/dependencies/get_metadata_for_dependency.ts b/x-pack/plugins/apm/server/routes/dependencies/get_metadata_for_dependency.ts index 5c18d57d11c49..610ad061eead4 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/get_metadata_for_dependency.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/get_metadata_for_dependency.ts @@ -6,8 +6,8 @@ */ import { rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { maybe } from '../../../common/utils/maybe'; -import { ProcessorEvent } from '../../../common/processor_event'; import { SPAN_DESTINATION_SERVICE_RESOURCE } from '../../../common/elasticsearch_fieldnames'; import { Setup } from '../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_operations.ts b/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_operations.ts index dcf9ce40515c0..5db5e3c40f997 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_operations.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_operations.ts @@ -10,6 +10,7 @@ import { rangeQuery, termQuery, } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { EVENT_OUTCOME, SPAN_DESTINATION_SERVICE_RESOURCE, @@ -18,7 +19,6 @@ import { } from '../../../common/elasticsearch_fieldnames'; import { Environment } from '../../../common/environment_rt'; import { EventOutcome } from '../../../common/event_outcome'; -import { ProcessorEvent } from '../../../common/processor_event'; import { environmentQuery } from '../../../common/utils/environment_query'; import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; import { diff --git a/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_spans.ts b/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_spans.ts index 86a6dfb0aaf8e..112c0d0a0dd46 100644 --- a/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_spans.ts +++ b/x-pack/plugins/apm/server/routes/dependencies/get_top_dependency_spans.ts @@ -12,6 +12,7 @@ import { termsQuery, } from '@kbn/observability-plugin/server'; import { compact, keyBy } from 'lodash'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { AGENT_NAME, EVENT_OUTCOME, @@ -27,7 +28,6 @@ import { } from '../../../common/elasticsearch_fieldnames'; import { Environment } from '../../../common/environment_rt'; import { EventOutcome } from '../../../common/event_outcome'; -import { ProcessorEvent } from '../../../common/processor_event'; import { environmentQuery } from '../../../common/utils/environment_query'; import { AgentName } from '../../../typings/es_schemas/ui/fields/agent'; import { Setup } from '../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/environments/get_all_environments.ts b/x-pack/plugins/apm/server/routes/environments/get_all_environments.ts index bbfb9071d3bc6..808138a07f43e 100644 --- a/x-pack/plugins/apm/server/routes/environments/get_all_environments.ts +++ b/x-pack/plugins/apm/server/routes/environments/get_all_environments.ts @@ -6,7 +6,7 @@ */ import { termQuery } from '@kbn/observability-plugin/server'; -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { Setup } from '../../lib/helpers/setup_request'; import { SERVICE_NAME, diff --git a/x-pack/plugins/apm/server/routes/environments/get_environments.ts b/x-pack/plugins/apm/server/routes/environments/get_environments.ts index 6676b8061c354..bbb99d873e81a 100644 --- a/x-pack/plugins/apm/server/routes/environments/get_environments.ts +++ b/x-pack/plugins/apm/server/routes/environments/get_environments.ts @@ -6,12 +6,12 @@ */ import { rangeQuery, termQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { SERVICE_ENVIRONMENT, SERVICE_NAME, } from '../../../common/elasticsearch_fieldnames'; import { ENVIRONMENT_NOT_DEFINED } from '../../../common/environment_filter_values'; -import { ProcessorEvent } from '../../../common/processor_event'; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions'; import { Setup } from '../../lib/helpers/setup_request'; import { Environment } from '../../../common/environment_rt'; diff --git a/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.test.ts b/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.test.ts index 871df10d9bafa..6d460e5d42d7b 100644 --- a/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.test.ts +++ b/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.test.ts @@ -7,7 +7,7 @@ import { getBuckets } from './get_buckets'; import { APMConfig } from '../../..'; -import { ProcessorEvent } from '../../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; describe('get buckets', () => { let clientSpy: jest.Mock; diff --git a/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.ts b/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.ts index 34fd6be58a57d..9f2cf76b2cbce 100644 --- a/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.ts +++ b/x-pack/plugins/apm/server/routes/errors/distribution/get_buckets.ts @@ -10,11 +10,11 @@ import { kqlQuery, termQuery, } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { ERROR_GROUP_ID, SERVICE_NAME, } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { Setup } from '../../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/errors/erroneous_transactions/get_top_erroneous_transactions.ts b/x-pack/plugins/apm/server/routes/errors/erroneous_transactions/get_top_erroneous_transactions.ts index 6017ad75c1230..fa1c5372f8d4a 100644 --- a/x-pack/plugins/apm/server/routes/errors/erroneous_transactions/get_top_erroneous_transactions.ts +++ b/x-pack/plugins/apm/server/routes/errors/erroneous_transactions/get_top_erroneous_transactions.ts @@ -17,6 +17,7 @@ import { kqlQuery, termQuery, } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { keyBy } from 'lodash'; import { ERROR_GROUP_ID, @@ -24,7 +25,6 @@ import { TRANSACTION_NAME, TRANSACTION_TYPE, } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { Setup } from '../../../lib/helpers/setup_request'; import { getBucketSize } from '../../../lib/helpers/get_bucket_size'; diff --git a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts index 99fcf1a6c3f8a..4251dfeb02885 100644 --- a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts +++ b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts @@ -11,13 +11,13 @@ import { termQuery, termsQuery, } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { offsetPreviousPeriodCoordinates } from '../../../../common/utils/offset_previous_period_coordinate'; import { Coordinate } from '../../../../typings/timeseries'; import { ERROR_GROUP_ID, SERVICE_NAME, } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { getBucketSize } from '../../../lib/helpers/get_bucket_size'; import { Setup } from '../../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts index 0b6fea5c4c6a4..d50650116c126 100644 --- a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts +++ b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts @@ -11,6 +11,7 @@ import { rangeQuery, termQuery, } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { ERROR_CULPRIT, ERROR_EXC_HANDLED, @@ -22,7 +23,6 @@ import { TRANSACTION_NAME, TRANSACTION_TYPE, } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { getErrorName } from '../../../lib/helpers/get_error_name'; import { Setup } from '../../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_sample.ts b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_sample.ts index 8df5235950cef..0fe37d8dc98db 100644 --- a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_sample.ts +++ b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_sample.ts @@ -6,13 +6,13 @@ */ import { rangeQuery, kqlQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { asMutableArray } from '../../../../common/utils/as_mutable_array'; import { ERROR_GROUP_ID, SERVICE_NAME, TRANSACTION_SAMPLED, } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { getTransaction } from '../../transactions/get_transaction'; import { Setup } from '../../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/event_metadata/get_event_metadata.ts b/x-pack/plugins/apm/server/routes/event_metadata/get_event_metadata.ts index 006c87a3dac20..09dba644a9a45 100644 --- a/x-pack/plugins/apm/server/routes/event_metadata/get_event_metadata.ts +++ b/x-pack/plugins/apm/server/routes/event_metadata/get_event_metadata.ts @@ -6,12 +6,12 @@ */ import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { ERROR_ID, SPAN_ID, TRANSACTION_ID, } from '../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../common/processor_event'; import type { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; export async function getEventMetadata({ diff --git a/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts b/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts index 54960c3e48b60..9d19822e96d41 100644 --- a/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts +++ b/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { Setup } from '../../lib/helpers/setup_request'; // Note: this logic is duplicated in tutorials/apm/envs/on_prem diff --git a/x-pack/plugins/apm/server/routes/infrastructure/get_infrastructure_data.ts b/x-pack/plugins/apm/server/routes/infrastructure/get_infrastructure_data.ts index 96ae786b22b49..b1bf617ac7220 100644 --- a/x-pack/plugins/apm/server/routes/infrastructure/get_infrastructure_data.ts +++ b/x-pack/plugins/apm/server/routes/infrastructure/get_infrastructure_data.ts @@ -6,9 +6,9 @@ */ import { rangeQuery, kqlQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { Setup } from '../../lib/helpers/setup_request'; import { environmentQuery } from '../../../common/utils/environment_query'; -import { ProcessorEvent } from '../../../common/processor_event'; import { SERVICE_NAME, CONTAINER_ID, diff --git a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts index 8b199cc76085e..c527a64d5e1b9 100644 --- a/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts +++ b/x-pack/plugins/apm/server/routes/metrics/by_agent/java/gc/fetch_and_transform_gc_metrics.ts @@ -8,6 +8,7 @@ import { sum, round } from 'lodash'; import { euiLightVars as theme } from '@kbn/ui-theme'; import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { isFiniteNumber } from '../../../../../../common/utils/is_finite_number'; import { Setup } from '../../../../../lib/helpers/setup_request'; import { getMetricsDateHistogramParams } from '../../../../../lib/helpers/metrics'; @@ -27,7 +28,6 @@ import { environmentQuery, serviceNodeNameQuery, } from '../../../../../../common/utils/environment_query'; -import { ProcessorEvent } from '../../../../../../common/processor_event'; export async function fetchAndTransformGcMetrics({ environment, diff --git a/x-pack/plugins/apm/server/routes/metrics/fetch_and_transform_metrics.ts b/x-pack/plugins/apm/server/routes/metrics/fetch_and_transform_metrics.ts index f767fb71f15c6..a9da7c52c1470 100644 --- a/x-pack/plugins/apm/server/routes/metrics/fetch_and_transform_metrics.ts +++ b/x-pack/plugins/apm/server/routes/metrics/fetch_and_transform_metrics.ts @@ -10,6 +10,7 @@ import { euiLightVars as theme } from '@kbn/ui-theme'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import { AggregationOptionsByType } from '@kbn/core/types/elasticsearch'; import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getVizColorForIndex } from '../../../common/viz_colors'; import { APMEventESSearchRequest } from '../../lib/helpers/create_es_client/create_apm_event_client'; import { getMetricsDateHistogramParams } from '../../lib/helpers/metrics'; @@ -19,7 +20,6 @@ import { environmentQuery, serviceNodeNameQuery, } from '../../../common/utils/environment_query'; -import { ProcessorEvent } from '../../../common/processor_event'; import { SERVICE_NAME } from '../../../common/elasticsearch_fieldnames'; type MetricsAggregationMap = Unionize<{ diff --git a/x-pack/plugins/apm/server/routes/observability_overview/get_service_count.ts b/x-pack/plugins/apm/server/routes/observability_overview/get_service_count.ts index 07bbdb4b348b5..5b76201d33e38 100644 --- a/x-pack/plugins/apm/server/routes/observability_overview/get_service_count.ts +++ b/x-pack/plugins/apm/server/routes/observability_overview/get_service_count.ts @@ -6,7 +6,7 @@ */ import { rangeQuery } from '@kbn/observability-plugin/server'; -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { SERVICE_NAME } from '../../../common/elasticsearch_fieldnames'; import { Setup } from '../../lib/helpers/setup_request'; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions'; diff --git a/x-pack/plugins/apm/server/routes/observability_overview/has_data.ts b/x-pack/plugins/apm/server/routes/observability_overview/has_data.ts index 9f98af055e696..9ef4594c1f0f1 100644 --- a/x-pack/plugins/apm/server/routes/observability_overview/has_data.ts +++ b/x-pack/plugins/apm/server/routes/observability_overview/has_data.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { Setup } from '../../lib/helpers/setup_request'; export async function getHasData({ setup }: { setup: Setup }) { diff --git a/x-pack/plugins/apm/server/routes/service_groups/lookup_services.ts b/x-pack/plugins/apm/server/routes/service_groups/lookup_services.ts index 9a54b03e72b62..64c3b7e8e6f3b 100644 --- a/x-pack/plugins/apm/server/routes/service_groups/lookup_services.ts +++ b/x-pack/plugins/apm/server/routes/service_groups/lookup_services.ts @@ -6,13 +6,13 @@ */ import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { AgentName } from '../../../typings/es_schemas/ui/fields/agent'; import { AGENT_NAME, SERVICE_ENVIRONMENT, SERVICE_NAME, } from '../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../common/processor_event'; import { Setup } from '../../lib/helpers/setup_request'; export async function lookupServices({ diff --git a/x-pack/plugins/apm/server/routes/service_map/fetch_service_paths_from_trace_ids.ts b/x-pack/plugins/apm/server/routes/service_map/fetch_service_paths_from_trace_ids.ts index 8c2254af1deb2..69fa91dec7cc9 100644 --- a/x-pack/plugins/apm/server/routes/service_map/fetch_service_paths_from_trace_ids.ts +++ b/x-pack/plugins/apm/server/routes/service_map/fetch_service_paths_from_trace_ids.ts @@ -6,7 +6,7 @@ */ import { rangeQuery } from '@kbn/observability-plugin/server'; -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { TRACE_ID } from '../../../common/elasticsearch_fieldnames'; import { ConnectionNode, diff --git a/x-pack/plugins/apm/server/routes/service_map/get_service_map.ts b/x-pack/plugins/apm/server/routes/service_map/get_service_map.ts index c4ab0f12c8e69..245eeb3c1296a 100644 --- a/x-pack/plugins/apm/server/routes/service_map/get_service_map.ts +++ b/x-pack/plugins/apm/server/routes/service_map/get_service_map.ts @@ -8,7 +8,7 @@ import { Logger } from '@kbn/core/server'; import { chunk } from 'lodash'; import { rangeQuery, termsQuery } from '@kbn/observability-plugin/server'; -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { AGENT_NAME, SERVICE_ENVIRONMENT, diff --git a/x-pack/plugins/apm/server/routes/service_map/get_service_map_dependency_node_info.ts b/x-pack/plugins/apm/server/routes/service_map/get_service_map_dependency_node_info.ts index a757203b1c87b..9ff2d4da4f77f 100644 --- a/x-pack/plugins/apm/server/routes/service_map/get_service_map_dependency_node_info.ts +++ b/x-pack/plugins/apm/server/routes/service_map/get_service_map_dependency_node_info.ts @@ -6,6 +6,7 @@ */ import { rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { EVENT_OUTCOME, SPAN_DESTINATION_SERVICE_RESOURCE, @@ -13,7 +14,6 @@ import { SPAN_DESTINATION_SERVICE_RESPONSE_TIME_SUM, } from '../../../common/elasticsearch_fieldnames'; import { EventOutcome } from '../../../common/event_outcome'; -import { ProcessorEvent } from '../../../common/processor_event'; import { environmentQuery } from '../../../common/utils/environment_query'; import { withApmSpan } from '../../utils/with_apm_span'; import { calculateThroughputWithRange } from '../../lib/helpers/calculate_throughput'; diff --git a/x-pack/plugins/apm/server/routes/service_map/get_service_map_service_node_info.ts b/x-pack/plugins/apm/server/routes/service_map/get_service_map_service_node_info.ts index 225c78bd89dcb..27d6de622c131 100644 --- a/x-pack/plugins/apm/server/routes/service_map/get_service_map_service_node_info.ts +++ b/x-pack/plugins/apm/server/routes/service_map/get_service_map_service_node_info.ts @@ -7,6 +7,7 @@ import { sumBy } from 'lodash'; import { ESFilter } from '@kbn/core/types/elasticsearch'; import { rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { METRIC_CGROUP_MEMORY_USAGE_BYTES, METRIC_SYSTEM_CPU_PERCENT, @@ -15,7 +16,6 @@ import { SERVICE_NAME, TRANSACTION_TYPE, } from '../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../common/processor_event'; import { NodeStats } from '../../../common/service_map'; import { TRANSACTION_PAGE_LOAD, diff --git a/x-pack/plugins/apm/server/routes/service_map/get_trace_sample_ids.ts b/x-pack/plugins/apm/server/routes/service_map/get_trace_sample_ids.ts index 31710b253d07c..06db7354925f8 100644 --- a/x-pack/plugins/apm/server/routes/service_map/get_trace_sample_ids.ts +++ b/x-pack/plugins/apm/server/routes/service_map/get_trace_sample_ids.ts @@ -8,6 +8,7 @@ import Boom from '@hapi/boom'; import { sortBy, take, uniq } from 'lodash'; import { rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { asMutableArray } from '../../../common/utils/as_mutable_array'; import { SERVICE_ENVIRONMENT, @@ -15,7 +16,6 @@ import { SPAN_DESTINATION_SERVICE_RESOURCE, TRACE_ID, } from '../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../common/processor_event'; import { SERVICE_MAP_TIMEOUT_ERROR } from '../../../common/service_map'; import { environmentQuery } from '../../../common/utils/environment_query'; import { Setup } from '../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/service_nodes/get_service_nodes.ts b/x-pack/plugins/apm/server/routes/service_nodes/get_service_nodes.ts index f0b710069d244..34647f747cc43 100644 --- a/x-pack/plugins/apm/server/routes/service_nodes/get_service_nodes.ts +++ b/x-pack/plugins/apm/server/routes/service_nodes/get_service_nodes.ts @@ -6,6 +6,7 @@ */ import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { METRIC_JAVA_HEAP_MEMORY_USED, METRIC_JAVA_NON_HEAP_MEMORY_USED, @@ -19,7 +20,6 @@ import { SERVICE_NAME, SERVICE_NODE_NAME, } from '../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../common/processor_event'; import { environmentQuery } from '../../../common/utils/environment_query'; import { Setup } from '../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/services/get_service_agent.ts b/x-pack/plugins/apm/server/routes/services/get_service_agent.ts index e96dcdb6bf0fd..f6a33c543ea4d 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_agent.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_agent.ts @@ -6,7 +6,7 @@ */ import { rangeQuery } from '@kbn/observability-plugin/server'; -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { AGENT_NAME, SERVICE_NAME, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_instance_metadata_details.ts b/x-pack/plugins/apm/server/routes/services/get_service_instance_metadata_details.ts index 1bc44bf2c2b77..965c4d6fc01d6 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_instance_metadata_details.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_instance_metadata_details.ts @@ -6,7 +6,7 @@ */ import { merge } from 'lodash'; import { rangeQuery } from '@kbn/observability-plugin/server'; -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { METRICSET_NAME, SERVICE_NAME, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_system_metric_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_system_metric_statistics.ts index 8a191228255a9..c64f1e3865238 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_system_metric_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_system_metric_statistics.ts @@ -7,6 +7,7 @@ import { AggregationOptionsByType } from '@kbn/core/types/elasticsearch'; import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { METRIC_CGROUP_MEMORY_USAGE_BYTES, METRIC_PROCESS_CPU_PERCENT, @@ -15,7 +16,6 @@ import { SERVICE_NAME, SERVICE_NODE_NAME, } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { SERVICE_NODE_NAME_MISSING } from '../../../../common/service_nodes'; import { Coordinate } from '../../../../typings/timeseries'; import { environmentQuery } from '../../../../common/utils/environment_query'; diff --git a/x-pack/plugins/apm/server/routes/services/get_service_metadata_details.ts b/x-pack/plugins/apm/server/routes/services/get_service_metadata_details.ts index 4769a1986ec43..588709e46e210 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_metadata_details.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_metadata_details.ts @@ -6,7 +6,7 @@ */ import { rangeQuery } from '@kbn/observability-plugin/server'; -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { AGENT, CLOUD, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_metadata_icons.ts b/x-pack/plugins/apm/server/routes/services/get_service_metadata_icons.ts index b1724e2c07db6..a099b9821f961 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_metadata_icons.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_metadata_icons.ts @@ -6,7 +6,7 @@ */ import { rangeQuery } from '@kbn/observability-plugin/server'; -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { AGENT_NAME, CLOUD_PROVIDER, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_node_metadata.ts b/x-pack/plugins/apm/server/routes/services/get_service_node_metadata.ts index e782a99201ccf..4d8b80068a284 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_node_metadata.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_node_metadata.ts @@ -6,6 +6,7 @@ */ import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { Setup } from '../../lib/helpers/setup_request'; import { HOST_NAME, @@ -16,7 +17,6 @@ import { SERVICE_NAME, SERVICE_NODE_NAME, } from '../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../common/processor_event'; import { environmentQuery, serviceNodeNameQuery, diff --git a/x-pack/plugins/apm/server/routes/services/get_services/get_services_from_error_and_metric_documents.ts b/x-pack/plugins/apm/server/routes/services/get_services/get_services_from_error_and_metric_documents.ts index dbc5a7f989152..4398825e30c63 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services/get_services_from_error_and_metric_documents.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services/get_services_from_error_and_metric_documents.ts @@ -6,6 +6,7 @@ */ import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { AgentName } from '../../../../typings/es_schemas/ui/fields/agent'; import { AGENT_NAME, @@ -13,7 +14,6 @@ import { SERVICE_NAME, } from '../../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../../common/utils/environment_query'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { Setup } from '../../../lib/helpers/setup_request'; import { serviceGroupQuery } from '../../../../common/utils/service_group_query'; import { ServiceGroup } from '../../../../common/service_groups'; diff --git a/x-pack/plugins/apm/server/routes/services/get_services/get_sorted_and_filtered_services.ts b/x-pack/plugins/apm/server/routes/services/get_services/get_sorted_and_filtered_services.ts index c500782f4d002..a582a0a9b1d3b 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services/get_sorted_and_filtered_services.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services/get_sorted_and_filtered_services.ts @@ -6,10 +6,10 @@ */ import { Logger } from '@kbn/logging'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { SERVICE_NAME } from '../../../../common/elasticsearch_fieldnames'; import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { Environment } from '../../../../common/environment_rt'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { joinByKey } from '../../../../common/utils/join_by_key'; import { ServiceGroup } from '../../../../common/service_groups'; import { Setup } from '../../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/services/profiling/get_service_profiling_statistics.ts b/x-pack/plugins/apm/server/routes/services/profiling/get_service_profiling_statistics.ts index aa65316e2a0c3..7599e67963e4a 100644 --- a/x-pack/plugins/apm/server/routes/services/profiling/get_service_profiling_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/profiling/get_service_profiling_statistics.ts @@ -9,6 +9,7 @@ import { Logger } from '@kbn/core/server'; import util from 'util'; import { ESFilter } from '@kbn/core/types/elasticsearch'; import { rangeQuery, kqlQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { maybe } from '../../../../common/utils/maybe'; import { ProfileStackFrame } from '../../../../typings/es_schemas/ui/profile'; import { @@ -16,7 +17,6 @@ import { ProfileNode, getValueTypeConfig, } from '../../../../common/profiling'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { PROFILE_STACK, PROFILE_TOP_ID, diff --git a/x-pack/plugins/apm/server/routes/services/profiling/get_service_profiling_timeline.ts b/x-pack/plugins/apm/server/routes/services/profiling/get_service_profiling_timeline.ts index 5a95b332e9ee9..371f17159beb0 100644 --- a/x-pack/plugins/apm/server/routes/services/profiling/get_service_profiling_timeline.ts +++ b/x-pack/plugins/apm/server/routes/services/profiling/get_service_profiling_timeline.ts @@ -6,7 +6,7 @@ */ import { mapKeys, mapValues } from 'lodash'; import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; -import { ProcessorEvent } from '../../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { PROFILE_ID, SERVICE_NAME, diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_agent_name_by_service.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_agent_name_by_service.ts index d16af2d95d22a..c6f69793ba327 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_agent_name_by_service.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration/get_agent_name_by_service.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ProcessorEvent } from '../../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { Setup } from '../../../lib/helpers/setup_request'; import { SERVICE_NAME } from '../../../../common/elasticsearch_fieldnames'; import { AGENT_NAME } from '../../../../common/elasticsearch_fieldnames'; diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link/get_transaction.ts b/x-pack/plugins/apm/server/routes/settings/custom_link/get_transaction.ts index d4e21f219f372..a0955912faa28 100644 --- a/x-pack/plugins/apm/server/routes/settings/custom_link/get_transaction.ts +++ b/x-pack/plugins/apm/server/routes/settings/custom_link/get_transaction.ts @@ -7,8 +7,8 @@ import * as t from 'io-ts'; import { compact } from 'lodash'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { Setup } from '../../../lib/helpers/setup_request'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { filterOptionsRt } from './custom_link_types'; import { splitFilterValueByComma } from './helper'; diff --git a/x-pack/plugins/apm/server/routes/span_links/get_linked_children.ts b/x-pack/plugins/apm/server/routes/span_links/get_linked_children.ts index 43b55d31503e4..de183a63af6a4 100644 --- a/x-pack/plugins/apm/server/routes/span_links/get_linked_children.ts +++ b/x-pack/plugins/apm/server/routes/span_links/get_linked_children.ts @@ -5,6 +5,7 @@ * 2.0. */ import { rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { isEmpty } from 'lodash'; import { PROCESSOR_EVENT, @@ -15,7 +16,6 @@ import { TRACE_ID, TRANSACTION_ID, } from '../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../common/processor_event'; import type { SpanRaw } from '../../../typings/es_schemas/raw/span_raw'; import type { TransactionRaw } from '../../../typings/es_schemas/raw/transaction_raw'; import { Setup } from '../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/span_links/get_linked_parents.ts b/x-pack/plugins/apm/server/routes/span_links/get_linked_parents.ts index 876a0f3718642..037bbfd24d172 100644 --- a/x-pack/plugins/apm/server/routes/span_links/get_linked_parents.ts +++ b/x-pack/plugins/apm/server/routes/span_links/get_linked_parents.ts @@ -5,6 +5,7 @@ * 2.0. */ import { rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { SPAN_ID, SPAN_LINKS, @@ -12,7 +13,6 @@ import { TRANSACTION_ID, PROCESSOR_EVENT, } from '../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../common/processor_event'; import { SpanRaw } from '../../../typings/es_schemas/raw/span_raw'; import { TransactionRaw } from '../../../typings/es_schemas/raw/transaction_raw'; import { Setup } from '../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/span_links/get_span_links_details.ts b/x-pack/plugins/apm/server/routes/span_links/get_span_links_details.ts index cffd7ff826c88..f6d9682c6d893 100644 --- a/x-pack/plugins/apm/server/routes/span_links/get_span_links_details.ts +++ b/x-pack/plugins/apm/server/routes/span_links/get_span_links_details.ts @@ -5,6 +5,7 @@ * 2.0. */ import { kqlQuery, rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { chunk, compact, isEmpty, keyBy } from 'lodash'; import { SERVICE_NAME, @@ -21,7 +22,6 @@ import { AGENT_NAME, } from '../../../common/elasticsearch_fieldnames'; import { Environment } from '../../../common/environment_rt'; -import { ProcessorEvent } from '../../../common/processor_event'; import { SpanLinkDetails } from '../../../common/span_links'; import { SpanLink } from '../../../typings/es_schemas/raw/fields/span_links'; import { SpanRaw } from '../../../typings/es_schemas/raw/span_raw'; diff --git a/x-pack/plugins/apm/server/routes/suggestions/get_suggestions.ts b/x-pack/plugins/apm/server/routes/suggestions/get_suggestions.ts index f65a843ed95d0..dcab43ca26abc 100644 --- a/x-pack/plugins/apm/server/routes/suggestions/get_suggestions.ts +++ b/x-pack/plugins/apm/server/routes/suggestions/get_suggestions.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions'; import { Setup } from '../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_aggregation.ts b/x-pack/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_aggregation.ts index 268bc4151efdd..390435d62ec6b 100644 --- a/x-pack/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_aggregation.ts +++ b/x-pack/plugins/apm/server/routes/suggestions/get_suggestions_with_terms_aggregation.ts @@ -5,7 +5,7 @@ * 2.0. */ import { rangeQuery, termQuery } from '@kbn/observability-plugin/server'; -import { ProcessorEvent } from '../../../common/processor_event'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { getProcessorEventForTransactions } from '../../lib/helpers/transactions'; import { SERVICE_NAME } from '../../../common/elasticsearch_fieldnames'; import { Setup } from '../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/apm/server/routes/traces/get_trace_items.ts b/x-pack/plugins/apm/server/routes/traces/get_trace_items.ts index 3f6146c713303..c9c4c5a595cf3 100644 --- a/x-pack/plugins/apm/server/routes/traces/get_trace_items.ts +++ b/x-pack/plugins/apm/server/routes/traces/get_trace_items.ts @@ -10,6 +10,7 @@ import { Sort, } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { rangeQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { ERROR_LOG_LEVEL, PARENT_ID, @@ -17,7 +18,6 @@ import { TRACE_ID, TRANSACTION_DURATION, } from '../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../common/processor_event'; import { Setup } from '../../lib/helpers/setup_request'; import { getLinkedChildrenCountBySpanId } from '../span_links/get_linked_children'; diff --git a/x-pack/plugins/apm/server/routes/traces/get_trace_samples_by_query.ts b/x-pack/plugins/apm/server/routes/traces/get_trace_samples_by_query.ts index 48ca80780d77f..fbf3b4f29cc4c 100644 --- a/x-pack/plugins/apm/server/routes/traces/get_trace_samples_by_query.ts +++ b/x-pack/plugins/apm/server/routes/traces/get_trace_samples_by_query.ts @@ -9,10 +9,10 @@ import { kqlQuery, termsQuery, } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { Environment } from '../../../common/environment_rt'; import { Setup } from '../../lib/helpers/setup_request'; import { TraceSearchType } from '../../../common/trace_explorer'; -import { ProcessorEvent } from '../../../common/processor_event'; import { environmentQuery } from '../../../common/utils/environment_query'; import { PARENT_ID, diff --git a/x-pack/plugins/apm/server/routes/transactions/breakdown/index.ts b/x-pack/plugins/apm/server/routes/transactions/breakdown/index.ts index 122a56e28ed61..6495b21e209d9 100644 --- a/x-pack/plugins/apm/server/routes/transactions/breakdown/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/breakdown/index.ts @@ -7,8 +7,8 @@ import { flatten, orderBy, last } from 'lodash'; import { rangeQuery, kqlQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { asPercent } from '../../../../common/utils/formatters'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { SERVICE_NAME, SPAN_SUBTYPE, diff --git a/x-pack/plugins/apm/server/routes/transactions/get_transaction/index.ts b/x-pack/plugins/apm/server/routes/transactions/get_transaction/index.ts index efbab5bf030f7..1238261ca2bba 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_transaction/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_transaction/index.ts @@ -6,12 +6,12 @@ */ import { rangeQuery, termQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { TRACE_ID, TRANSACTION_ID, } from '../../../../common/elasticsearch_fieldnames'; import { Setup } from '../../../lib/helpers/setup_request'; -import { ProcessorEvent } from '../../../../common/processor_event'; import { asMutableArray } from '../../../../common/utils/as_mutable_array'; export async function getTransaction({ diff --git a/x-pack/plugins/apm/server/routes/transactions/get_transaction_by_trace/index.ts b/x-pack/plugins/apm/server/routes/transactions/get_transaction_by_trace/index.ts index d9c6a64bdbcc6..441a0b9119d8d 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_transaction_by_trace/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_transaction_by_trace/index.ts @@ -5,12 +5,12 @@ * 2.0. */ +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { TRACE_ID, PARENT_ID, } from '../../../../common/elasticsearch_fieldnames'; import { Setup } from '../../../lib/helpers/setup_request'; -import { ProcessorEvent } from '../../../../common/processor_event'; export async function getRootTransactionByTraceId( traceId: string, diff --git a/x-pack/plugins/apm/server/routes/transactions/trace_samples/get_trace_samples/index.ts b/x-pack/plugins/apm/server/routes/transactions/trace_samples/get_trace_samples/index.ts index 40ce7fbcbf047..3f66aaebd0555 100644 --- a/x-pack/plugins/apm/server/routes/transactions/trace_samples/get_trace_samples/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/trace_samples/get_trace_samples/index.ts @@ -6,6 +6,7 @@ */ import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { rangeQuery, kqlQuery } from '@kbn/observability-plugin/server'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { withApmSpan } from '../../../../utils/with_apm_span'; import { SERVICE_NAME, @@ -15,7 +16,6 @@ import { TRANSACTION_SAMPLED, TRANSACTION_TYPE, } from '../../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../../common/processor_event'; import { environmentQuery } from '../../../../../common/utils/environment_query'; import { Setup } from '../../../../lib/helpers/setup_request'; diff --git a/x-pack/plugins/fleet/server/integration_tests/__snapshots__/cloud_preconfiguration.test.ts.snap b/x-pack/plugins/fleet/server/integration_tests/__snapshots__/cloud_preconfiguration.test.ts.snap index 6e681e10d13bb..4f77db4063dc0 100644 --- a/x-pack/plugins/fleet/server/integration_tests/__snapshots__/cloud_preconfiguration.test.ts.snap +++ b/x-pack/plugins/fleet/server/integration_tests/__snapshots__/cloud_preconfiguration.test.ts.snap @@ -93,6 +93,7 @@ Object { "sample_rate": 0.1, }, ], + "storage_limit": "3GB", }, }, "shutdown_timeout": "30s", @@ -104,9 +105,9 @@ Object { "key": "/app/config/certs/node.key", "key_passphrase": null, "supported_protocols": Array [ - "TLSv1.0", "TLSv1.1", "TLSv1.2", + "TLSv1.3", ], }, "write_timeout": "30s", diff --git a/x-pack/plugins/fleet/server/integration_tests/helpers/docker_registry_helper.ts b/x-pack/plugins/fleet/server/integration_tests/helpers/docker_registry_helper.ts index 77bf8e0fbf3e4..60f68f135ba55 100644 --- a/x-pack/plugins/fleet/server/integration_tests/helpers/docker_registry_helper.ts +++ b/x-pack/plugins/fleet/server/integration_tests/helpers/docker_registry_helper.ts @@ -18,7 +18,7 @@ import pRetry from 'p-retry'; const BEFORE_SETUP_TIMEOUT = 30 * 60 * 1000; // 30 minutes; const DOCKER_START_TIMEOUT = 5 * 60 * 1000; // 5 minutes -const DOCKER_IMAGE = `docker.elastic.co/package-registry/distribution:93ffe45d8c4ae11365bc70b1038643121049b9fe`; +const DOCKER_IMAGE = `docker.elastic.co/package-registry/distribution:433d99a96f3289c5013ae35826877adf408eb9c9`; function firstWithTimeout(source$: Rx.Observable, errorMsg: string, ms = 30 * 1000) { return Rx.race( diff --git a/x-pack/plugins/graph/public/components/source_picker.tsx b/x-pack/plugins/graph/public/components/source_picker.tsx index 85f1e325ba748..31ec5b0663ea2 100644 --- a/x-pack/plugins/graph/public/components/source_picker.tsx +++ b/x-pack/plugins/graph/public/components/source_picker.tsx @@ -45,6 +45,7 @@ export function SourcePicker({ }), showSavedObject: (indexPattern) => !indexPattern.attributes.type, includeFields: ['type'], + defaultSearchField: 'name', }, ]} fixedPageSize={fixedPageSize} diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx index dd491c85de635..fabe1cf4da355 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx @@ -145,6 +145,7 @@ export const SourceSelection: FC = () => { defaultMessage: 'Data view', } ), + defaultSearchField: 'name', }, ]} fixedPageSize={fixedPageSize} diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx index 44f7eaa19193c..4ff22b93334b9 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx @@ -165,6 +165,7 @@ export const ChangeDataViewModal: FC = ({ onClose }) => { defaultMessage: 'Data view', } ), + defaultSearchField: 'name', }, ]} fixedPageSize={fixedPageSize} diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx index b4c25e177fb63..ed4ce31c3f9c4 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx @@ -67,6 +67,7 @@ export const Page: FC = ({ nextStepPath }) => { defaultMessage: 'Data view', } ), + defaultSearchField: 'name', }, ]} fixedPageSize={RESULTS_PER_PAGE} diff --git a/x-pack/plugins/observability/common/index.ts b/x-pack/plugins/observability/common/index.ts index 40b101f8fd4cb..794275c380c97 100644 --- a/x-pack/plugins/observability/common/index.ts +++ b/x-pack/plugins/observability/common/index.ts @@ -9,6 +9,8 @@ export type { AsDuration, AsPercent, TimeUnitChar } from './utils/formatters'; export { formatDurationFromTimeUnitChar } from './utils/formatters'; +export { ProcessorEvent } from './processor_event'; + export { enableInspectEsQueries, maxSuggestions, diff --git a/x-pack/plugins/ux/common/processor_event.ts b/x-pack/plugins/observability/common/processor_event.ts similarity index 100% rename from x-pack/plugins/ux/common/processor_event.ts rename to x-pack/plugins/observability/common/processor_event.ts diff --git a/x-pack/plugins/security_solution/common/constants.ts b/x-pack/plugins/security_solution/common/constants.ts index 9246e764800c4..222860e1a2d04 100644 --- a/x-pack/plugins/security_solution/common/constants.ts +++ b/x-pack/plugins/security_solution/common/constants.ts @@ -107,7 +107,7 @@ export enum SecurityPageName { network = 'network', networkAnomalies = 'network-anomalies', networkDns = 'network-dns', - networkExternalAlerts = 'network-external_alerts', + networkEvents = 'network-events', networkHttp = 'network-http', networkTls = 'network-tls', noPage = '', @@ -126,7 +126,6 @@ export enum SecurityPageName { usersAnomalies = 'users-anomalies', usersAuthentications = 'users-authentications', usersEvents = 'users-events', - usersExternalAlerts = 'users-external_alerts', usersRisk = 'users-risk', } diff --git a/x-pack/plugins/security_solution/cypress/integration/ml/ml_conditional_links.spec.ts b/x-pack/plugins/security_solution/cypress/integration/ml/ml_conditional_links.spec.ts index 8e2bd7ba2bb4d..5ab92be404c9d 100644 --- a/x-pack/plugins/security_solution/cypress/integration/ml/ml_conditional_links.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/ml/ml_conditional_links.spec.ts @@ -97,7 +97,7 @@ describe('ml conditional links', () => { visitWithoutDateRange(mlNetworkSingleIpNullKqlQuery); cy.url().should( 'include', - 'app/security/network/ip/127.0.0.1/source?sourcerer=(default:(id:security-solution-default,selectedPatterns:!(%27auditbeat-*%27)))&timerange=(global:(linkTo:!(timeline),timerange:(from:%272019-08-28T11:00:00.000Z%27,kind:absolute,to:%272019-08-28T13:59:59.999Z%27)),timeline:(linkTo:!(global),timerange:(from:%272019-08-28T11:00:00.000Z%27,kind:absolute,to:%272019-08-28T13:59:59.999Z%27)))' + 'app/security/network/ip/127.0.0.1/source/flows?sourcerer=(default:(id:security-solution-default,selectedPatterns:!(%27auditbeat-*%27)))&timerange=(global:(linkTo:!(timeline),timerange:(from:%272019-08-28T11:00:00.000Z%27,kind:absolute,to:%272019-08-28T13:59:59.999Z%27)),timeline:(linkTo:!(global),timerange:(from:%272019-08-28T11:00:00.000Z%27,kind:absolute,to:%272019-08-28T13:59:59.999Z%27)))' ); }); @@ -105,7 +105,7 @@ describe('ml conditional links', () => { visitWithoutDateRange(mlNetworkSingleIpKqlQuery); cy.url().should( 'include', - '/app/security/network/ip/127.0.0.1/source?sourcerer=(default:(id:security-solution-default,selectedPatterns:!(%27auditbeat-*%27)))&query=(language:kuery,query:%27(process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22)%27)&timerange=(global:(linkTo:!(timeline),timerange:(from:%272019-08-28T11:00:00.000Z%27,kind:absolute,to:%272019-08-28T13:59:59.999Z%27)),timeline:(linkTo:!(global),timerange:(from:%272019-08-28T11:00:00.000Z%27,kind:absolute,to:%272019-08-28T13:59:59.999Z%27)))' + '/app/security/network/ip/127.0.0.1/source/flows?sourcerer=(default:(id:security-solution-default,selectedPatterns:!(%27auditbeat-*%27)))&query=(language:kuery,query:%27(process.name:%20%22conhost.exe%22%20or%20process.name:%20%22sc.exe%22)%27)&timerange=(global:(linkTo:!(timeline),timerange:(from:%272019-08-28T11:00:00.000Z%27,kind:absolute,to:%272019-08-28T13:59:59.999Z%27)),timeline:(linkTo:!(global),timerange:(from:%272019-08-28T11:00:00.000Z%27,kind:absolute,to:%272019-08-28T13:59:59.999Z%27)))' ); }); diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_network.tsx b/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_network.tsx index 42a04a8685e3b..a1702dc766f57 100644 --- a/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_network.tsx +++ b/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_network.tsx @@ -7,6 +7,7 @@ import type { FlowTargetSourceDest } from '../../../../common/search_strategy/security_solution/network'; import { FlowTarget } from '../../../../common/search_strategy/security_solution/network'; +import { NetworkDetailsRouteType } from '../../../network/pages/details/types'; import { appendSearch } from './helpers'; @@ -15,5 +16,6 @@ export const getNetworkUrl = (search?: string) => `${appendSearch(search)}`; export const getNetworkDetailsUrl = ( detailName: string, flowTarget?: FlowTarget | FlowTargetSourceDest, - search?: string -) => `/ip/${detailName}/${flowTarget || FlowTarget.source}${appendSearch(search)}`; + search?: string, + tabName = NetworkDetailsRouteType.flows +) => `/ip/${detailName}/${flowTarget || FlowTarget.source}/${tabName}${appendSearch(search)}`; diff --git a/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx index f511d72bf49b2..13fdb96b86aeb 100644 --- a/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx @@ -75,17 +75,17 @@ describe('Custom Links', () => { test('can handle array of ips', () => { const wrapper = mount(); expect(wrapper.find('EuiLink').first().prop('href')).toEqual( - `/ip/${encodeURIComponent(ipv4)}/source` + `/ip/${encodeURIComponent(ipv4)}/source/flows` ); expect(wrapper.text()).toEqual(`${ipv4}${ipv4a}`); expect(wrapper.find('EuiLink').last().prop('href')).toEqual( - `/ip/${encodeURIComponent(ipv4a)}/source` + `/ip/${encodeURIComponent(ipv4a)}/source/flows` ); }); test('should render valid link to IP Details with ipv4 as the display text', () => { const wrapper = mount(); expect(wrapper.find('EuiLink').prop('href')).toEqual( - `/ip/${encodeURIComponent(ipv4)}/source` + `/ip/${encodeURIComponent(ipv4)}/source/flows` ); expect(wrapper.text()).toEqual(ipv4); }); @@ -93,7 +93,7 @@ describe('Custom Links', () => { test('should render valid link to IP Details with child text as the display text', () => { const wrapper = mount({hostName}); expect(wrapper.find('EuiLink').prop('href')).toEqual( - `/ip/${encodeURIComponent(ipv4)}/source` + `/ip/${encodeURIComponent(ipv4)}/source/flows` ); expect(wrapper.text()).toEqual(hostName); }); @@ -101,7 +101,7 @@ describe('Custom Links', () => { test('should render valid link to IP Details with ipv6 as the display text', () => { const wrapper = mount(); expect(wrapper.find('EuiLink').prop('href')).toEqual( - `/ip/${encodeURIComponent(ipv6Encoded)}/source` + `/ip/${encodeURIComponent(ipv6Encoded)}/source/flows` ); expect(wrapper.text()).toEqual(ipv6); }); diff --git a/x-pack/plugins/security_solution/public/common/components/links/index.tsx b/x-pack/plugins/security_solution/public/common/components/links/index.tsx index 016243b370126..7e7c33a2bebdf 100644 --- a/x-pack/plugins/security_solution/public/common/components/links/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/links/index.tsx @@ -213,32 +213,24 @@ const NetworkDetailsLinkComponent: React.FC<{ onClick?: (e: SyntheticEvent) => void | undefined; title?: string; }> = ({ Component, children, ip, flowTarget = FlowTarget.source, isButton, onClick, title }) => { - const { formatUrl, search } = useFormatUrl(SecurityPageName.network); - const { navigateToApp } = useKibana().services.application; - const goToNetworkDetails = useCallback( - (ev, cIp: string) => { - ev.preventDefault(); - navigateToApp(APP_UI_ID, { + const getSecuritySolutionLinkProps = useGetSecuritySolutionLinkProps(); + + const getLink = useCallback( + (cIp: string, i: number) => { + const { onClick: onClickNavigation, href } = getSecuritySolutionLinkProps({ deepLinkId: SecurityPageName.network, - path: getNetworkDetailsUrl(encodeURIComponent(encodeIpv6(cIp)), flowTarget, search), + path: getNetworkDetailsUrl(encodeURIComponent(encodeIpv6(cIp)), flowTarget), }); - }, - [flowTarget, navigateToApp, search] - ); - const getHref = useCallback( - (cIp: string) => formatUrl(getNetworkDetailsUrl(encodeURIComponent(encodeIpv6(cIp)))), - [formatUrl] - ); - const getLink = useCallback( - (cIp: string, i: number) => - isButton ? ( + const onLinkClick = onClick ?? ((e: SyntheticEvent) => onClickNavigation(e as MouseEvent)); + + return isButton ? ( goToNetworkDetails(e, cIp))} - href={getHref(cIp)} + onClick={onLinkClick} + href={href} title={title ?? cIp} > {children} @@ -246,14 +238,15 @@ const NetworkDetailsLinkComponent: React.FC<{ ) : ( goToNetworkDetails(e, cIp))} - href={getHref(cIp)} + onClick={onLinkClick} + href={href} data-test-subj="network-details" > {children ? children : cIp} - ), - [Component, children, getHref, goToNetworkDetails, isButton, onClick, title] + ); + }, + [children, Component, flowTarget, getSecuritySolutionLinkProps, onClick, isButton, title] ); return isArray(ip) ? <>{ip.map(getLink)} : getLink(ip, 0); }; diff --git a/x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.test.tsx index 49eb8fc3681d6..61efd3c906543 100644 --- a/x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.test.tsx @@ -262,7 +262,7 @@ describe('Matrix Histogram Component', () => { { detailName: undefined, pageName: 'network', - tabName: 'external-alerts', + tabName: 'events', }, ]); diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.test.ts b/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.test.ts index 674a609e7f71a..43ed208148caa 100644 --- a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.test.ts +++ b/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.test.ts @@ -257,7 +257,7 @@ describe('Navigation Breadcrumbs', () => { networkBreadcrumb, { text: ipv4, - href: `securitySolutionUI/network/ip/${ipv4}/source`, + href: `securitySolutionUI/network/ip/${ipv4}/source/flows`, }, { text: 'Flows', href: '' }, ]); @@ -274,7 +274,7 @@ describe('Navigation Breadcrumbs', () => { networkBreadcrumb, { text: ipv6, - href: `securitySolutionUI/network/ip/${ipv6Encoded}/source`, + href: `securitySolutionUI/network/ip/${ipv6Encoded}/source/flows`, }, { text: 'Flows', href: '' }, ]); @@ -574,7 +574,7 @@ describe('Navigation Breadcrumbs', () => { networkBreadcrumb, { text: ipv4, - href: `securitySolutionUI/network/ip/${ipv4}/source`, + href: `securitySolutionUI/network/ip/${ipv4}/source/flows`, }, { text: 'Flows', href: '' }, ]); @@ -592,7 +592,7 @@ describe('Navigation Breadcrumbs', () => { networkBreadcrumb, { text: ipv6, - href: `securitySolutionUI/network/ip/${ipv6Encoded}/source`, + href: `securitySolutionUI/network/ip/${ipv6Encoded}/source/flows`, }, { text: 'Flows', href: '' }, ]); diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_primary_navigation.tsx b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_primary_navigation.tsx index 66a4aef3618bb..947a651117777 100644 --- a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_primary_navigation.tsx +++ b/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_primary_navigation.tsx @@ -9,6 +9,7 @@ import React, { useEffect, useState, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import type { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import { SecurityPageName } from '../../../../../common/constants'; import type { PrimaryNavigationProps } from './types'; import { usePrimaryNavigationItems } from './use_navigation_items'; import { useIsGroupedNavigationEnabled } from '../helpers'; @@ -25,10 +26,14 @@ export const usePrimaryNavigation = ({ tabName, }: PrimaryNavigationProps): KibanaPageTemplateProps['solutionNav'] => { const isGroupedNavigationEnabled = useIsGroupedNavigationEnabled(); - const mapLocationToTab = useCallback( - (): string => ((tabName && navTabs[tabName]) || navTabs[pageName])?.id ?? '', - [pageName, tabName, navTabs] - ); + const mapLocationToTab = useCallback((): string => { + if (pageName === SecurityPageName.administration) { + // revist with ticket #137625. consider using tab Ids instead of tab Name for matching + return ((tabName && navTabs[tabName]) || navTabs[pageName])?.id ?? ''; + } else { + return (navTabs[pageName] || (tabName && navTabs[tabName]))?.id ?? ''; + } + }, [pageName, tabName, navTabs]); const [selectedTabId, setSelectedTabId] = useState(mapLocationToTab()); diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.tsx b/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.tsx index 58220d34e6717..2cb8710aac45c 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.tsx +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.tsx @@ -45,7 +45,7 @@ export const useLensAttributes = ({ return hostNameExistsFilter; } - if (pageName === SecurityPageName.network && tabName === NetworkRouteType.alerts) { + if (pageName === SecurityPageName.network && tabName === NetworkRouteType.events) { return filterNetworkExternalAlertData; } diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/utils.ts b/x-pack/plugins/security_solution/public/common/components/visualization_actions/utils.ts index 81fe999961ee1..c66a608ecd989 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/utils.ts +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/utils.ts @@ -62,6 +62,41 @@ export const hostNameExistsFilter: Filter[] = [ }, ]; +export const getNetworkDetailsPageFilter = (ipAddress?: string): Filter[] => + ipAddress + ? [ + { + meta: { + alias: null, + negate: false, + disabled: false, + type: 'phrase', + key: 'source.ip', + params: { + query: ipAddress, + }, + }, + query: { + bool: { + should: [ + { + match_phrase: { + 'source.ip': ipAddress, + }, + }, + { + match_phrase: { + 'destination.ip': ipAddress, + }, + }, + ], + minimum_should_match: 1, + }, + }, + }, + ] + : []; + export const filterNetworkExternalAlertData: Filter[] = [ { query: { diff --git a/x-pack/plugins/security_solution/public/network/pages/constants.ts b/x-pack/plugins/security_solution/public/network/pages/constants.ts new file mode 100644 index 0000000000000..3ddfe713db1f2 --- /dev/null +++ b/x-pack/plugins/security_solution/public/network/pages/constants.ts @@ -0,0 +1,43 @@ +/* + * 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 { NETWORK_PATH } from '../../../common/constants'; +import { FlowTargetSourceDest } from '../../../common/search_strategy'; +import { NetworkDetailsRouteType } from './details/types'; +import { NetworkRouteType } from './navigation/types'; + +const NETWORK_TABS = [ + NetworkRouteType.flows, + NetworkRouteType.dns, + NetworkRouteType.http, + NetworkRouteType.tls, + NetworkRouteType.events, +]; + +const NETWORK_WITHOUT_ANOMALIES_TAB_PARAM = NETWORK_TABS.join('|'); +const NETWORK_WITH_ANOMALIES_TAB_PARAM = [...NETWORK_TABS, NetworkRouteType.anomalies].join('|'); + +export const NETWORK_PATH_WITH_ANOMALIES = `${NETWORK_PATH}/:tabName(${NETWORK_WITH_ANOMALIES_TAB_PARAM})`; +export const NETWORK_PATH_WITHOUT_ANOMALIES = `${NETWORK_PATH}/:tabName(${NETWORK_WITHOUT_ANOMALIES_TAB_PARAM})`; + +const DETAIL_TABS_PARAM = [ + NetworkDetailsRouteType.flows, + NetworkDetailsRouteType.http, + NetworkDetailsRouteType.tls, + NetworkDetailsRouteType.anomalies, + NetworkDetailsRouteType.events, + NetworkDetailsRouteType.users, +].join('|'); + +export const FLOW_TARGET_PARAM = [ + FlowTargetSourceDest.source, + FlowTargetSourceDest.destination, +].join('|'); + +export const NETWORK_DETAILS_PAGE_PATH = `${NETWORK_PATH}/ip/:detailName`; + +export const NETWORK_DETAILS_TAB_PATH = `${NETWORK_DETAILS_PAGE_PATH}/:flowTarget(${FLOW_TARGET_PARAM})/:tabName(${DETAIL_TABS_PARAM})`; diff --git a/x-pack/plugins/security_solution/public/network/pages/details/details_tabs.tsx b/x-pack/plugins/security_solution/public/network/pages/details/details_tabs.tsx new file mode 100644 index 0000000000000..82e206ce66f93 --- /dev/null +++ b/x-pack/plugins/security_solution/public/network/pages/details/details_tabs.tsx @@ -0,0 +1,131 @@ +/* + * 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, { useMemo } from 'react'; +import { Switch } from 'react-router-dom'; + +import { EuiFlexItem, EuiSpacer } from '@elastic/eui'; +import type { DataViewBase, Filter } from '@kbn/es-query'; +import { Route } from '@kbn/kibana-react-plugin/public'; +import { TimelineId } from '@kbn/timelines-plugin/common'; +import { getNetworkDetailsPageFilter } from '../../../common/components/visualization_actions/utils'; +import { AnomaliesNetworkTable } from '../../../common/components/ml/tables/anomalies_network_table'; +import { FlowTargetSourceDest } from '../../../../common/search_strategy/security_solution/network'; +import { EventsQueryTabBody } from '../../../common/components/events_tab/events_query_tab_body'; +import type { GlobalTimeArgs } from '../../../common/containers/use_global_time'; + +import { AnomaliesQueryTabBody } from '../../../common/containers/anomalies/anomalies_query_tab_body'; + +import { NETWORK_DETAILS_PAGE_PATH } from '../constants'; + +import { + CountriesQueryTabBody, + HttpQueryTabBody, + IPsQueryTabBody, + TlsQueryTabBody, + UsersQueryTabBody, +} from '../navigation'; +import { ConditionalFlexGroup } from '../navigation/conditional_flex_group'; +import { networkModel } from '../../store'; +import { NetworkDetailsRouteType } from './types'; + +interface NetworkDetailTabsProps { + ip: string; + endDate: string; + startDate: string; + filterQuery: string | undefined; + indexNames: string[]; + skip: boolean; + setQuery: GlobalTimeArgs['setQuery']; + narrowDateRange: (score: unknown, interval: unknown) => void; + indexPattern: DataViewBase; + flowTarget: FlowTargetSourceDest; +} + +export const NetworkDetailsTabs = React.memo( + ({ narrowDateRange, indexPattern, flowTarget, ...rest }) => { + const type = networkModel.NetworkType.details; + + const commonProps = { ...rest, type }; + const flowTabProps = { ...commonProps, indexPattern }; + const commonPropsWithFlowTarget = { ...commonProps, flowTarget }; + + const networkDetailsPageFilters: Filter[] = useMemo( + () => getNetworkDetailsPageFilter(rest.ip), + [rest.ip] + ); + + return ( + + + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); + } +); + +NetworkDetailsTabs.displayName = 'UsersDetailsTabs'; diff --git a/x-pack/plugins/security_solution/public/network/pages/details/index.test.tsx b/x-pack/plugins/security_solution/public/network/pages/details/index.test.tsx index 363a9de3d9633..23dc45a47a60d 100644 --- a/x-pack/plugins/security_solution/public/network/pages/details/index.test.tsx +++ b/x-pack/plugins/security_solution/public/network/pages/details/index.test.tsx @@ -64,7 +64,6 @@ jest.mock('react-router-dom', () => { jest.mock('../../containers/details', () => ({ useNetworkDetails: jest.fn().mockReturnValue([true, { networkDetails: {} }]), })); -jest.mock('../../../common/lib/kibana'); jest.mock('../../../common/containers/sourcerer'); jest.mock('../../../common/containers/use_global_time', () => ({ useGlobalTime: jest.fn().mockReturnValue({ @@ -75,6 +74,27 @@ jest.mock('../../../common/containers/use_global_time', () => ({ }), })); +jest.mock('../../../common/lib/kibana', () => { + const original = jest.requireActual('../../../common/lib/kibana'); + return { + ...original, + useNavigation: () => ({ + getAppUrl: jest.fn, + }), + useKibana: () => ({ + services: { + ...original.useKibana().services, + timelines: { + getUseDraggableKeyboardWrapper: () => () => ({ + onBlur: jest.fn, + onKeyDown: jest.fn, + }), + }, + }, + }), + }; +}); + // Test will fail because we will to need to mock some core services to make the test work // For now let's forget about SiemSearchBar and QueryBar jest.mock('../../../common/components/search_bar', () => ({ diff --git a/x-pack/plugins/security_solution/public/network/pages/details/index.tsx b/x-pack/plugins/security_solution/public/network/pages/details/index.tsx index 809a4cfdb8ef5..082f8e7d4529e 100644 --- a/x-pack/plugins/security_solution/public/network/pages/details/index.tsx +++ b/x-pack/plugins/security_solution/public/network/pages/details/index.tsx @@ -5,21 +5,16 @@ * 2.0. */ -import { EuiHorizontalRule, EuiSpacer, EuiFlexItem } from '@elastic/eui'; +import { EuiHorizontalRule, EuiSpacer } from '@elastic/eui'; import React, { useCallback, useEffect, useMemo } from 'react'; import { useDispatch } from 'react-redux'; import { useParams } from 'react-router-dom'; import { getEsQueryConfig } from '@kbn/data-plugin/common'; -import { - CountriesQueryTabBody, - HttpQueryTabBody, - IPsQueryTabBody, - TlsQueryTabBody, - UsersQueryTabBody, -} from '../navigation'; + import { useDeepEqualSelector } from '../../../common/hooks/use_selector'; -import { FlowTargetSourceDest, LastEventIndexKey } from '../../../../common/search_strategy'; +import { LastEventIndexKey } from '../../../../common/search_strategy'; +import type { FlowTargetSourceDest } from '../../../../common/search_strategy'; import { useGlobalTime } from '../../../common/containers/use_global_time'; import { FiltersGlobal } from '../../../common/components/filters_global'; import { HeaderPage } from '../../../common/components/header_page'; @@ -27,7 +22,6 @@ import { LastEventTime } from '../../../common/components/last_event_time'; import { useAnomaliesTableData } from '../../../common/components/ml/anomaly/use_anomalies_table_data'; import { networkToCriteria } from '../../../common/components/ml/criteria/network_to_criteria'; import { scoreIntervalToDateTime } from '../../../common/components/ml/score/score_interval_to_datetime'; -import { AnomaliesNetworkTable } from '../../../common/components/ml/tables/anomalies_network_table'; import { manageQuery } from '../../../common/components/page/manage_query'; import { FlowTargetSelectConnected } from '../../components/flow_target_select_connected'; import { IpOverview } from '../../components/details'; @@ -37,23 +31,29 @@ import { useNetworkDetails, ID } from '../../containers/details'; import { useKibana } from '../../../common/lib/kibana'; import { decodeIpv6 } from '../../../common/lib/helpers'; import { convertToBuildEsQuery } from '../../../common/lib/keury'; -import { ConditionalFlexGroup } from '../navigation/conditional_flex_group'; import { inputsSelectors } from '../../../common/store'; import { setAbsoluteRangeDatePicker } from '../../../common/store/inputs/actions'; import { setNetworkDetailsTablesActivePageToZero } from '../../store/actions'; import { SpyRoute } from '../../../common/utils/route/spy_routes'; -import { AnomaliesQueryTabBody } from '../../../common/containers/anomalies/anomalies_query_tab_body'; import { networkModel } from '../../store'; import { SecurityPageName } from '../../../app/types'; import { useSourcererDataView } from '../../../common/containers/sourcerer'; import { useInvalidFilterQuery } from '../../../common/hooks/use_invalid_filter_query'; import { LandingPageComponent } from '../../../common/components/landing_page'; +import { SecuritySolutionTabNavigation } from '../../../common/components/navigation'; +import { getNetworkDetailsPageFilter } from '../../../common/components/visualization_actions/utils'; +import { hasMlUserPermissions } from '../../../../common/machine_learning/has_ml_user_permissions'; +import { useMlCapabilities } from '../../../common/components/ml/hooks/use_ml_capabilities'; +import { navTabsNetworkDetails } from './nav_tabs'; +import { NetworkDetailsTabs } from './details_tabs'; + export { getTrailingBreadcrumbs } from './utils'; const NetworkDetailsManage = manageQuery(IpOverview); const NetworkDetailsComponent: React.FC = () => { const dispatch = useDispatch(); + const capabilities = useMlCapabilities(); const { to, from, setQuery, isInitializing } = useGlobalTime(); const { detailName, flowTarget } = useParams<{ detailName: string; @@ -92,11 +92,17 @@ const NetworkDetailsComponent: React.FC = () => { const { indicesExist, indexPattern, selectedPatterns } = useSourcererDataView(); const ip = decodeIpv6(detailName); + + const queryFilters = useMemo( + () => [...getNetworkDetailsPageFilter(ip), ...filters], + [filters, ip] + ); + const [filterQuery, kqlError] = convertToBuildEsQuery({ config: getEsQueryConfig(uiSettings), indexPattern, queries: [query], - filters, + filters: queryFilters, }); useInvalidFilterQuery({ id: ID, filterQuery, kqlError, query, startDate: from, endDate: to }); @@ -150,7 +156,6 @@ const NetworkDetailsComponent: React.FC = () => { > - { narrowDateRange={narrowDateRange} indexPatterns={selectedPatterns} /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/x-pack/plugins/security_solution/public/network/pages/details/nav_tabs.test.tsx b/x-pack/plugins/security_solution/public/network/pages/details/nav_tabs.test.tsx new file mode 100644 index 0000000000000..25572e2f954e7 --- /dev/null +++ b/x-pack/plugins/security_solution/public/network/pages/details/nav_tabs.test.tsx @@ -0,0 +1,62 @@ +/* + * 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 { FlowTargetSourceDest } from '../../../../common/search_strategy'; +import { navTabsNetworkDetails } from './nav_tabs'; +import { NetworkDetailsRouteType } from './types'; + +describe('navTabsNetworkDetails', () => { + test('it should return all tabs if user has ML capabilities', () => { + const tabs = navTabsNetworkDetails('', true, FlowTargetSourceDest.source); + expect(tabs).toEqual(mockTabs); + }); + + test('it should not display anomalies tab if user has no ml permission', () => { + const tabs = navTabsNetworkDetails('', false, FlowTargetSourceDest.source); + + expect(tabs).not.toHaveProperty(NetworkDetailsRouteType.anomalies); + }); +}); + +const mockTabs = { + flows: { + id: 'flows', + name: 'Flows', + href: '/network/ip//source/flows', + disabled: false, + }, + users: { + id: 'users', + name: 'Users', + href: '/network/ip//source/users', + disabled: false, + }, + http: { + id: 'http', + name: 'HTTP', + href: '/network/ip//source/http', + disabled: false, + }, + tls: { + id: 'tls', + name: 'TLS', + href: '/network/ip//source/tls', + disabled: false, + }, + anomalies: { + id: 'anomalies', + name: 'Anomalies', + href: '/network/ip//source/anomalies', + disabled: false, + }, + events: { + id: 'events', + name: 'Events', + href: '/network/ip//source/events', + disabled: false, + }, +}; diff --git a/x-pack/plugins/security_solution/public/network/pages/details/nav_tabs.tsx b/x-pack/plugins/security_solution/public/network/pages/details/nav_tabs.tsx new file mode 100644 index 0000000000000..6569b68815040 --- /dev/null +++ b/x-pack/plugins/security_solution/public/network/pages/details/nav_tabs.tsx @@ -0,0 +1,69 @@ +/* + * 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 type { FlowTargetSourceDest } from '../../../../common/search_strategy'; +import { NETWORK_PATH } from '../../../../common/constants'; +import * as i18n from '../translations'; +import type { NetworkDetailsNavTabs } from './types'; +import { NetworkDetailsRouteType } from './types'; + +const getTabsOnNetworkDetailsUrl = ( + ipAddress: string, + tabName: NetworkDetailsRouteType, + flowTarget: FlowTargetSourceDest +) => `${NETWORK_PATH}/ip/${ipAddress}/${flowTarget}/${tabName}`; + +export const navTabsNetworkDetails = ( + ipAddress: string, + hasMlUserPermissions: boolean, + flowTarget: FlowTargetSourceDest +): NetworkDetailsNavTabs => { + const networkDetailsNavTabs: NetworkDetailsNavTabs = { + [NetworkDetailsRouteType.flows]: { + id: NetworkDetailsRouteType.flows, + name: i18n.NAVIGATION_FLOWS_TITLE, + href: getTabsOnNetworkDetailsUrl(ipAddress, NetworkDetailsRouteType.flows, flowTarget), + disabled: false, + }, + [NetworkDetailsRouteType.users]: { + id: NetworkDetailsRouteType.users, + name: i18n.NAVIGATION_USERS_TITLE, + href: getTabsOnNetworkDetailsUrl(ipAddress, NetworkDetailsRouteType.users, flowTarget), + disabled: false, + }, + [NetworkDetailsRouteType.http]: { + id: NetworkDetailsRouteType.http, + name: i18n.NAVIGATION_HTTP_TITLE, + href: getTabsOnNetworkDetailsUrl(ipAddress, NetworkDetailsRouteType.http, flowTarget), + disabled: false, + }, + [NetworkDetailsRouteType.tls]: { + id: NetworkDetailsRouteType.tls, + name: i18n.NAVIGATION_TLS_TITLE, + href: getTabsOnNetworkDetailsUrl(ipAddress, NetworkDetailsRouteType.tls, flowTarget), + disabled: false, + }, + [NetworkDetailsRouteType.anomalies]: { + id: NetworkDetailsRouteType.anomalies, + name: i18n.NAVIGATION_ANOMALIES_TITLE, + href: getTabsOnNetworkDetailsUrl(ipAddress, NetworkDetailsRouteType.anomalies, flowTarget), + disabled: false, + }, + [NetworkDetailsRouteType.events]: { + id: NetworkDetailsRouteType.events, + name: i18n.NAVIGATION_EVENTS_TITLE, + href: getTabsOnNetworkDetailsUrl(ipAddress, NetworkDetailsRouteType.events, flowTarget), + disabled: false, + }, + }; + + if (!hasMlUserPermissions) { + delete networkDetailsNavTabs.anomalies; + } + + return networkDetailsNavTabs; +}; diff --git a/x-pack/plugins/security_solution/public/network/pages/details/types.ts b/x-pack/plugins/security_solution/public/network/pages/details/types.ts index 26d27f26415f8..726232aed3068 100644 --- a/x-pack/plugins/security_solution/public/network/pages/details/types.ts +++ b/x-pack/plugins/security_solution/public/network/pages/details/types.ts @@ -5,9 +5,12 @@ * 2.0. */ +import type { Optional } from '@kbn/utility-types'; + import type { ESTermQuery } from '../../../../common/typed_json'; -import { NetworkType } from '../../store/model'; +import type { NavTab } from '../../../common/components/navigation/types'; import type { GlobalTimeArgs } from '../../../common/containers/use_global_time'; +import { NetworkType } from '../../store/model'; export const type = NetworkType.details; @@ -21,3 +24,17 @@ export interface OwnProps { skip: boolean; setQuery: GlobalTimeArgs['setQuery']; } + +export enum NetworkDetailsRouteType { + anomalies = 'anomalies', + flows = 'flows', + tls = 'tls', + http = 'http', + events = 'events', + users = 'users', +} + +export type NetworkDetailsNavTabs = Optional< + Record<`${NetworkDetailsRouteType}`, NavTab>, + 'anomalies' +>; diff --git a/x-pack/plugins/security_solution/public/network/pages/details/utils.ts b/x-pack/plugins/security_solution/public/network/pages/details/utils.ts index ff8d44a07ef17..54bb1720d2d5d 100644 --- a/x-pack/plugins/security_solution/public/network/pages/details/utils.ts +++ b/x-pack/plugins/security_solution/public/network/pages/details/utils.ts @@ -12,19 +12,21 @@ import { decodeIpv6 } from '../../../common/lib/helpers'; import { getNetworkDetailsUrl } from '../../../common/components/link_to/redirect_to_network'; import { networkModel } from '../../store'; import * as i18n from '../translations'; -import { NetworkRouteType } from '../navigation/types'; +import { NetworkDetailsRouteType } from './types'; import type { NetworkRouteSpyState } from '../../../common/utils/route/types'; import { SecurityPageName } from '../../../app/types'; import type { GetSecuritySolutionUrl } from '../../../common/components/link_to'; +import { NetworkRouteType } from '../navigation/types'; export const type = networkModel.NetworkType.details; -const TabNameMappedToI18nKey: Record = { - [NetworkRouteType.alerts]: i18n.NAVIGATION_EVENTS_TITLE, - [NetworkRouteType.anomalies]: i18n.NAVIGATION_ANOMALIES_TITLE, - [NetworkRouteType.flows]: i18n.NAVIGATION_FLOWS_TITLE, +const TabNameMappedToI18nKey: Record = { + [NetworkDetailsRouteType.events]: i18n.NAVIGATION_EVENTS_TITLE, + [NetworkDetailsRouteType.anomalies]: i18n.NAVIGATION_ANOMALIES_TITLE, + [NetworkDetailsRouteType.flows]: i18n.NAVIGATION_FLOWS_TITLE, + [NetworkDetailsRouteType.users]: i18n.NAVIGATION_USERS_TITLE, + [NetworkDetailsRouteType.http]: i18n.NAVIGATION_HTTP_TITLE, + [NetworkDetailsRouteType.tls]: i18n.NAVIGATION_TLS_TITLE, [NetworkRouteType.dns]: i18n.NAVIGATION_DNS_TITLE, - [NetworkRouteType.http]: i18n.NAVIGATION_HTTP_TITLE, - [NetworkRouteType.tls]: i18n.NAVIGATION_TLS_TITLE, }; export const getTrailingBreadcrumbs = ( diff --git a/x-pack/plugins/security_solution/public/network/pages/index.tsx b/x-pack/plugins/security_solution/public/network/pages/index.tsx index 30510e3269f5c..e55e501a17176 100644 --- a/x-pack/plugins/security_solution/public/network/pages/index.tsx +++ b/x-pack/plugins/security_solution/public/network/pages/index.tsx @@ -17,10 +17,18 @@ import { Network } from './network'; import { getNetworkRoutePath } from './navigation'; import { NetworkRouteType } from './navigation/types'; import { MlNetworkConditionalContainer } from '../../common/components/ml/conditional_links/ml_network_conditional_container'; -import { FlowTarget } from '../../../common/search_strategy'; import { NETWORK_PATH } from '../../../common/constants'; +import { FlowTargetSourceDest } from '../../../common/search_strategy'; +import { + FLOW_TARGET_PARAM, + NETWORK_DETAILS_PAGE_PATH, + NETWORK_DETAILS_TAB_PATH, +} from './constants'; -const ipDetailsPageBasePath = `${NETWORK_PATH}/ip/:detailName`; +const getPathWithFlowType = (detailName: string, flowTarget?: FlowTargetSourceDest) => + `${NETWORK_PATH}/ip/${detailName}/${flowTarget || FlowTargetSourceDest.source}/${ + NetworkRouteType.flows + }`; const NetworkContainerComponent = () => { const capabilities = useMlCapabilities(); @@ -53,25 +61,32 @@ const NetworkContainerComponent = () => { hasMlUserPermissions={userHasMlUserPermissions} /> - + ( )} /> + + + ); }; diff --git a/x-pack/plugins/security_solution/public/network/pages/navigation/nav_tabs.tsx b/x-pack/plugins/security_solution/public/network/pages/navigation/nav_tabs.tsx index d1992c756cc67..9097bb10a1c58 100644 --- a/x-pack/plugins/security_solution/public/network/pages/navigation/nav_tabs.tsx +++ b/x-pack/plugins/security_solution/public/network/pages/navigation/nav_tabs.tsx @@ -45,10 +45,10 @@ export const navTabsNetwork = (hasMlUserPermissions: boolean): NetworkNavTab => href: getTabsOnNetworkUrl(NetworkRouteType.anomalies), disabled: false, }, - [NetworkRouteType.alerts]: { - id: NetworkRouteType.alerts, + [NetworkRouteType.events]: { + id: NetworkRouteType.events, name: i18n.NAVIGATION_EVENTS_TITLE, - href: getTabsOnNetworkUrl(NetworkRouteType.alerts), + href: getTabsOnNetworkUrl(NetworkRouteType.events), disabled: false, }, }; diff --git a/x-pack/plugins/security_solution/public/network/pages/navigation/network_routes.tsx b/x-pack/plugins/security_solution/public/network/pages/navigation/network_routes.tsx index c98ddacb6122b..0e7d55b4af10f 100644 --- a/x-pack/plugins/security_solution/public/network/pages/navigation/network_routes.tsx +++ b/x-pack/plugins/security_solution/public/network/pages/navigation/network_routes.tsx @@ -155,7 +155,7 @@ export const NetworkRoutes = React.memo( AnomaliesTableComponent={AnomaliesNetworkTable} /> - + ; +export type NetworkNavTab = Optional, 'anomalies'>; export type GetNetworkRoutePath = ( capabilitiesFetched: boolean, diff --git a/x-pack/plugins/security_solution/public/network/pages/navigation/utils.ts b/x-pack/plugins/security_solution/public/network/pages/navigation/utils.ts index 5eb469e22297d..17611998cefde 100644 --- a/x-pack/plugins/security_solution/public/network/pages/navigation/utils.ts +++ b/x-pack/plugins/security_solution/public/network/pages/navigation/utils.ts @@ -5,25 +5,13 @@ * 2.0. */ -import { NETWORK_PATH } from '../../../../common/constants'; +import { NETWORK_PATH_WITH_ANOMALIES, NETWORK_PATH_WITHOUT_ANOMALIES } from '../constants'; import type { GetNetworkRoutePath } from './types'; -import { NetworkRouteType } from './types'; export const getNetworkRoutePath: GetNetworkRoutePath = ( capabilitiesFetched, hasMlUserPermission -) => { - if (capabilitiesFetched && !hasMlUserPermission) { - return `${NETWORK_PATH}/:tabName(${NetworkRouteType.flows}|${NetworkRouteType.dns}|${NetworkRouteType.http}|${NetworkRouteType.tls}|${NetworkRouteType.alerts})`; - } - - return ( - `${NETWORK_PATH}/:tabName(` + - `${NetworkRouteType.flows}|` + - `${NetworkRouteType.dns}|` + - `${NetworkRouteType.anomalies}|` + - `${NetworkRouteType.http}|` + - `${NetworkRouteType.tls}|` + - `${NetworkRouteType.alerts})` - ); -}; +) => + capabilitiesFetched && !hasMlUserPermission + ? NETWORK_PATH_WITHOUT_ANOMALIES + : NETWORK_PATH_WITH_ANOMALIES; diff --git a/x-pack/plugins/security_solution/public/network/pages/network.tsx b/x-pack/plugins/security_solution/public/network/pages/network.tsx index b117624782af8..4ff93aa701f04 100644 --- a/x-pack/plugins/security_solution/public/network/pages/network.tsx +++ b/x-pack/plugins/security_solution/public/network/pages/network.tsx @@ -87,7 +87,7 @@ const NetworkComponent = React.memo( const canUseMaps = kibana.services.application.capabilities.maps.show; const tabsFilters = useMemo(() => { - if (tabName === NetworkRouteType.alerts) { + if (tabName === NetworkRouteType.events) { return filters.length > 0 ? [...filters, ...filterNetworkExternalAlertData] : filterNetworkExternalAlertData; diff --git a/x-pack/plugins/security_solution/public/network/pages/translations.ts b/x-pack/plugins/security_solution/public/network/pages/translations.ts index 550afe94f811f..52d787a5fc56e 100644 --- a/x-pack/plugins/security_solution/public/network/pages/translations.ts +++ b/x-pack/plugins/security_solution/public/network/pages/translations.ts @@ -25,6 +25,13 @@ export const NAVIGATION_DNS_TITLE = i18n.translate( } ); +export const NAVIGATION_USERS_TITLE = i18n.translate( + 'xpack.securitySolution.network.navigation.usersTitle', + { + defaultMessage: 'Users', + } +); + export const NAVIGATION_TLS_TITLE = i18n.translate( 'xpack.securitySolution.network.navigation.tlsTitle', { diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap index bcfd01077cca0..7df27ab863446 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap @@ -1123,7 +1123,7 @@ tr:hover .c3:focus::before { 192.168.1.2 @@ -2002,7 +2002,7 @@ tr:hover .c3:focus::before { 10.1.2.3 diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap index 88b357b355a2b..d551b5ed3bae6 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap @@ -1261,7 +1261,7 @@ tr:hover .c5:focus::before { 192.168.1.2 @@ -2305,7 +2305,7 @@ tr:hover .c5:focus::before { 10.1.2.3 diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_errors/monitor_async_error.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_errors/monitor_async_error.test.tsx index 90239f7d5f9f6..c4f6a8c597205 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_errors/monitor_async_error.test.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_errors/monitor_async_error.test.tsx @@ -52,6 +52,7 @@ describe('', () => { error: null, loading: true, loaded: false, + monitorUpsertStatuses: {}, data: { absoluteTotal: 6, perPage: 5, diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_enabled.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_enabled.tsx index 4d7fd52e6781f..6c89c89342c96 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_enabled.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_enabled.tsx @@ -6,7 +6,7 @@ */ import { EuiSwitch, EuiSwitchEvent, EuiLoadingSpinner } from '@elastic/eui'; -import React from 'react'; +import React, { useMemo } from 'react'; import { FETCH_STATUS } from '@kbn/observability-plugin/public'; import { useCanEditSynthetics } from '../../../../../../hooks/use_capabilities'; import { ConfigKey, EncryptedSyntheticsMonitor } from '../../../../../../../common/runtime_types'; @@ -23,15 +23,19 @@ interface Props { export const MonitorEnabled = ({ id, monitor, reloadPage, initialLoading }: Props) => { const isDisabled = !useCanEditSynthetics(); - const { isEnabled, setIsEnabled, status } = useMonitorEnableHandler({ + const monitorName = monitor[ConfigKey.NAME]; + const statusLabels = useMemo(() => { + return { + failureLabel: labels.getMonitorEnabledUpdateFailureMessage(monitorName), + enabledSuccessLabel: labels.getMonitorEnabledSuccessLabel(monitorName), + disabledSuccessLabel: labels.getMonitorDisabledSuccessLabel(monitorName), + }; + }, [monitorName]); + + const { isEnabled, updateMonitorEnabledState, status } = useMonitorEnableHandler({ id, - monitor, reloadPage, - labels: { - failureLabel: labels.getMonitorEnabledUpdateFailureMessage(monitor[ConfigKey.NAME]), - enabledSuccessLabel: labels.getMonitorEnabledSuccessLabel(monitor[ConfigKey.NAME]), - disabledSuccessLabel: labels.getMonitorDisabledSuccessLabel(monitor[ConfigKey.NAME]), - }, + labels: statusLabels, }); const enabled = isEnabled ?? monitor[ConfigKey.ENABLED]; @@ -39,7 +43,7 @@ export const MonitorEnabled = ({ id, monitor, reloadPage, initialLoading }: Prop const handleEnabledChange = (event: EuiSwitchEvent) => { const checked = event.target.checked; - setIsEnabled(checked); + updateMonitorEnabledState(monitor, checked); }; return ( diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx index 5062805f84eb2..e1703654f8538 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx @@ -6,10 +6,15 @@ */ import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { FETCH_STATUS, useFetcher } from '@kbn/observability-plugin/public'; -import React, { useEffect, useState } from 'react'; +import { FETCH_STATUS } from '@kbn/observability-plugin/public'; +import React, { useCallback, useEffect, useState } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; import { ConfigKey, EncryptedSyntheticsMonitor } from '../components/monitors_page/overview/types'; -import { fetchUpsertMonitor } from '../state'; +import { + clearMonitorUpsertStatus, + fetchUpsertMonitorAction, + selectMonitorUpsertStatuses, +} from '../state'; export interface EnableStateMonitorLabels { failureLabel: string; @@ -19,41 +24,63 @@ export interface EnableStateMonitorLabels { export function useMonitorEnableHandler({ id, - monitor, reloadPage, labels, }: { id: string; - monitor: EncryptedSyntheticsMonitor; reloadPage: () => void; labels?: EnableStateMonitorLabels; }) { + const dispatch = useDispatch(); + const upsertStatuses = useSelector(selectMonitorUpsertStatuses); + const status = upsertStatuses[id]?.status; + const savedObjEnabledState = upsertStatuses[id]?.enabled; const [isEnabled, setIsEnabled] = useState(null); - const { status } = useFetcher(() => { - if (isEnabled !== null) { - return fetchUpsertMonitor({ id, monitor: { ...monitor, [ConfigKey.ENABLED]: isEnabled } }); - } - }, [isEnabled]); + const updateMonitorEnabledState = useCallback( + (monitor: EncryptedSyntheticsMonitor, enabled: boolean) => { + dispatch( + fetchUpsertMonitorAction({ + id, + monitor: { ...monitor, [ConfigKey.ENABLED]: enabled }, + }) + ); + }, + [dispatch, id] + ); + const { notifications } = useKibana(); + useEffect(() => { - if (status === FETCH_STATUS.FAILURE && labels) { - notifications.toasts.danger({ - title:

{labels.failureLabel}

, - toastLifeTimeMs: 3000, - }); - setIsEnabled(null); - } else if (status === FETCH_STATUS.SUCCESS && labels) { + if (status === FETCH_STATUS.SUCCESS && labels) { notifications.toasts.success({ title: (

- {isEnabled ? labels.enabledSuccessLabel : labels.disabledSuccessLabel} + {savedObjEnabledState ? labels.enabledSuccessLabel : labels.disabledSuccessLabel}

), toastLifeTimeMs: 3000, }); + setIsEnabled(!!savedObjEnabledState); + dispatch(clearMonitorUpsertStatus(id)); reloadPage(); + } else if (status === FETCH_STATUS.FAILURE && labels) { + notifications.toasts.danger({ + title:

{labels.failureLabel}

, + toastLifeTimeMs: 3000, + }); + setIsEnabled(null); + dispatch(clearMonitorUpsertStatus(id)); } - }, [status, labels]); // eslint-disable-line react-hooks/exhaustive-deps + }, [ + status, + labels, + notifications.toasts, + isEnabled, + dispatch, + id, + reloadPage, + savedObjEnabledState, + ]); - return { isEnabled, setIsEnabled, status }; + return { isEnabled, setIsEnabled, updateMonitorEnabledState, status }; } diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts index b9969cca2afc6..bd65a771de531 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts @@ -5,7 +5,12 @@ * 2.0. */ -import { MonitorManagementListResult } from '../../../../../common/runtime_types'; +import { IHttpFetchError } from '@kbn/core-http-browser'; +import { createAction } from '@reduxjs/toolkit'; +import { + EncryptedSyntheticsMonitor, + MonitorManagementListResult, +} from '../../../../../common/runtime_types'; import { createAsyncAction } from '../utils/actions'; import { MonitorListPageState } from './models'; @@ -14,3 +19,17 @@ export const fetchMonitorListAction = createAsyncAction< MonitorListPageState, MonitorManagementListResult >('fetchMonitorListAction'); + +export interface UpsertMonitorRequest { + id: string; + monitor: EncryptedSyntheticsMonitor; +} +export const fetchUpsertMonitorAction = createAction('fetchUpsertMonitor'); +export const fetchUpsertSuccessAction = createAction<{ + id: string; + attributes: { enabled: boolean }; +}>('fetchUpsertMonitorSuccess'); +export const fetchUpsertFailureAction = createAction<{ id: string; error: IHttpFetchError }>( + 'fetchUpsertMonitorFailure' +); +export const clearMonitorUpsertStatus = createAction('clearMonitorUpsertStatus'); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/effects.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/effects.ts index e155250eec19b..dda469403063f 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/effects.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/effects.ts @@ -5,10 +5,18 @@ * 2.0. */ -import { takeLeading } from 'redux-saga/effects'; +import { IHttpFetchError } from '@kbn/core-http-browser'; +import { PayloadAction } from '@reduxjs/toolkit'; +import { call, put, takeLeading } from 'redux-saga/effects'; import { fetchEffectFactory } from '../utils/fetch_effect'; -import { fetchMonitorListAction } from './actions'; -import { fetchMonitorManagementList } from './api'; +import { + fetchMonitorListAction, + fetchUpsertFailureAction, + fetchUpsertMonitorAction, + fetchUpsertSuccessAction, + UpsertMonitorRequest, +} from './actions'; +import { fetchMonitorManagementList, fetchUpsertMonitor } from './api'; export function* fetchMonitorListEffect() { yield takeLeading( @@ -20,3 +28,21 @@ export function* fetchMonitorListEffect() { ) ); } + +export function* upsertMonitorEffect() { + yield takeLeading( + fetchUpsertMonitorAction, + function* (action: PayloadAction): Generator { + try { + const response = yield call(fetchUpsertMonitor, action.payload); + yield put( + fetchUpsertSuccessAction(response as { id: string; attributes: { enabled: boolean } }) + ); + } catch (error) { + yield put( + fetchUpsertFailureAction({ id: action.payload.id, error: error as IHttpFetchError }) + ); + } + } + ); +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/index.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/index.ts index b3d7a364cfd0b..e1f564c0d0a3f 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/index.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/index.ts @@ -6,16 +6,24 @@ */ import { createReducer } from '@reduxjs/toolkit'; +import { FETCH_STATUS } from '@kbn/observability-plugin/public'; import { ConfigKey, MonitorManagementListResult } from '../../../../../common/runtime_types'; import { IHttpSerializedFetchError, serializeHttpFetchError } from '../utils/http_error'; import { MonitorListPageState } from './models'; -import { fetchMonitorListAction } from './actions'; +import { + clearMonitorUpsertStatus, + fetchMonitorListAction, + fetchUpsertFailureAction, + fetchUpsertMonitorAction, + fetchUpsertSuccessAction, +} from './actions'; export interface MonitorListState { data: MonitorManagementListResult; + monitorUpsertStatuses: Record; pageState: MonitorListPageState; loading: boolean; loaded: boolean; @@ -24,6 +32,7 @@ export interface MonitorListState { const initialState: MonitorListState = { data: { page: 1, perPage: 10, total: null, monitors: [], syncErrors: [], absoluteTotal: 0 }, + monitorUpsertStatuses: {}, pageState: { pageIndex: 0, pageSize: 10, @@ -50,6 +59,25 @@ export const monitorListReducer = createReducer(initialState, (builder) => { .addCase(fetchMonitorListAction.fail, (state, action) => { state.loading = false; state.error = serializeHttpFetchError(action.payload); + }) + .addCase(fetchUpsertMonitorAction, (state, action) => { + state.monitorUpsertStatuses[action.payload.id] = { + status: FETCH_STATUS.LOADING, + }; + }) + .addCase(fetchUpsertSuccessAction, (state, action) => { + state.monitorUpsertStatuses[action.payload.id] = { + status: FETCH_STATUS.SUCCESS, + enabled: action.payload.attributes.enabled, + }; + }) + .addCase(fetchUpsertFailureAction, (state, action) => { + state.monitorUpsertStatuses[action.payload.id] = { status: FETCH_STATUS.FAILURE }; + }) + .addCase(clearMonitorUpsertStatus, (state, action) => { + if (state.monitorUpsertStatuses[action.payload]) { + delete state.monitorUpsertStatuses[action.payload]; + } }); }); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/selectors.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/selectors.ts index 6d92e75977cf6..d53e6ea9f2b7f 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/selectors.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/selectors.ts @@ -20,3 +20,5 @@ export const selectEncryptedSyntheticsSavedMonitors = createSelector( updated_at: monitor.updated_at, })) as EncryptedSyntheticsSavedMonitor[] ); +export const selectMonitorUpsertStatuses = (state: SyntheticsAppState) => + state.monitorList.monitorUpsertStatuses; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/root_effect.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/root_effect.ts index 420af6b446dbe..389b21ea5ea1b 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/root_effect.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/root_effect.ts @@ -9,7 +9,7 @@ import { all, fork } from 'redux-saga/effects'; import { fetchMonitorStatusEffect, fetchSyntheticsMonitorEffect } from './monitor_summary'; import { fetchIndexStatusEffect } from './index_status'; import { fetchSyntheticsEnablementEffect } from './synthetics_enablement'; -import { fetchMonitorListEffect } from './monitor_list'; +import { fetchMonitorListEffect, upsertMonitorEffect } from './monitor_list'; import { fetchMonitorOverviewEffect, quietFetchOverviewEffect } from './overview'; import { fetchServiceLocationsEffect } from './service_locations'; @@ -17,6 +17,7 @@ export const rootEffect = function* root(): Generator { yield all([ fork(fetchIndexStatusEffect), fork(fetchSyntheticsEnablementEffect), + fork(upsertMonitorEffect), fork(fetchServiceLocationsEffect), fork(fetchMonitorListEffect), fork(fetchMonitorStatusEffect), diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/syncthetics_store.mock.ts b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts similarity index 98% rename from x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/syncthetics_store.mock.ts rename to x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts index 9a478cbf33a58..a91c95f89abc8 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/syncthetics_store.mock.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts @@ -66,6 +66,7 @@ export const mockState: SyntheticsAppState = { sortOrder: 'asc', sortField: `${ConfigKey.NAME}.keyword`, }, + monitorUpsertStatuses: {}, data: { total: 0, monitors: [], diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx index 71d86cc53a76b..6c5abc5a9d0f9 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx @@ -27,7 +27,7 @@ import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; import { KibanaContextProvider, KibanaServices } from '@kbn/kibana-react-plugin/public'; import { triggersActionsUiMock } from '@kbn/triggers-actions-ui-plugin/public/mocks'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; -import { mockState } from './__mocks__/syncthetics_store.mock'; +import { mockState } from './__mocks__/synthetics_store.mock'; import { MountWithReduxProvider } from './helper_with_redux'; import { AppState } from '../../state'; import { stringifyUrlParams } from '../url_params'; diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx index 4adc6077abb9e..6a0614bf4256c 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx @@ -67,6 +67,7 @@ export const SearchSelection: FC = ({ onSearchSelected }) defaultMessage: 'Data view', } ), + defaultSearchField: 'name', }, ]} fixedPageSize={fixedPageSize} diff --git a/x-pack/plugins/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.tsx b/x-pack/plugins/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.tsx index 3a24a48181192..35953b10d9e60 100644 --- a/x-pack/plugins/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.tsx +++ b/x-pack/plugins/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.tsx @@ -15,6 +15,7 @@ import { TypedLensByValueInput, } from '@kbn/lens-plugin/public'; import { EuiText } from '@elastic/eui'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { TRANSACTION_PAGE_LOAD } from '../../../../../common/transaction_types'; import { PROCESSOR_EVENT, @@ -23,7 +24,6 @@ import { import { getEsFilter } from '../../../../services/data/get_es_filter'; import { useKibanaServices } from '../../../../hooks/use_kibana_services'; import type { UxUIFilters } from '../../../../../typings/ui_filters'; -import { ProcessorEvent } from '../../../../../common/processor_event'; const BUCKET_SIZE = 9; diff --git a/x-pack/plugins/ux/public/services/data/core_web_vitals_query.ts b/x-pack/plugins/ux/public/services/data/core_web_vitals_query.ts index 0f832eff6a2bd..718b9ea47174e 100644 --- a/x-pack/plugins/ux/public/services/data/core_web_vitals_query.ts +++ b/x-pack/plugins/ux/public/services/data/core_web_vitals_query.ts @@ -80,7 +80,7 @@ export function coreWebVitalsQuery( uiFilters?: UxUIFilters, percentile = PERCENTILE_DEFAULT ) { - const setup: SetupUX = { uiFilters: uiFilters ? uiFilters : {} }; + const setup: SetupUX = { uiFilters: uiFilters ?? {} }; const projection = getRumPageLoadTransactionsProjection({ setup, diff --git a/x-pack/plugins/ux/public/services/data/projections.ts b/x-pack/plugins/ux/public/services/data/projections.ts index 582639321b868..bcb201434b41f 100644 --- a/x-pack/plugins/ux/public/services/data/projections.ts +++ b/x-pack/plugins/ux/public/services/data/projections.ts @@ -5,13 +5,13 @@ * 2.0. */ import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { AGENT_NAME, PROCESSOR_EVENT, SERVICE_LANGUAGE_NAME, TRANSACTION_TYPE, } from '../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../common/processor_event'; import { TRANSACTION_PAGE_LOAD } from '../../../common/transaction_types'; import { SetupUX } from '../../../typings/ui_filters'; import { getEsFilter } from './get_es_filter'; diff --git a/x-pack/test/apm_api_integration/tests/event_metadata/event_metadata.spec.ts b/x-pack/test/apm_api_integration/tests/event_metadata/event_metadata.spec.ts index 4e82dc3509823..85e9bc73aa0db 100644 --- a/x-pack/test/apm_api_integration/tests/event_metadata/event_metadata.spec.ts +++ b/x-pack/test/apm_api_integration/tests/event_metadata/event_metadata.spec.ts @@ -5,8 +5,8 @@ * 2.0. */ import expect from '@kbn/expect'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { PROCESSOR_EVENT } from '@kbn/apm-plugin/common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '@kbn/apm-plugin/common/processor_event'; import { FtrProviderContext } from '../../common/ftr_provider_context'; export default function ApiTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/apm_api_integration/tests/span_links/span_links.spec.ts b/x-pack/test/apm_api_integration/tests/span_links/span_links.spec.ts index e42c9e0fb00cd..91bf356bbdedd 100644 --- a/x-pack/test/apm_api_integration/tests/span_links/span_links.spec.ts +++ b/x-pack/test/apm_api_integration/tests/span_links/span_links.spec.ts @@ -5,8 +5,8 @@ * 2.0. */ import { EntityArrayIterable } from '@elastic/apm-synthtrace'; -import { ProcessorEvent } from '@kbn/apm-plugin/common/processor_event'; import expect from '@kbn/expect'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { generateSpanLinksData } from './data_generator'; diff --git a/x-pack/test/fleet_api_integration/config.ts b/x-pack/test/fleet_api_integration/config.ts index d968dcc6c6d1d..127c100d3e7ad 100644 --- a/x-pack/test/fleet_api_integration/config.ts +++ b/x-pack/test/fleet_api_integration/config.ts @@ -18,7 +18,7 @@ import { // example: https://beats-ci.elastic.co/blue/organizations/jenkins/Ingest-manager%2Fpackage-storage/detail/snapshot/74/pipeline/257#step-302-log-1. // It should be updated any time there is a new Docker image published for the Snapshot Distribution of the Package Registry. export const dockerImage = - 'docker.elastic.co/package-registry/distribution:93ffe45d8c4ae11365bc70b1038643121049b9fe'; + 'docker.elastic.co/package-registry/distribution:433d99a96f3289c5013ae35826877adf408eb9c9'; export const BUNDLED_PACKAGE_DIR = '/tmp/fleet_bundled_packages'; diff --git a/x-pack/test/functional/config.base.js b/x-pack/test/functional/config.base.js index b7e58ba13b151..7f7239aea0a01 100644 --- a/x-pack/test/functional/config.base.js +++ b/x-pack/test/functional/config.base.js @@ -15,7 +15,7 @@ import { pageObjects } from './page_objects'; // example: https://beats-ci.elastic.co/blue/organizations/jenkins/Ingest-manager%2Fpackage-storage/detail/snapshot/74/pipeline/257#step-302-log-1. // It should be updated any time there is a new Docker image published for the Snapshot Distribution of the Package Registry. export const dockerImage = - 'docker.elastic.co/package-registry/distribution:93ffe45d8c4ae11365bc70b1038643121049b9fe'; + 'docker.elastic.co/package-registry/distribution:433d99a96f3289c5013ae35826877adf408eb9c9'; // the default export of config files must be a config provider // that returns an object with the projects config values diff --git a/x-pack/test/functional_synthetics/apps/uptime/synthetics_integration.ts b/x-pack/test/functional_synthetics/apps/uptime/synthetics_integration.ts index aa10329dd820d..8984c23efd9d8 100644 --- a/x-pack/test/functional_synthetics/apps/uptime/synthetics_integration.ts +++ b/x-pack/test/functional_synthetics/apps/uptime/synthetics_integration.ts @@ -73,6 +73,7 @@ export default function (providerContext: FtrProviderContext) { }, }, ], + origin: 'ui', ...config, }, ...(monitorType === 'browser' diff --git a/x-pack/test/functional_synthetics/config.js b/x-pack/test/functional_synthetics/config.js index 932d1c4723951..3bf85f45bd65b 100644 --- a/x-pack/test/functional_synthetics/config.js +++ b/x-pack/test/functional_synthetics/config.js @@ -17,7 +17,7 @@ import { pageObjects } from './page_objects'; // example: https://beats-ci.elastic.co/blue/organizations/jenkins/Ingest-manager%2Fpackage-storage/detail/snapshot/74/pipeline/257#step-302-log-1. // It should be updated any time there is a new Docker image published for the Snapshot Distribution of the Package Registry that updates Synthetics. export const dockerImage = - 'docker.elastic.co/package-registry/distribution:93ffe45d8c4ae11365bc70b1038643121049b9fe'; + 'docker.elastic.co/package-registry/distribution:433d99a96f3289c5013ae35826877adf408eb9c9'; // the default export of config files must be a config provider // that returns an object with the projects config values