Skip to content

Commit

Permalink
Update node deprecation checks to return critical deprecations for mo…
Browse files Browse the repository at this point in the history
…nitoring settings.
  • Loading branch information
jbaiera committed Jan 28, 2025
1 parent de94016 commit 8bd4fb7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ static DeprecationIssue checkDeprecatedSetting(
final Settings nodeSettings,
final Setting<?> deprecatedSetting,
final String url,
final String whenRemoved
final String whenRemoved,
final DeprecationIssue.Level level
) {
if (deprecatedSetting.exists(clusterSettings) == false && deprecatedSetting.exists(nodeSettings) == false) {
return null;
Expand All @@ -66,7 +67,7 @@ static DeprecationIssue checkDeprecatedSetting(
deprecatedSettingKey,
value
);
return new DeprecationIssue(DeprecationIssue.Level.WARNING, message, url, details, false, null);
return new DeprecationIssue(level, message, url, details, false, null);
}

private static Map<String, Object> createMetaMapForRemovableSettings(boolean canAutoRemoveSetting, String removableSetting) {
Expand Down Expand Up @@ -365,7 +366,8 @@ static DeprecationIssue genericMonitoringSetting(
nodeSettings,
deprecated,
MONITORING_SETTING_DEPRECATION_LINK,
MONITORING_SETTING_REMOVAL_TIME
MONITORING_SETTING_REMOVAL_TIME,
DeprecationIssue.Level.CRITICAL
);
}

Expand All @@ -382,7 +384,7 @@ static DeprecationIssue genericMonitoringAffixSetting(
),
"Remove the following settings: [%s]",
MONITORING_SETTING_DEPRECATION_LINK,
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
clusterSettings,
nodeSettings
);
Expand All @@ -397,7 +399,7 @@ static DeprecationIssue genericMonitoringAffixSecureSetting(
Setting.affixKeySetting("xpack.monitoring.exporters.", deprecatedSuffix, k -> SecureSetting.secureString(k, null)),
"Remove the following settings from the keystore: [%s]",
MONITORING_SETTING_DEPRECATION_LINK,
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
clusterSettings,
nodeSettings
);
Expand All @@ -412,7 +414,7 @@ static DeprecationIssue genericMonitoringAffixGroupedSetting(
Setting.affixKeySetting("xpack.monitoring.exporters.", deprecatedSuffix, k -> Setting.groupSetting(k + ".")),
"Remove the following settings: [%s]",
MONITORING_SETTING_DEPRECATION_LINK,
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
clusterSettings,
nodeSettings
);
Expand Down Expand Up @@ -711,7 +713,7 @@ static DeprecationIssue checkExporterUseIngestPipelineSettings(
MonitoringDeprecatedSettings.USE_INGEST_PIPELINE_SETTING,
"Remove the following settings: [%s]",
"https://ela.st/es-deprecation-7-monitoring-exporter-use-ingest-setting",
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
clusterState.metadata().settings(),
settings
);
Expand All @@ -727,7 +729,7 @@ static DeprecationIssue checkExporterPipelineMasterTimeoutSetting(
MonitoringDeprecatedSettings.PIPELINE_CHECK_TIMEOUT_SETTING,
"Remove the following settings: [%s]",
"https://ela.st/es-deprecation-7-monitoring-exporter-pipeline-timeout-setting",
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
clusterState.metadata().settings(),
settings
);
Expand All @@ -743,7 +745,7 @@ static DeprecationIssue checkExporterCreateLegacyTemplateSetting(
MonitoringDeprecatedSettings.TEMPLATE_CREATE_LEGACY_VERSIONS_SETTING,
"Remove the following settings: [%s]",
"https://ela.st/es-deprecation-7-monitoring-exporter-create-legacy-template-setting",
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
clusterState.metadata().settings(),
settings
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void monitoringSetting(String settingKey, String value) {
issues,
hasItem(
new DeprecationIssue(
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
"setting [" + settingKey + "] is deprecated and will be removed after 8.0",
expectedUrl,
"the setting [" + settingKey + "] is currently set to [" + value + "], remove this setting",
Expand All @@ -268,7 +268,7 @@ void monitoringExporterSetting(String suffix, String value) {
issues,
hasItem(
new DeprecationIssue(
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
"The [" + settingKey + "] settings are deprecated and will be removed after 8.0",
expectedUrl,
"Remove the following settings: [" + settingKey + "]",
Expand All @@ -293,7 +293,7 @@ void monitoringExporterGroupedSetting(String suffix, String value) {
issues,
hasItem(
new DeprecationIssue(
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
"The [" + settingKey + ".*] settings are deprecated and will be removed after 8.0",
expectedUrl,
"Remove the following settings: [" + subSettingKey + "]",
Expand All @@ -319,7 +319,7 @@ void monitoringExporterSecureSetting(String suffix, String value) {
issues,
hasItem(
new DeprecationIssue(
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
"The [" + settingKey + "] settings are deprecated and will be removed after 8.0",
expectedUrl,
"Remove the following settings from the keystore: [" + settingKey + "]",
Expand Down Expand Up @@ -467,7 +467,7 @@ public void testExporterUseIngestPipelineSettings() {
issues,
hasItem(
new DeprecationIssue(
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
"The [xpack.monitoring.exporters.test.use_ingest] settings are deprecated and will be removed after 8.0",
expectedUrl,
"Remove the following settings: [xpack.monitoring.exporters.test.use_ingest]",
Expand All @@ -493,7 +493,7 @@ public void testExporterPipelineMasterTimeoutSetting() {
issues,
hasItem(
new DeprecationIssue(
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
"The [xpack.monitoring.exporters.test.index.pipeline.master_timeout] "
+ "settings are deprecated and will be removed after 8.0",
expectedUrl,
Expand All @@ -518,7 +518,7 @@ public void testExporterCreateLegacyTemplateSetting() {
issues,
hasItem(
new DeprecationIssue(
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
"The [xpack.monitoring.exporters.test.index.template.create_legacy_templates] settings are deprecated and will be "
+ "removed after 8.0",
expectedUrl,
Expand Down Expand Up @@ -806,7 +806,7 @@ public void testDynamicSettings() {

Map<String, Object> meta = null;
final DeprecationIssue expected = new DeprecationIssue(
DeprecationIssue.Level.WARNING,
DeprecationIssue.Level.CRITICAL,
"The [" + concreteSettingKey + "] settings are deprecated and will be removed after 8.0",
"https://ela.st/es-deprecation-7-monitoring-exporter-use-ingest-setting",
"Remove the following settings: [" + concreteSettingKey + "]",
Expand Down

0 comments on commit 8bd4fb7

Please sign in to comment.