-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
# Backport This will backport the following commits from `main` to `8.x`: - [[Logs] Deprecate configuration settings (#201625)](#201625) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Marco Antonio Ghiani","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-05T09:23:54Z","message":"[Logs] Deprecate configuration settings (#201625)\n\n## 📓 Summary\r\n\r\nCloses #200898 \r\n\r\nThese changes deprecate some unused configurations and update the\r\nimplementation where required in preparation for the Kibana v9 upgrade.\r\n\r\n<img width=\"3004\" alt=\"Screenshot 2024-11-25 at 12 54 14\"\r\nsrc=\"https://github.com/user-attachments/assets/cfa56d25-a270-4ec5-a97a-e72e7a7478a4\">\r\n\r\n---------\r\n\r\nCo-authored-by: Marco Antonio Ghiani <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"2994b0001cbae6bc1528bc1ad77c435597e0d5a2","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:deprecation","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-logs"],"number":201625,"url":"https://github.com/elastic/kibana/pull/201625","mergeCommit":{"message":"[Logs] Deprecate configuration settings (#201625)\n\n## 📓 Summary\r\n\r\nCloses #200898 \r\n\r\nThese changes deprecate some unused configurations and update the\r\nimplementation where required in preparation for the Kibana v9 upgrade.\r\n\r\n<img width=\"3004\" alt=\"Screenshot 2024-11-25 at 12 54 14\"\r\nsrc=\"https://github.com/user-attachments/assets/cfa56d25-a270-4ec5-a97a-e72e7a7478a4\">\r\n\r\n---------\r\n\r\nCo-authored-by: Marco Antonio Ghiani <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"2994b0001cbae6bc1528bc1ad77c435597e0d5a2"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201625","number":201625,"mergeCommit":{"message":"[Logs] Deprecate configuration settings (#201625)\n\n## 📓 Summary\r\n\r\nCloses #200898 \r\n\r\nThese changes deprecate some unused configurations and update the\r\nimplementation where required in preparation for the Kibana v9 upgrade.\r\n\r\n<img width=\"3004\" alt=\"Screenshot 2024-11-25 at 12 54 14\"\r\nsrc=\"https://github.com/user-attachments/assets/cfa56d25-a270-4ec5-a97a-e72e7a7478a4\">\r\n\r\n---------\r\n\r\nCo-authored-by: Marco Antonio Ghiani <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"2994b0001cbae6bc1528bc1ad77c435597e0d5a2"}}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
c876f79
commit e60bca6
Showing
19 changed files
with
209 additions
and
167 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.