forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Logs] Deprecate configuration settings (elastic#201625)
## 📓 Summary Closes elastic#200898 These changes deprecate some unused configurations and update the implementation where required in preparation for the Kibana v9 upgrade. <img width="3004" alt="Screenshot 2024-11-25 at 12 54 14" src="https://github.com/user-attachments/assets/cfa56d25-a270-4ec5-a97a-e72e7a7478a4"> --------- Co-authored-by: Marco Antonio Ghiani <[email protected]> Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
a277a61
commit ba808f7
Showing
19 changed files
with
208 additions
and
166 deletions.
There are no files selected for viewing
113 changes: 113 additions & 0 deletions
113
x-pack/plugins/observability_solution/infra/server/config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
|
||
import { offeringBasedSchema, schema } from '@kbn/config-schema'; | ||
import { PluginConfigDescriptor } from '@kbn/core-plugins-server'; | ||
import { ConfigDeprecation } from '@kbn/config'; | ||
import { InfraConfig } from './types'; | ||
import { publicConfigKeys } from '../common/plugin_config_types'; | ||
|
||
export type { InfraConfig }; | ||
|
||
export const config: PluginConfigDescriptor<InfraConfig> = { | ||
schema: schema.object({ | ||
enabled: schema.boolean({ defaultValue: true }), | ||
alerting: schema.object({ | ||
inventory_threshold: schema.object({ | ||
group_by_page_size: schema.number({ defaultValue: 5_000 }), | ||
}), | ||
metric_threshold: schema.object({ | ||
group_by_page_size: schema.number({ defaultValue: 10_000 }), | ||
}), | ||
}), | ||
inventory: schema.object({ | ||
compositeSize: schema.number({ defaultValue: 2000 }), | ||
}), | ||
sources: schema.maybe( | ||
schema.object({ | ||
default: schema.maybe( | ||
schema.object({ | ||
fields: schema.maybe( | ||
schema.object({ | ||
message: schema.maybe(schema.arrayOf(schema.string())), | ||
}) | ||
), | ||
}) | ||
), | ||
}) | ||
), | ||
featureFlags: schema.object({ | ||
customThresholdAlertsEnabled: offeringBasedSchema({ | ||
traditional: schema.boolean({ defaultValue: false }), | ||
serverless: schema.boolean({ defaultValue: false }), | ||
}), | ||
logsUIEnabled: offeringBasedSchema({ | ||
traditional: schema.boolean({ defaultValue: true }), | ||
serverless: schema.boolean({ defaultValue: false }), | ||
}), | ||
metricsExplorerEnabled: offeringBasedSchema({ | ||
traditional: schema.boolean({ defaultValue: true }), | ||
serverless: schema.boolean({ defaultValue: false }), | ||
}), | ||
osqueryEnabled: schema.boolean({ defaultValue: true }), | ||
inventoryThresholdAlertRuleEnabled: offeringBasedSchema({ | ||
traditional: schema.boolean({ defaultValue: true }), | ||
serverless: schema.boolean({ defaultValue: true }), | ||
}), | ||
metricThresholdAlertRuleEnabled: offeringBasedSchema({ | ||
traditional: schema.boolean({ defaultValue: true }), | ||
serverless: schema.boolean({ defaultValue: false }), | ||
}), | ||
logThresholdAlertRuleEnabled: offeringBasedSchema({ | ||
traditional: schema.boolean({ defaultValue: true }), | ||
serverless: schema.boolean({ defaultValue: false }), | ||
}), | ||
alertsAndRulesDropdownEnabled: offeringBasedSchema({ | ||
traditional: schema.boolean({ defaultValue: true }), | ||
serverless: schema.boolean({ defaultValue: true }), | ||
}), | ||
/** | ||
* Depends on optional "profilingDataAccess" and "profiling" | ||
* plugins. Enable both with `xpack.profiling.enabled: true` before | ||
* enabling this feature flag. | ||
*/ | ||
profilingEnabled: schema.boolean({ defaultValue: false }), | ||
ruleFormV2Enabled: schema.boolean({ defaultValue: false }), | ||
}), | ||
}), | ||
deprecations: () => [sourceFieldsMessageDeprecation], | ||
exposeToBrowser: publicConfigKeys, | ||
}; | ||
|
||
const sourceFieldsMessageDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { | ||
const sourceFieldsMessageSetting = settings?.xpack?.infra?.sources?.default?.fields?.message; | ||
|
||
if (sourceFieldsMessageSetting) { | ||
addDeprecation({ | ||
configPath: `${fromPath}.sources.default.fields.message`, | ||
title: i18n.translate('xpack.infra.deprecations.sourcesDefaultFieldsMessage.title', { | ||
defaultMessage: 'The "xpack.infra.sources.default.fields.message" setting is deprecated.', | ||
ignoreTag: true, | ||
}), | ||
message: i18n.translate('xpack.infra.deprecations.sourcesDefaultFieldsMessage.message', { | ||
defaultMessage: | ||
'Features using this configurations are set to be removed in v9 and this is no longer used.', | ||
}), | ||
level: 'warning', | ||
documentationUrl: `https://www.elastic.co/guide/en/kibana/current/logs-ui-settings-kb.html#general-logs-ui-settings-kb`, | ||
correctiveActions: { | ||
manualSteps: [ | ||
i18n.translate('xpack.infra.deprecations.sourcesDefaultFieldsMessage.manualSteps1', { | ||
defaultMessage: 'Remove "xpack.infra.sources.default.fields.message" from kibana.yml.', | ||
ignoreTag: true, | ||
}), | ||
], | ||
}, | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.