From e7fd1033544639cf70c9b05697e65df344019e82 Mon Sep 17 00:00:00 2001 From: Maryam Saeidi Date: Wed, 26 Apr 2023 16:19:41 +0200 Subject: [PATCH] [8.7] [AO] Fix time range filter in alerts table (#153648) (#155739) # Backport This will backport the following commits from `main` to `8.7`: - [[AO] Fix time range filter in alerts table (#153648)](https://github.com/elastic/kibana/pull/153648) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) --- .../alert_search_bar.test.tsx | 4 ++-- .../__snapshots__/build_es_query.test.ts.snap | 10 +++++----- .../utils/build_es_query/build_es_query.ts | 4 ++-- .../observability/alerts/data.json.gz | Bin 4051 -> 4239 bytes .../observability/alerts/mappings.json | 14 +++++++++++++- .../services/observability/overview/common.ts | 15 +++++++++++++++ .../observability/pages/alerts/add_to_case.ts | 2 +- .../pages/alerts/alert_status.ts | 2 +- .../apps/observability/pages/alerts/index.ts | 10 ++++++---- .../pages/overview/alert_table.ts | 4 ++-- 10 files changed, 47 insertions(+), 18 deletions(-) diff --git a/x-pack/plugins/observability/public/components/shared/alert_search_bar/alert_search_bar.test.tsx b/x-pack/plugins/observability/public/components/shared/alert_search_bar/alert_search_bar.test.tsx index 3e6d32d6a569c..9fca2067f3092 100644 --- a/x-pack/plugins/observability/public/components/shared/alert_search_bar/alert_search_bar.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/alert_search_bar/alert_search_bar.test.tsx @@ -91,7 +91,7 @@ describe('ObservabilityAlertSearchBar', () => { }, { range: { - '@timestamp': expect.objectContaining({ + 'kibana.alert.time_range': expect.objectContaining({ format: 'strict_date_optional_time', gte: mockedFrom, lte: mockedTo, @@ -138,7 +138,7 @@ describe('ObservabilityAlertSearchBar', () => { }, { range: { - '@timestamp': expect.objectContaining({ + 'kibana.alert.time_range': expect.objectContaining({ format: 'strict_date_optional_time', gte: mockedFrom, lte: mockedTo, diff --git a/x-pack/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap b/x-pack/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap index 118435d5c6968..fe58f98867fbb 100644 --- a/x-pack/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap +++ b/x-pack/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap @@ -6,7 +6,7 @@ Object { "filter": Array [ Object { "range": Object { - "@timestamp": Object { + "kibana.alert.time_range": Object { "format": "strict_date_optional_time", "gte": "2022-08-30T15:23:23.721Z", "lte": "2022-08-30T15:38:28.171Z", @@ -39,7 +39,7 @@ Object { }, Object { "range": Object { - "@timestamp": Object { + "kibana.alert.time_range": Object { "format": "strict_date_optional_time", "gte": "2022-08-30T15:23:23.721Z", "lte": "2022-08-30T15:38:28.171Z", @@ -92,7 +92,7 @@ Object { }, Object { "range": Object { - "@timestamp": Object { + "kibana.alert.time_range": Object { "format": "strict_date_optional_time", "gte": "2022-08-30T15:23:23.721Z", "lte": "2022-08-30T15:38:28.171Z", @@ -131,7 +131,7 @@ Object { }, Object { "range": Object { - "@timestamp": Object { + "kibana.alert.time_range": Object { "format": "strict_date_optional_time", "gte": "2022-08-30T15:23:23.721Z", "lte": "2022-08-30T15:38:28.171Z", @@ -152,7 +152,7 @@ Object { "filter": Array [ Object { "range": Object { - "@timestamp": Object { + "kibana.alert.time_range": Object { "format": "strict_date_optional_time", "gte": "2022-08-30T15:23:23.721Z", "lte": "2022-08-30T15:38:28.171Z", diff --git a/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.ts b/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.ts index f3f195e0df9bf..102d5ce555667 100644 --- a/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.ts +++ b/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.ts @@ -6,14 +6,14 @@ */ import { buildEsQuery as kbnBuildEsQuery, TimeRange, Query } from '@kbn/es-query'; -import { TIMESTAMP } from '@kbn/rule-data-utils'; +import { ALERT_TIME_RANGE } from '@kbn/rule-data-utils'; import { getTime } from '@kbn/data-plugin/common'; export function buildEsQuery(timeRange: TimeRange, kuery?: string, queries: Query[] = []) { const timeFilter = timeRange && getTime(undefined, timeRange, { - fieldName: TIMESTAMP, + fieldName: ALERT_TIME_RANGE, }); const filtersToUse = timeFilter ? [timeFilter] : []; const kueryFilter = kuery ? [{ query: kuery, language: 'kuery' }] : []; diff --git a/x-pack/test/functional/es_archives/observability/alerts/data.json.gz b/x-pack/test/functional/es_archives/observability/alerts/data.json.gz index 86bd5735e6206b8762d8a2188269b18cc33af6c4..9576db4351bb28e62019c3265dee47f2b410afa0 100644 GIT binary patch literal 4239 zcmV;A5OD7wiwFP!000026YZT_kK?$N$KU5u7zG5F2||VUiysyVf?XiM4iM~4UXl(P zyjDByvT9|!I-Nm(_dSx!?W(d|C3V{>*~RIZLEENCN+SP19`f+;*B>U6tJUY*cr~3| zh0o>8g>|(ijQtx9`mDPK=-}pYx?Q%8q z$d@QpCA`l?c>iIwx^1^r^T{T=??94OY=EH*ey<>}(#x!Y)Wo)xsS zYPH`LFrIQ!2qFG<__|fo)Asu8qhz%nz-=t9AIbzIx?aU+3%yVIr9Ic}efLnkr&)X| ztB+}3etN&Vk@7Y!_EIlz;qk#ss#E-ZSO0rK+}86SPcOTR)$(4`bb$-J%NH7nkIQ9Q z6^*#nDIUD|UAkI{XP^LaaW{j0b90~erS81FY}=rp?S3nJ-Q3r%`VXp7Y{~ObPBu6E z<%jyeFF*Y7Yj;9%uN5>>f>L4xaf=1g7IUN-i!@lnwa}SRuTLmm7)%+1GK4XTGx@!Q zDsNqcAJFaR)d%>+N4Wm;`;AsUZt|x>k+?_EnE9u@ zv+uXY&w!L6_z7j|ie$!Q#vFw)J!I@sES)}VdED2!k>$HB8b-ZN(t*thZvk;bDbh+r zcqajd&%k}DWJb#f(1HhsO&X}bBK%LpSO1I?c9P|-wePa zoM+!MlTOT}9{P7lvv1$h&qq5e=V???;D{opwe6||vXnwAHY}3hqgKgghP^t&IE9YM zh#_1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@H0@6&ve?kQcxuP`rc<&o1 zcA4!@!45T=Rkj)D=JXwdCBiEX8dKO$z#e4be10t%~gple3?dnEFAw)K$?+7drfs0&z21{gs$Vos%G+f~EjJ%OoF&GXH|JN#LrjSfZ7|uf2!G?&pc~S6 z1oP?u5jD)K4-h#kh(K#4c^4NUI#++9|b?D$* zpra=U5wCf)f+EHRMx0xVOmaZbgt4Vq2Z?*JN@Rmy_g*1VIGXjU-+52x)o~?;dG!Gz zX9kh{msHTiJA_Dk9X&mWMD3!YnjmbIM4b7EOf(h+Ate+SGt%{874)V-%zZ)xm!6gR z+8}FBhqL%FuRcKJ%pk(Y!sM+qcARbah7Fb4>u3vz9QLrd?mT_1Nh~CTj28)UMHte= zGXN`gNhP5pE<<$q6Y$*P{u0AaE*Lt;j z_R}Vjdhq!jU~+yiVa-XTxW&=4t@lA`ucN066JouI)(WJk5{OF|k;Yad$|Mz*C&$Fc z&z5XnH?%L9P(cf4OIoaJ>L*Nu9AGlQh({5T z<#`FFCeB3eN$7#!*5*mFy)I=hg~)4@c>RQkq{A%90Fm>9$ZH!E3OtKt@lGAyPQPQ@}_h4^|k{6lsSok~T2!C=WD#{GM7M(lqa$D}+1%LzvQ76dp6O zDSf*ja?oRw82LV%J{+6Wt7DUzVNd~m;x4Cr3!3!l>6u{83nM%V8hSn45sQqZ7DcO) zR3--L`f#o%He(?xi4UxPd zq(DYbk0I0uM{NkmYvvHA5=w|igESM;2?3wY$9oCoMFC?bpx6(!SGg)(x3D37y&0UR zY#5sFh7mdtsNM3)$jC}WwALOiWa>knl7jkRGDVMW?7TrS5`mjgA{{sm@`$??o F004T?#4i8< diff --git a/x-pack/test/functional/es_archives/observability/alerts/mappings.json b/x-pack/test/functional/es_archives/observability/alerts/mappings.json index d8916d052b11e..92cf1e54e6979 100644 --- a/x-pack/test/functional/es_archives/observability/alerts/mappings.json +++ b/x-pack/test/functional/es_archives/observability/alerts/mappings.json @@ -202,6 +202,10 @@ "system_status": { "type": "keyword" }, + "time_range": { + "type": "date_range", + "format": "epoch_millis||strict_date_optional_time" + }, "uuid": { "type": "keyword" }, @@ -470,6 +474,10 @@ "system_status": { "type": "keyword" }, + "time_range": { + "type": "date_range", + "format": "epoch_millis||strict_date_optional_time" + }, "uuid": { "type": "keyword" }, @@ -714,6 +722,10 @@ "system_status": { "type": "keyword" }, + "time_range": { + "type": "date_range", + "format": "epoch_millis||strict_date_optional_time" + }, "uuid": { "type": "keyword" }, @@ -752,4 +764,4 @@ } } } -} \ No newline at end of file +} diff --git a/x-pack/test/functional/services/observability/overview/common.ts b/x-pack/test/functional/services/observability/overview/common.ts index 4450344914bb9..9a15e2bc7eb0b 100644 --- a/x-pack/test/functional/services/observability/overview/common.ts +++ b/x-pack/test/functional/services/observability/overview/common.ts @@ -13,6 +13,11 @@ const DATE_WITH_DATA = { rangeTo: '2021-10-20T13:36:22.109Z', }; +const DATE_WITHOUT_DATA = { + rangeFrom: '2021-09-18T13:36:22.109Z', + rangeTo: '2021-09-20T13:36:22.109Z', +}; + const ALERTS_TITLE = 'Alerts'; const ALERTS_ACCORDION_SELECTOR = `accordion-${ALERTS_TITLE}`; const ALERTS_SECTION_BUTTON_CSS_SELECTOR = `[data-test-subj=${ALERTS_ACCORDION_SELECTOR}] button.euiAccordion__button`; @@ -38,6 +43,15 @@ export function ObservabilityOverviewCommonProvider({ ); }; + const navigateToOverviewPageWithoutAlerts = async () => { + return await pageObjects.common.navigateToUrlWithBrowserHistory( + 'observability', + '/overview', + `?rangeFrom=${DATE_WITHOUT_DATA.rangeFrom}&rangeTo=${DATE_WITHOUT_DATA.rangeTo}`, + { ensureCurrentUrl: false } + ); + }; + const navigateToOverviewPage = async () => { await pageObjects.common.navigateToUrlWithBrowserHistory( 'observability', @@ -81,6 +95,7 @@ export function ObservabilityOverviewCommonProvider({ return { getAlertsTableNoDataOrFail, navigateToOverviewPageWithAlerts, + navigateToOverviewPageWithoutAlerts, navigateToOverviewPage, openAlertsSectionAndWaitToAppear, }; diff --git a/x-pack/test/observability_functional/apps/observability/pages/alerts/add_to_case.ts b/x-pack/test/observability_functional/apps/observability/pages/alerts/add_to_case.ts index 3c2b6b4403770..ab9dfeda9e464 100644 --- a/x-pack/test/observability_functional/apps/observability/pages/alerts/add_to_case.ts +++ b/x-pack/test/observability_functional/apps/observability/pages/alerts/add_to_case.ts @@ -12,7 +12,7 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => { const observability = getService('observability'); const retry = getService('retry'); - describe('Observability alerts / Add to case', function () { + describe('Observability alerts / Add to case >', function () { this.tags('includeFirefox'); before(async () => { diff --git a/x-pack/test/observability_functional/apps/observability/pages/alerts/alert_status.ts b/x-pack/test/observability_functional/apps/observability/pages/alerts/alert_status.ts index 5e70382418f23..adb295a46809e 100644 --- a/x-pack/test/observability_functional/apps/observability/pages/alerts/alert_status.ts +++ b/x-pack/test/observability_functional/apps/observability/pages/alerts/alert_status.ts @@ -16,7 +16,7 @@ const RECOVERED_ALERTS = 30; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); - describe('alert status filter', function () { + describe('Alert status filter >', function () { this.tags('includeFirefox'); const observability = getService('observability'); diff --git a/x-pack/test/observability_functional/apps/observability/pages/alerts/index.ts b/x-pack/test/observability_functional/apps/observability/pages/alerts/index.ts index 99c41f250ab07..7a7ba19880f7d 100644 --- a/x-pack/test/observability_functional/apps/observability/pages/alerts/index.ts +++ b/x-pack/test/observability_functional/apps/observability/pages/alerts/index.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { ALERT_STATUS_RECOVERED } from '@kbn/rule-data-utils'; import { FtrProviderContext } from '../../../../ftr_provider_context'; import { asyncForEach } from '../../helpers'; @@ -20,7 +21,7 @@ export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); const find = getService('find'); - describe('Observability alerts', function () { + describe('Observability alerts >', function () { this.tags('includeFirefox'); const testSubjects = getService('testSubjects'); @@ -49,12 +50,12 @@ export default ({ getService }: FtrProviderContext) => { describe('Alerts table', () => { before(async () => { - await esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs'); + await esArchiver.load('x-pack/test/functional/es_archives/infra/simple_logs'); await observability.alerts.common.navigateToTimeWithData(); }); after(async () => { - await esArchiver.unload('x-pack/test/functional/es_archives/infra/metrics_and_logs'); + await esArchiver.unload('x-pack/test/functional/es_archives/infra/simple_logs'); }); it('Renders the table', async () => { @@ -113,8 +114,9 @@ export default ({ getService }: FtrProviderContext) => { it('Correctly applies date picker selections', async () => { await retry.try(async () => { + await observability.alerts.common.setAlertStatusFilter(ALERT_STATUS_RECOVERED); await (await testSubjects.find('superDatePickerToggleQuickMenuButton')).click(); - // We shouldn't expect any data for the last 15 minutes + // We shouldn't expect any recovered alert for the last 15 minutes await (await testSubjects.find('superDatePickerCommonlyUsed_Last_15 minutes')).click(); await observability.alerts.common.getNoDataStateOrFail(); }); diff --git a/x-pack/test/observability_functional/apps/observability/pages/overview/alert_table.ts b/x-pack/test/observability_functional/apps/observability/pages/overview/alert_table.ts index 42d4dba9ee855..53d73356077f3 100644 --- a/x-pack/test/observability_functional/apps/observability/pages/overview/alert_table.ts +++ b/x-pack/test/observability_functional/apps/observability/pages/overview/alert_table.ts @@ -13,7 +13,7 @@ const ALL_ALERTS = 10; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); - describe('Observability overview', function () { + describe('Observability overview >', function () { this.tags('includeFirefox'); const observability = getService('observability'); @@ -29,7 +29,7 @@ export default ({ getService }: FtrProviderContext) => { describe('Without alerts', function () { it('navigate and open alerts section', async () => { - await observability.overview.common.navigateToOverviewPage(); + await observability.overview.common.navigateToOverviewPageWithoutAlerts(); await observability.overview.common.openAlertsSectionAndWaitToAppear(); });