From 1e4487c02b3ce139977c3de58d96884f96056321 Mon Sep 17 00:00:00 2001 From: Carlos Crespo Date: Fri, 6 Sep 2024 16:38:50 +0200 Subject: [PATCH 1/3] Create search:search_excluded_data_tiers setting --- packages/kbn-data-service/src/constants.ts | 1 + src/plugins/data/server/ui_settings.ts | 16 ++++++++++++++++ .../server/collectors/management/schema.ts | 7 +++++++ .../server/collectors/management/types.ts | 1 + 4 files changed, 25 insertions(+) diff --git a/packages/kbn-data-service/src/constants.ts b/packages/kbn-data-service/src/constants.ts index 97ea14f43bb87..c4b96e64eb3f1 100644 --- a/packages/kbn-data-service/src/constants.ts +++ b/packages/kbn-data-service/src/constants.ts @@ -19,6 +19,7 @@ export const UI_SETTINGS = { COURIER_MAX_CONCURRENT_SHARD_REQUESTS: 'courier:maxConcurrentShardRequests', SEARCH_INCLUDE_FROZEN: 'search:includeFrozen', SEARCH_TIMEOUT: 'search:timeout', + SEARCH_EXCLUDED_DATA_TIERS: 'search:search_excluded_data_tiers', HISTOGRAM_BAR_TARGET: 'histogram:barTarget', HISTOGRAM_MAX_BARS: 'histogram:maxBars', HISTORY_LIMIT: 'history:limit', diff --git a/src/plugins/data/server/ui_settings.ts b/src/plugins/data/server/ui_settings.ts index 4e798c6afdce2..16982f6c3bbf5 100644 --- a/src/plugins/data/server/ui_settings.ts +++ b/src/plugins/data/server/ui_settings.ts @@ -578,5 +578,21 @@ export function getUiSettings( schema: schema.number(), requiresPageReload: true, }, + [UI_SETTINGS.SEARCH_EXCLUDED_DATA_TIERS]: { + name: i18n.translate('data.advancedSettings.searchExcludedDataTiers', { + defaultMessage: 'Excluded Data Tiers From Search', + }), + value: [], + description: i18n.translate('data.advancedSettings.searchExcludedDataTiersDesc', { + defaultMessage: `Specify the data tiers to exclude from search, such as data_cold and/or data_frozen. + When configured, indices allocated in the selected tiers will be ignored from search requests.`, + }), + type: 'array', + category: ['search'], + schema: schema.arrayOf( + schema.oneOf([schema.literal('data_cold'), schema.literal('data_frozen')]) + ), + requiresPageReload: false, + }, }; } diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts index 8bc81a6f1d497..dbaf8e398466c 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts @@ -133,6 +133,13 @@ export const stackManagementSchema: MakeSchemaFrom = { type: 'boolean', _meta: { description: 'Non-default value of setting.' }, }, + 'search:search_excluded_data_tiers': { + type: 'array', + items: { + type: 'keyword', + _meta: { description: 'Non-default value of setting.' }, + }, + }, 'courier:maxConcurrentShardRequests': { type: 'long', _meta: { description: 'Non-default value of setting.' }, diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts index 9821fd1bad43f..ee6ce0c34e1c8 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts @@ -77,6 +77,7 @@ export interface UsageStats { 'securitySolution:excludeColdAndFrozenTiersInAnalyzer': boolean; 'securitySolution:enableCcsWarning': boolean; 'search:includeFrozen': boolean; + 'search:search_excluded_data_tiers': string[]; 'courier:maxConcurrentShardRequests': number; 'courier:setRequestPreference': string; 'courier:customRequestPreference': string; From 2b71bac68678ecd7874117181000c5d5396f5362 Mon Sep 17 00:00:00 2001 From: Carlos Crespo Date: Mon, 9 Sep 2024 12:32:25 +0200 Subject: [PATCH 2/3] update telemetry schema --- src/plugins/telemetry/schema/oss_plugins.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index 70fbeec73bc5d..8f930a16eb6d2 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -9794,6 +9794,15 @@ "description": "Non-default value of setting." } }, + "search:search_excluded_data_tiers": { + "type": "array", + "items": { + "type": "keyword", + "_meta": { + "description": "Non-default value of setting." + } + } + }, "courier:maxConcurrentShardRequests": { "type": "long", "_meta": { From 40c65ca0afad2cab427373f8d9f0f48047a6a79e Mon Sep 17 00:00:00 2001 From: Carlos Crespo Date: Tue, 10 Sep 2024 10:05:26 +0200 Subject: [PATCH 3/3] Adjust title Co-authored-by: Nathan L Smith --- src/plugins/data/server/ui_settings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/data/server/ui_settings.ts b/src/plugins/data/server/ui_settings.ts index 4fb840d456408..ab435ef69b159 100644 --- a/src/plugins/data/server/ui_settings.ts +++ b/src/plugins/data/server/ui_settings.ts @@ -581,7 +581,7 @@ export function getUiSettings( }, [UI_SETTINGS.SEARCH_EXCLUDED_DATA_TIERS]: { name: i18n.translate('data.advancedSettings.searchExcludedDataTiers', { - defaultMessage: 'Excluded Data Tiers From Search', + defaultMessage: 'Excluded data tiers from search', }), value: [], description: i18n.translate('data.advancedSettings.searchExcludedDataTiersDesc', {