Skip to content

Commit

Permalink
[Observability] Create observability-specific setting for excluding d…
Browse files Browse the repository at this point in the history
…ata tiers from queries (#192570)

part of [#190559](#190559)

## Summary

This PR introduces a new `Advanced Settings` under `Observabilty` to
provide a way of configuring the exclusion of indices in the `data_cold`
and/or `data_frozen` tiers from queries.

The change will help to address issues encountered in O11y, most
specifically in APM, and could also affect Infra and other features,
with unbounded queries targeting the frozen tier.

### For reviewers

This PR replaces #192276

---------

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
crespocarlos and elasticmachine authored Sep 16, 2024
1 parent 6689169 commit f029f80
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/kbn-management/settings/setting_ids/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export const OBSERVABILITY_AI_ASSISTANT_SIMULATED_FUNCTION_CALLING =
'observability:aiAssistantSimulatedFunctionCalling';
export const OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN =
'observability:aiAssistantSearchConnectorIndexPattern';
export const OBSERVABILITY_SEARCH_EXCLUDED_DATA_TIERS = 'observability:searchExcludedDataTiers';

// Reporting settings
export const XPACK_REPORTING_CUSTOM_PDF_LOGO_ID = 'xpackReporting:customPdfLogo';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ export const OBSERVABILITY_PROJECT_SETTINGS = [
settings.OBSERVABILITY_AI_ASSISTANT_LOGS_INDEX_PATTERN_ID,
settings.OBSERVABILITY_AI_ASSISTANT_SIMULATED_FUNCTION_CALLING,
settings.OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN,
settings.OBSERVABILITY_SEARCH_EXCLUDED_DATA_TIERS,
];
Original file line number Diff line number Diff line change
Expand Up @@ -694,4 +694,11 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
},
'observability:searchExcludedDataTiers': {
type: 'array',
items: {
type: 'keyword',
_meta: { description: 'Non-default value of setting.' },
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,5 @@ export interface UsageStats {
'aiAssistant:preferredAIAssistantType': string;
'observability:profilingFetchTopNFunctionsFromStacktraces': boolean;
'securitySolution:excludedDataTiersForRuleExecution': string[];
'observability:searchExcludedDataTiers': string[];
}
9 changes: 9 additions & 0 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -10355,6 +10355,15 @@
}
}
},
"observability:searchExcludedDataTiers": {
"type": "array",
"items": {
"type": "keyword",
"_meta": {
"description": "Non-default value of setting."
}
}
},
"banners:placement": {
"type": "keyword",
"_meta": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ export const profilingAzureCostDiscountRate = 'observability:profilingAzureCostD
export const apmEnableTransactionProfiling = 'observability:apmEnableTransactionProfiling';
export const profilingFetchTopNFunctionsFromStacktraces =
'observability:profilingFetchTopNFunctionsFromStacktraces';
export const searchExcludedDataTiers = 'observability:searchExcludedDataTiers';
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
apmEnableServiceInventoryTableSearchBar,
profilingFetchTopNFunctionsFromStacktraces,
enableInfrastructureContainerAssetView,
searchExcludedDataTiers,
} from '../common/ui_settings_keys';

const betaLabel = i18n.translate('xpack.observability.uiSettings.betaLabel', {
Expand Down Expand Up @@ -640,6 +641,24 @@ export const uiSettings: Record<string, UiSettings> = {
schema: schema.boolean(),
requiresPageReload: false,
},
[searchExcludedDataTiers]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.searchExcludedDataTiers', {
defaultMessage: 'Excluded data tiers from search',
}),
description: i18n.translate(
'xpack.observability.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. Affected apps: APM`,
}
),
value: [],
schema: schema.arrayOf(
schema.oneOf([schema.literal('data_cold'), schema.literal('data_frozen')])
),
requiresPageReload: false,
},
};

function throttlingDocsLink({ href }: { href: string }) {
Expand Down

0 comments on commit f029f80

Please sign in to comment.