From 6825483f1d7bb69f9036b3a16f03d30ec752e89c Mon Sep 17 00:00:00 2001 From: Craig Rodrigues Date: Thu, 12 Oct 2023 02:11:17 -0700 Subject: [PATCH] [Synthetics,Heartbeat] Change index pattern to 'heartbeat-*' (#167811) Co-authored-by: Dzmitry Lemechko Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../common/constants/settings_defaults.ts | 2 +- .../synthetics/server/constants/settings.ts | 2 +- .../lib/requests/get_network_events.test.ts | 2 +- x-pack/plugins/synthetics/server/lib.test.ts | 6 +++--- .../uptime/common/constants/settings_defaults.ts | 2 +- .../plugins/uptime/server/constants/settings.ts | 2 +- .../uptime/server/legacy_uptime/lib/lib.test.ts | 16 ++++++++-------- .../get_monitor_details.test.ts.snap | 4 ++-- .../get_monitor_duration.test.ts.snap | 2 +- .../legacy_uptime/lib/requests/get_certs.test.ts | 2 +- .../requests/get_monitor_availability.test.ts | 10 +++++----- .../lib/requests/get_monitor_status.test.ts | 10 +++++----- .../lib/requests/get_network_events.test.ts | 2 +- .../legacy_uptime/lib/requests/get_pings.test.ts | 10 +++++----- .../observability/synthetics_rule.ts | 4 ++-- .../apis/uptime/rest/index_status.ts | 2 +- 16 files changed, 39 insertions(+), 39 deletions(-) diff --git a/x-pack/plugins/synthetics/common/constants/settings_defaults.ts b/x-pack/plugins/synthetics/common/constants/settings_defaults.ts index ec5fd9bc0a1d..d5385ada2233 100644 --- a/x-pack/plugins/synthetics/common/constants/settings_defaults.ts +++ b/x-pack/plugins/synthetics/common/constants/settings_defaults.ts @@ -8,7 +8,7 @@ import { DynamicSettings } from '../runtime_types'; export const DYNAMIC_SETTINGS_DEFAULTS: DynamicSettings = { - heartbeatIndices: 'heartbeat-8*,heartbeat-7*', + heartbeatIndices: 'heartbeat-*', certAgeThreshold: 730, certExpirationThreshold: 30, defaultConnectors: [], diff --git a/x-pack/plugins/synthetics/server/constants/settings.ts b/x-pack/plugins/synthetics/server/constants/settings.ts index 3428cc4433a3..777d75b01a3e 100644 --- a/x-pack/plugins/synthetics/server/constants/settings.ts +++ b/x-pack/plugins/synthetics/server/constants/settings.ts @@ -8,7 +8,7 @@ import { DynamicSettingsAttributes } from '../runtime_types/settings'; export const DYNAMIC_SETTINGS_DEFAULTS: DynamicSettingsAttributes = { - heartbeatIndices: 'heartbeat-8*,heartbeat-7*', + heartbeatIndices: 'heartbeat-*', certAgeThreshold: 730, certExpirationThreshold: 30, defaultConnectors: [], diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_network_events.test.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_network_events.test.ts index d2c97acb4eba..e8202e748bd0 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_network_events.test.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_network_events.test.ts @@ -213,7 +213,7 @@ describe('getNetworkEvents', () => { "size": 1000, "track_total_hits": true, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", }, Object { "meta": true, diff --git a/x-pack/plugins/synthetics/server/lib.test.ts b/x-pack/plugins/synthetics/server/lib.test.ts index 0ce1f7960784..4bc18d3dc5b1 100644 --- a/x-pack/plugins/synthetics/server/lib.test.ts +++ b/x-pack/plugins/synthetics/server/lib.test.ts @@ -42,7 +42,7 @@ describe('UptimeEsClient', () => { expect(esClient.search).toHaveBeenCalledWith( { - index: 'heartbeat-8*,heartbeat-7*', + index: 'heartbeat-*', ...mockSearchParams, }, { meta: true } @@ -72,7 +72,7 @@ describe('UptimeEsClient', () => { await expect(uptimeEsClient.search(mockSearchParams)).rejects.toThrow(mockError); expect(esClient.search).toHaveBeenCalledWith( { - index: 'heartbeat-8*,heartbeat-7*', + index: 'heartbeat-*', ...mockSearchParams, }, { meta: true } @@ -90,7 +90,7 @@ describe('UptimeEsClient', () => { expect(esClient.count).toHaveBeenCalledWith(mockCountParams, { meta: true }); expect(result).toEqual({ - indices: 'heartbeat-8*,heartbeat-7*', + indices: 'heartbeat-*', result: { body: {}, headers: { diff --git a/x-pack/plugins/uptime/common/constants/settings_defaults.ts b/x-pack/plugins/uptime/common/constants/settings_defaults.ts index ec5fd9bc0a1d..d5385ada2233 100644 --- a/x-pack/plugins/uptime/common/constants/settings_defaults.ts +++ b/x-pack/plugins/uptime/common/constants/settings_defaults.ts @@ -8,7 +8,7 @@ import { DynamicSettings } from '../runtime_types'; export const DYNAMIC_SETTINGS_DEFAULTS: DynamicSettings = { - heartbeatIndices: 'heartbeat-8*,heartbeat-7*', + heartbeatIndices: 'heartbeat-*', certAgeThreshold: 730, certExpirationThreshold: 30, defaultConnectors: [], diff --git a/x-pack/plugins/uptime/server/constants/settings.ts b/x-pack/plugins/uptime/server/constants/settings.ts index 3428cc4433a3..777d75b01a3e 100644 --- a/x-pack/plugins/uptime/server/constants/settings.ts +++ b/x-pack/plugins/uptime/server/constants/settings.ts @@ -8,7 +8,7 @@ import { DynamicSettingsAttributes } from '../runtime_types/settings'; export const DYNAMIC_SETTINGS_DEFAULTS: DynamicSettingsAttributes = { - heartbeatIndices: 'heartbeat-8*,heartbeat-7*', + heartbeatIndices: 'heartbeat-*', certAgeThreshold: 730, certExpirationThreshold: 30, defaultConnectors: [], diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/lib.test.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/lib.test.ts index e55898cf7a63..1dadb58e7c59 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/lib.test.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/lib.test.ts @@ -44,7 +44,7 @@ describe('UptimeEsClient', () => { expect(esClient.search).toHaveBeenCalledWith( { - index: 'heartbeat-8*,heartbeat-7*', + index: 'heartbeat-*', ...mockSearchParams, }, { meta: true } @@ -74,7 +74,7 @@ describe('UptimeEsClient', () => { await expect(uptimeEsClient.search(mockSearchParams)).rejects.toThrow(mockError); expect(esClient.search).toHaveBeenCalledWith( { - index: 'heartbeat-8*,heartbeat-7*', + index: 'heartbeat-*', ...mockSearchParams, }, { meta: true } @@ -92,7 +92,7 @@ describe('UptimeEsClient', () => { expect(esClient.count).toHaveBeenCalledWith(mockCountParams, { meta: true }); expect(result).toEqual({ - indices: 'heartbeat-8*,heartbeat-7*', + indices: 'heartbeat-*', result: { body: {}, headers: { @@ -143,7 +143,7 @@ describe('UptimeEsClient', () => { it('appends synthetics-* in index for legacy alerts', async () => { savedObjectsClient.get = jest.fn().mockResolvedValue({ attributes: { - heartbeatIndices: 'heartbeat-8*,heartbeat-7*', + heartbeatIndices: 'heartbeat-*', syntheticsIndexRemoved: true, }, }); @@ -167,7 +167,7 @@ describe('UptimeEsClient', () => { expect(esClient.search).toHaveBeenCalledWith( { - index: 'heartbeat-8*,heartbeat-7*,synthetics-*', + index: 'heartbeat-*,synthetics-*', ...mockSearchParams, }, { meta: true } @@ -200,7 +200,7 @@ describe('UptimeEsClient', () => { expect(esClient.search).toHaveBeenCalledWith( { - index: 'heartbeat-8*,heartbeat-7*,synthetics-*', + index: 'heartbeat-*,synthetics-*', ...mockSearchParams, }, { meta: true } @@ -227,7 +227,7 @@ describe('UptimeEsClient', () => { expect(esClient.search).toHaveBeenCalledWith( { - index: 'heartbeat-8*,heartbeat-7*', + index: 'heartbeat-*', body: { query: { match_all: {}, @@ -251,7 +251,7 @@ describe('UptimeEsClient', () => { expect(esClient.search).toHaveBeenLastCalledWith( { - index: 'heartbeat-8*,heartbeat-7*', + index: 'heartbeat-*', body: { query: { match_all: {}, diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_details.test.ts.snap b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_details.test.ts.snap index b3a6d7937c6d..ede405a125cc 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_details.test.ts.snap +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_details.test.ts.snap @@ -55,7 +55,7 @@ Array [ }, "size": 0, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", }, Object { "meta": true, @@ -106,7 +106,7 @@ Array [ }, ], }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", }, Object { "meta": true, diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap index eb8499391abc..712f1f9205ca 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap @@ -69,7 +69,7 @@ Array [ }, "size": 0, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", }, Object { "meta": true, diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts index fe6ed1fc5f4f..07c2a0125686 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts @@ -253,7 +253,7 @@ describe('getCerts', () => { }, ], }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", }, Object { "meta": true, diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts index d4b2680e1603..af3b09cedda2 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts @@ -255,7 +255,7 @@ describe('monitor availability', () => { }, "size": 0, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", } `); }); @@ -415,7 +415,7 @@ describe('monitor availability', () => { }, "size": 0, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", } `); @@ -750,7 +750,7 @@ describe('monitor availability', () => { }, "size": 0, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", } `); @@ -862,7 +862,7 @@ describe('monitor availability', () => { }, "size": 0, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", }, Object { "meta": true, @@ -1009,7 +1009,7 @@ describe('monitor availability', () => { }, "size": 0, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", } `); }); diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.test.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.test.ts index 2ceda7dc03ac..dc7760d8f31f 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.test.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.test.ts @@ -218,7 +218,7 @@ describe('getMonitorStatus', () => { }, "size": 0, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", } `); }); @@ -353,7 +353,7 @@ describe('getMonitorStatus', () => { }, "size": 0, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", } `); }); @@ -573,7 +573,7 @@ describe('getMonitorStatus', () => { }, "size": 0, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", } `); }); @@ -713,7 +713,7 @@ describe('getMonitorStatus', () => { }, "size": 0, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", } `); }); @@ -859,7 +859,7 @@ describe('getMonitorStatus', () => { }, "size": 0, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", } `); expect(result.length).toBe(3); diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_network_events.test.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_network_events.test.ts index ec0642409dc0..29d9386c37cf 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_network_events.test.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_network_events.test.ts @@ -213,7 +213,7 @@ describe('getNetworkEvents', () => { "size": 1000, "track_total_hits": true, }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", }, Object { "meta": true, diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts index eac84470ca19..a58c7f5516ff 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts @@ -163,7 +163,7 @@ describe('getAll', () => { }, ], }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", }, Object { "meta": true, @@ -225,7 +225,7 @@ describe('getAll', () => { }, ], }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", }, Object { "meta": true, @@ -287,7 +287,7 @@ describe('getAll', () => { }, ], }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", }, Object { "meta": true, @@ -354,7 +354,7 @@ describe('getAll', () => { }, ], }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", }, Object { "meta": true, @@ -462,7 +462,7 @@ describe('getAll', () => { }, ], }, - "index": "heartbeat-8*,heartbeat-7*", + "index": "heartbeat-*", }, Object { "meta": true, diff --git a/x-pack/test/alerting_api_integration/observability/synthetics_rule.ts b/x-pack/test/alerting_api_integration/observability/synthetics_rule.ts index 888d2a0d7f89..21a3749fc336 100644 --- a/x-pack/test/alerting_api_integration/observability/synthetics_rule.ts +++ b/x-pack/test/alerting_api_integration/observability/synthetics_rule.ts @@ -39,7 +39,7 @@ export default function ({ getService }: FtrProviderContext) { .post(SYNTHETICS_API_URLS.DYNAMIC_SETTINGS) .set('kbn-xsrf', 'true') .send({ - heartbeatIndices: 'heartbeat-8*,heartbeat-7*', + heartbeatIndices: 'heartbeat-*', certExpirationThreshold: 30, certAgeThreshold: 730, defaultConnectors: testActions.slice(0, 2), @@ -79,7 +79,7 @@ export default function ({ getService }: FtrProviderContext) { .post(SYNTHETICS_API_URLS.DYNAMIC_SETTINGS) .set('kbn-xsrf', 'true') .send({ - heartbeatIndices: 'heartbeat-8*,heartbeat-7*', + heartbeatIndices: 'heartbeat-*', certExpirationThreshold: 30, certAgeThreshold: 730, defaultConnectors: testActions, diff --git a/x-pack/test/api_integration/apis/uptime/rest/index_status.ts b/x-pack/test/api_integration/apis/uptime/rest/index_status.ts index 50ff47f04be5..1602e00d13a2 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/index_status.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/index_status.ts @@ -18,7 +18,7 @@ export default function ({ getService }: FtrProviderContext) { const data = apiResponse.body; expect(data).to.eql({ indexExists: true, - indices: 'heartbeat-8*,heartbeat-7*', + indices: 'heartbeat-*', }); }); });