diff --git a/docs/reference/migration/migrate_8_0/settings.asciidoc b/docs/reference/migration/migrate_8_0/settings.asciidoc index beb1aae26667..01d32bb209a6 100644 --- a/docs/reference/migration/migrate_8_0/settings.asciidoc +++ b/docs/reference/migration/migrate_8_0/settings.asciidoc @@ -73,19 +73,21 @@ In Elasticsearch 7.8.0, the following settings no longer have any effect, and have been deprecated: * `xpack.ilm.enabled` +* `xpack.monitoring.enabled` -In other words, even if `xpack.ilm.enabled` is set to `false`, the ILM APIs -will be available. +Previously, these settings could be set to `false` in order to disable the +feature's APIs in a cluster. As of 7.8.0, these basic license features are +always enabled for the {default-dist}. If you have disabled ILM so that you can use another tool to manage Watcher indices, the newly introduced `xpack.watcher.use_ilm_index_management` setting may be set to false. -Additionally, the following settings have been deprecated: +Additionally, the following settings have been deprecated without removing +their effects: * `xpack.enrich.enabled` * `xpack.flattened.enabled` -* `xpack.monitoring.enabled` * `xpack.rollup.enabled` * `xpack.slm.enabled` * `xpack.sql.enabled` @@ -93,7 +95,7 @@ Additionally, the following settings have been deprecated: * `xpack.vectors.enabled` In future releases, it will not be possible to disable the APIs for Enrichment, -Flattened mappings, Monitoring, Rollup, SLM, SQL, Transforms, and Vectors. +Flattened mappings, Rollup, SLM, SQL, Transforms, and Vectors. [float] ==== The `prefer_v2_templates` parameter now defaults to `true` diff --git a/docs/reference/monitoring/collecting-monitoring-data.asciidoc b/docs/reference/monitoring/collecting-monitoring-data.asciidoc index d38466b5a0e9..e917dcb382a8 100644 --- a/docs/reference/monitoring/collecting-monitoring-data.asciidoc +++ b/docs/reference/monitoring/collecting-monitoring-data.asciidoc @@ -30,10 +30,6 @@ To learn about monitoring in general, see <>. . Configure your cluster to collect monitoring data: -.. Verify that the deprecated `xpack.monitoring.enabled` setting is not set to -`false` on any node in the cluster. For more information, see -<>. - .. Verify that the `xpack.monitoring.elasticsearch.collection.enabled` setting is `true`, which is its default value, on each node in the cluster. + diff --git a/docs/reference/monitoring/esms.asciidoc b/docs/reference/monitoring/esms.asciidoc index 7648fe74ac70..12827fc00b14 100644 --- a/docs/reference/monitoring/esms.asciidoc +++ b/docs/reference/monitoring/esms.asciidoc @@ -119,8 +119,6 @@ Add the following setting in the {kib} configuration file (`kibana.yml`): xpack.monitoring.kibana.collection.enabled: false ---------------------------------- -Leave the `xpack.monitoring.enabled` set to its default value (`true`). - For more information, see {kibana-ref}/monitoring-settings-kb.html[Monitoring settings in {kib}]. -- diff --git a/docs/reference/settings/monitoring-settings.asciidoc b/docs/reference/settings/monitoring-settings.asciidoc index b7032c8987fc..07b96ea0ea36 100644 --- a/docs/reference/settings/monitoring-settings.asciidoc +++ b/docs/reference/settings/monitoring-settings.asciidoc @@ -28,12 +28,7 @@ For more information, see <>. `xpack.monitoring.enabled`:: deprecated:[7.8.0,Basic License features should always be enabled] + -Set to `true` (default) to enable {es} {monitoring} for {es} on the node. -+ --- -NOTE: To enable data collection, you must also set `xpack.monitoring.collection.enabled` -to `true`. Its default value is `false`. --- +This deprecated setting has no effect. [float] [[monitoring-collection-settings]] diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/CcrSingleNodeTestCase.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/CcrSingleNodeTestCase.java index b0c2c6adea3b..b420bd947264 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/CcrSingleNodeTestCase.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/CcrSingleNodeTestCase.java @@ -45,7 +45,6 @@ public abstract class CcrSingleNodeTestCase extends ESSingleNodeTestCase { protected Settings nodeSettings() { Settings.Builder builder = Settings.builder(); builder.put(XPackSettings.SECURITY_ENABLED.getKey(), false); - builder.put(XPackSettings.MONITORING_ENABLED.getKey(), false); builder.put(XPackSettings.WATCHER_ENABLED.getKey(), false); builder.put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false); builder.put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial"); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackSettings.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackSettings.java index b4db36d38544..5982049a3c81 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackSettings.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackSettings.java @@ -55,7 +55,12 @@ public class XPackSettings { /** Setting for enabling or disabling security. Defaults to true. */ public static final Setting SECURITY_ENABLED = Setting.boolSetting("xpack.security.enabled", true, Setting.Property.NodeScope); - /** Setting for enabling or disabling monitoring. */ + /** + * Setting for enabling or disabling monitoring. + *

+ * This setting is now a no-op: setting it to false is permitted, but does nothing. + */ + @Deprecated(since = "7.8.0") public static final Setting MONITORING_ENABLED = Setting.boolSetting("xpack.monitoring.enabled", true, Property.NodeScope, Property.Deprecated); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/MonitoringFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/MonitoringFeatureSetUsage.java index acb15d8e7301..d8de9036a81c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/MonitoringFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/MonitoringFeatureSetUsage.java @@ -30,9 +30,8 @@ public class MonitoringFeatureSetUsage extends XPackFeatureSet.Usage { collectionEnabled = in.readOptionalBoolean(); } - public MonitoringFeatureSetUsage(boolean available, boolean enabled, - boolean collectionEnabled, Map exporters) { - super(XPackField.MONITORING, available, enabled); + public MonitoringFeatureSetUsage(boolean available, boolean collectionEnabled, Map exporters) { + super(XPackField.MONITORING, available, true); this.exporters = exporters; this.collectionEnabled = collectionEnabled; } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicensesManagerServiceTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicensesManagerServiceTests.java index 6ccd27e56709..c00ca29da260 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicensesManagerServiceTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicensesManagerServiceTests.java @@ -37,7 +37,6 @@ public class LicensesManagerServiceTests extends ESSingleNodeTestCase { return Settings.builder() .put(super.nodeSettings()) .put(XPackSettings.SECURITY_ENABLED.getKey(), false) - .put(XPackSettings.MONITORING_ENABLED.getKey(), false) .put(XPackSettings.WATCHER_ENABLED.getKey(), false) .put(XPackSettings.GRAPH_ENABLED.getKey(), false) .put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false) diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/AbstractEqlIntegTestCase.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/AbstractEqlIntegTestCase.java index b6a2c28533b8..ff06bd114e9b 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/AbstractEqlIntegTestCase.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/AbstractEqlIntegTestCase.java @@ -25,7 +25,6 @@ public abstract class AbstractEqlIntegTestCase extends ESIntegTestCase { protected Settings nodeSettings(int nodeOrdinal) { Settings.Builder settings = Settings.builder().put(super.nodeSettings(nodeOrdinal)); settings.put(XPackSettings.SECURITY_ENABLED.getKey(), false); - settings.put(XPackSettings.MONITORING_ENABLED.getKey(), false); settings.put(XPackSettings.WATCHER_ENABLED.getKey(), false); settings.put(XPackSettings.GRAPH_ENABLED.getKey(), false); settings.put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false); diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleInitialisationTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleInitialisationTests.java index 7095e38d1e74..dada2fb19270 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleInitialisationTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleInitialisationTests.java @@ -97,7 +97,6 @@ public class IndexLifecycleInitialisationTests extends ESIntegTestCase { settings.put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false); settings.put(XPackSettings.SECURITY_ENABLED.getKey(), false); settings.put(XPackSettings.WATCHER_ENABLED.getKey(), false); - settings.put(XPackSettings.MONITORING_ENABLED.getKey(), false); settings.put(XPackSettings.GRAPH_ENABLED.getKey(), false); settings.put(LifecycleSettings.LIFECYCLE_POLL_INTERVAL, "1s"); diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecycleInitialisationTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecycleInitialisationTests.java index d2ec43274fef..339b6570f1fb 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecycleInitialisationTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecycleInitialisationTests.java @@ -47,7 +47,6 @@ public class SnapshotLifecycleInitialisationTests extends ESSingleNodeTestCase { settings.put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false); settings.put(XPackSettings.SECURITY_ENABLED.getKey(), false); settings.put(XPackSettings.WATCHER_ENABLED.getKey(), false); - settings.put(XPackSettings.MONITORING_ENABLED.getKey(), false); settings.put(XPackSettings.GRAPH_ENABLED.getKey(), false); settings.put(Environment.PATH_REPO_SETTING.getKey(), repositoryLocation); diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlSingleNodeTestCase.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlSingleNodeTestCase.java index 3d08d8626b5c..25e75040fa81 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlSingleNodeTestCase.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlSingleNodeTestCase.java @@ -44,7 +44,6 @@ public abstract class MlSingleNodeTestCase extends ESSingleNodeTestCase { newSettings.put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial"); // Disable security otherwise delete-by-query action fails to get authorized newSettings.put(XPackSettings.SECURITY_ENABLED.getKey(), false); - newSettings.put(XPackSettings.MONITORING_ENABLED.getKey(), false); newSettings.put(XPackSettings.WATCHER_ENABLED.getKey(), false); // Disable ILM history index so that the tests don't have to clean it up newSettings.put(LifecycleSettings.LIFECYCLE_HISTORY_INDEX_ENABLED_SETTING.getKey(), false); diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/AnnotationIndexIT.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/AnnotationIndexIT.java index 31ec7ad3911a..00d90fd34a48 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/AnnotationIndexIT.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/AnnotationIndexIT.java @@ -27,7 +27,6 @@ public class AnnotationIndexIT extends MlSingleNodeTestCase { protected Settings nodeSettings() { Settings.Builder newSettings = Settings.builder(); newSettings.put(super.nodeSettings()); - newSettings.put(XPackSettings.MONITORING_ENABLED.getKey(), false); newSettings.put(XPackSettings.SECURITY_ENABLED.getKey(), false); newSettings.put(XPackSettings.WATCHER_ENABLED.getKey(), false); return newSettings.build(); diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java index dc52ddbf3d63..8b8aa73e0eae 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/support/BaseMlIntegTestCase.java @@ -92,7 +92,6 @@ public abstract class BaseMlIntegTestCase extends ESIntegTestCase { settings.put(XPackSettings.SECURITY_ENABLED.getKey(), false); settings.put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial"); settings.put(XPackSettings.WATCHER_ENABLED.getKey(), false); - settings.put(XPackSettings.MONITORING_ENABLED.getKey(), false); settings.put(XPackSettings.GRAPH_ENABLED.getKey(), false); settings.put(LifecycleSettings.LIFECYCLE_HISTORY_INDEX_ENABLED_SETTING.getKey(), false); return settings.build(); diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java index 8b6fef3a574f..b6767719a433 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java @@ -32,7 +32,6 @@ import org.elasticsearch.script.ScriptService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; import org.elasticsearch.xpack.core.XPackPlugin; -import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; import org.elasticsearch.xpack.core.monitoring.MonitoringField; @@ -66,7 +65,6 @@ import java.util.Map; import java.util.Set; import java.util.function.Supplier; -import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import static org.elasticsearch.common.settings.Setting.boolSetting; @@ -80,13 +78,11 @@ public class Monitoring extends Plugin implements ActionPlugin, ReloadablePlugin true, Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.Deprecated); protected final Settings settings; - private final boolean enabled; private Exporters exporters; public Monitoring(Settings settings) { this.settings = settings; - this.enabled = XPackSettings.MONITORING_ENABLED.get(settings); } // overridable by tests @@ -94,10 +90,6 @@ public class Monitoring extends Plugin implements ActionPlugin, ReloadablePlugin protected XPackLicenseState getLicenseState() { return XPackPlugin.getSharedLicenseState(); } protected LicenseService getLicenseService() { return XPackPlugin.getSharedLicenseService(); } - boolean isEnabled() { - return enabled; - } - @Override public Collection createComponents(Client client, ClusterService clusterService, ThreadPool threadPool, ResourceWatcherService resourceWatcherService, ScriptService scriptService, @@ -105,10 +97,6 @@ public class Monitoring extends Plugin implements ActionPlugin, ReloadablePlugin NodeEnvironment nodeEnvironment, NamedWriteableRegistry namedWriteableRegistry, IndexNameExpressionResolver expressionResolver, Supplier repositoriesServiceSupplier) { - if (enabled == false) { - return Collections.singletonList(new MonitoringUsageServices(null, null)); - } - final ClusterSettings clusterSettings = clusterService.getClusterSettings(); final CleanerService cleanerService = new CleanerService(settings, clusterSettings, threadPool, getLicenseState()); final SSLService dynamicSSLService = getSslService().createDynamicSSLService(); @@ -140,9 +128,6 @@ public class Monitoring extends Plugin implements ActionPlugin, ReloadablePlugin public List> getActions() { var usageAction = new ActionHandler<>(XPackUsageFeatureAction.MONITORING, MonitoringUsageTransportAction.class); var infoAction = new ActionHandler<>(XPackInfoFeatureAction.MONITORING, MonitoringInfoTransportAction.class); - if (false == enabled) { - return Arrays.asList(usageAction, infoAction); - } return Arrays.asList( new ActionHandler<>(MonitoringBulkAction.INSTANCE, TransportMonitoringBulkAction.class), usageAction, @@ -153,9 +138,6 @@ public class Monitoring extends Plugin implements ActionPlugin, ReloadablePlugin public List getRestHandlers(Settings settings, RestController restController, ClusterSettings clusterSettings, IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter, IndexNameExpressionResolver indexNameExpressionResolver, Supplier nodesInCluster) { - if (false == enabled) { - return emptyList(); - } return singletonList(new RestMonitoringBulkAction()); } diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringInfoTransportAction.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringInfoTransportAction.java index 56828bd8ddde..0ef97311de16 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringInfoTransportAction.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringInfoTransportAction.java @@ -7,24 +7,20 @@ package org.elasticsearch.xpack.monitoring; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.XPackField; -import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; import org.elasticsearch.xpack.core.action.XPackInfoFeatureTransportAction; public class MonitoringInfoTransportAction extends XPackInfoFeatureTransportAction { - private final boolean enabled; private final XPackLicenseState licenseState; @Inject public MonitoringInfoTransportAction(TransportService transportService, ActionFilters actionFilters, - Settings settings, XPackLicenseState licenseState) { + XPackLicenseState licenseState) { super(XPackInfoFeatureAction.MONITORING.name(), transportService, actionFilters); - this.enabled = XPackSettings.MONITORING_ENABLED.get(settings); this.licenseState = licenseState; } @@ -40,6 +36,6 @@ public class MonitoringInfoTransportAction extends XPackInfoFeatureTransportActi @Override public boolean enabled() { - return enabled; + return true; } } diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringUsageTransportAction.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringUsageTransportAction.java index 8e443504c2bb..134145fb068a 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringUsageTransportAction.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringUsageTransportAction.java @@ -11,13 +11,11 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.protocol.xpack.XPackUsageRequest; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; import org.elasticsearch.xpack.core.action.XPackUsageFeatureResponse; import org.elasticsearch.xpack.core.action.XPackUsageFeatureTransportAction; @@ -29,7 +27,6 @@ import java.util.HashMap; import java.util.Map; public class MonitoringUsageTransportAction extends XPackUsageFeatureTransportAction { - private final boolean enabled; private final MonitoringService monitoringService; private final XPackLicenseState licenseState; private final Exporters exporters; @@ -37,10 +34,9 @@ public class MonitoringUsageTransportAction extends XPackUsageFeatureTransportAc @Inject public MonitoringUsageTransportAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - Settings settings, XPackLicenseState licenseState, MonitoringUsageServices monitoringServices) { + XPackLicenseState licenseState, MonitoringUsageServices monitoringServices) { super(XPackUsageFeatureAction.MONITORING.name(), transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver); - this.enabled = XPackSettings.MONITORING_ENABLED.get(settings); this.licenseState = licenseState; this.monitoringService = monitoringServices.monitoringService; this.exporters = monitoringServices.exporters; @@ -51,7 +47,7 @@ public class MonitoringUsageTransportAction extends XPackUsageFeatureTransportAc ActionListener listener) { final boolean collectionEnabled = monitoringService != null && monitoringService.isMonitoringActive(); var usage = new MonitoringFeatureSetUsage(licenseState.isAllowed(XPackLicenseState.Feature.MONITORING), - enabled, collectionEnabled, exportersUsage(exporters)); + collectionEnabled, exportersUsage(exporters)); listener.onResponse(new XPackUsageFeatureResponse(usage)); } diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringInfoTransportActionTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringInfoTransportActionTests.java index d2ba572c434a..1b6b0a50e89d 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringInfoTransportActionTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringInfoTransportActionTests.java @@ -11,8 +11,6 @@ import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.settings.Setting; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; @@ -21,7 +19,6 @@ import org.elasticsearch.test.VersionUtils; import org.elasticsearch.test.rest.yaml.ObjectPath; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.XPackFeatureSet; -import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.action.XPackUsageFeatureResponse; import org.elasticsearch.xpack.core.monitoring.MonitoringFeatureSetUsage; import org.elasticsearch.xpack.monitoring.exporter.Exporter; @@ -48,25 +45,15 @@ public class MonitoringInfoTransportActionTests extends ESTestCase { public void testAvailable() { MonitoringInfoTransportAction featureSet = new MonitoringInfoTransportAction( - mock(TransportService.class), mock(ActionFilters.class), Settings.EMPTY, licenseState); + mock(TransportService.class), mock(ActionFilters.class), licenseState); boolean available = randomBoolean(); when(licenseState.isAllowed(XPackLicenseState.Feature.MONITORING)).thenReturn(available); assertThat(featureSet.available(), is(available)); } - public void testEnabledSetting() { - boolean enabled = randomBoolean(); - Settings.Builder settings = Settings.builder(); - settings.put("xpack.monitoring.enabled", enabled); + public void testMonitoringEnabledByDefault() { MonitoringInfoTransportAction featureSet = new MonitoringInfoTransportAction( - mock(TransportService.class), mock(ActionFilters.class), settings.build(), licenseState); - assertThat(featureSet.enabled(), is(enabled)); - assertSettingDeprecationsAndWarnings(new Setting[] { XPackSettings.MONITORING_ENABLED } ); - } - - public void testEnabledDefault() { - MonitoringInfoTransportAction featureSet = new MonitoringInfoTransportAction( - mock(TransportService.class), mock(ActionFilters.class), Settings.EMPTY, licenseState); + mock(TransportService.class), mock(ActionFilters.class), licenseState); assertThat(featureSet.enabled(), is(true)); } @@ -106,7 +93,7 @@ public class MonitoringInfoTransportActionTests extends ESTestCase { when(monitoring.isMonitoringActive()).thenReturn(collectionEnabled); var usageAction = new MonitoringUsageTransportAction(mock(TransportService.class), null, null, - mock(ActionFilters.class), null, Settings.EMPTY,licenseState, + mock(ActionFilters.class), null, licenseState, new MonitoringUsageServices(monitoring, exporters)); PlainActionFuture future = new PlainActionFuture<>(); usageAction.masterOperation(null, null, null, future); diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringPluginClientTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringPluginClientTests.java deleted file mode 100644 index b4dc9b3112ec..000000000000 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringPluginClientTests.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -package org.elasticsearch.xpack.monitoring; - -import org.elasticsearch.client.Client; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ESTestCase; - -import static org.hamcrest.Matchers.is; - -public class MonitoringPluginClientTests extends ESTestCase { - - public void testModulesWithNodeSettings() throws Exception { - // these settings mimic what ES does when running as a node... - Settings settings = Settings.builder() - .put("path.home", createTempDir()) - .put(Client.CLIENT_TYPE_SETTING_S.getKey(), "node") - .build(); - Monitoring plugin = new Monitoring(settings); - assertThat(plugin.isEnabled(), is(true)); - } -} diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsCollectorTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsCollectorTests.java index cc0bb1c59ba0..cb7ef41a3641 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsCollectorTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsCollectorTests.java @@ -206,7 +206,7 @@ public class ClusterStatsCollectorTests extends BaseCollectorTestCase { .thenReturn(indices); final XPackUsageResponse xPackUsageResponse = new XPackUsageResponse( - singletonList(new MonitoringFeatureSetUsage(true, true, false, null))); + singletonList(new MonitoringFeatureSetUsage(true, false, null))); @SuppressWarnings("unchecked") final ActionFuture xPackUsageFuture = (ActionFuture) mock(ActionFuture.class); @@ -305,7 +305,7 @@ public class ClusterStatsCollectorTests extends BaseCollectorTestCase { when(client.admin()).thenReturn(adminClient); final XPackUsageResponse xPackUsageResponse = new XPackUsageResponse( - singletonList(new MonitoringFeatureSetUsage(true, true, false, null))); + singletonList(new MonitoringFeatureSetUsage(true, false, null))); @SuppressWarnings("unchecked") final ActionFuture xPackUsageFuture = (ActionFuture) mock(ActionFuture.class); when(client.execute(same(XPackUsageAction.INSTANCE), any(XPackUsageRequest.class))).thenReturn(xPackUsageFuture); diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java index eddb14308acc..477ab6dd89e8 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java @@ -235,7 +235,7 @@ public class ClusterStatsMonitoringDocTests extends BaseMonitoringDocTestCase usages = singletonList(new MonitoringFeatureSetUsage(false, true, false, null)); + final List usages = singletonList(new MonitoringFeatureSetUsage(false, false, null)); final NodeInfo mockNodeInfo = mock(NodeInfo.class); Version mockNodeVersion = Version.CURRENT.minimumIndexCompatibilityVersion(); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java index 973aed451d34..e2bda4522f32 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java @@ -135,9 +135,8 @@ public class SecuritySettingsSource extends NodeConfigurationSource { .put(XPackSettings.SECURITY_ENABLED.getKey(), true) .put(NetworkModule.TRANSPORT_TYPE_KEY, randomBoolean() ? SecurityField.NAME4 : SecurityField.NIO) .put(NetworkModule.HTTP_TYPE_KEY, randomBoolean() ? SecurityField.NAME4 : SecurityField.NIO) - //TODO: for now isolate security tests from watcher & monitoring (randomize this later) + //TODO: for now isolate security tests from watcher (randomize this later) .put(XPackSettings.WATCHER_ENABLED.getKey(), false) - .put(XPackSettings.MONITORING_ENABLED.getKey(), false) .put(XPackSettings.AUDIT_ENABLED.getKey(), randomBoolean()) .put(LoggingAuditTrail.EMIT_HOST_ADDRESS_SETTING.getKey(), randomBoolean()) .put(LoggingAuditTrail.EMIT_HOST_NAME_SETTING.getKey(), randomBoolean()) diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/AbstractSqlIntegTestCase.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/AbstractSqlIntegTestCase.java index 58af33172da6..4c5f2c6f4ca1 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/AbstractSqlIntegTestCase.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/AbstractSqlIntegTestCase.java @@ -23,7 +23,6 @@ public abstract class AbstractSqlIntegTestCase extends ESIntegTestCase { protected Settings nodeSettings(int nodeOrdinal) { Settings.Builder settings = Settings.builder().put(super.nodeSettings(nodeOrdinal)); settings.put(XPackSettings.SECURITY_ENABLED.getKey(), false); - settings.put(XPackSettings.MONITORING_ENABLED.getKey(), false); settings.put(XPackSettings.WATCHER_ENABLED.getKey(), false); settings.put(XPackSettings.GRAPH_ENABLED.getKey(), false); settings.put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false); diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java index 6588218fd93e..123503eb5dcc 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java @@ -107,7 +107,6 @@ public abstract class AbstractWatcherIntegrationTestCase extends ESIntegTestCase protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(XPackSettings.MONITORING_ENABLED.getKey(), false) .put(XPackSettings.SECURITY_ENABLED.getKey(), false) .put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial") // we do this by default in core, but for watcher this isn't needed and only adds noise. diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/RejectedExecutionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/RejectedExecutionTests.java index a0e84ed8faff..b2f8d0c2929c 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/RejectedExecutionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/RejectedExecutionTests.java @@ -59,7 +59,6 @@ public class RejectedExecutionTests extends AbstractWatcherIntegrationTestCase { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(XPackSettings.MONITORING_ENABLED.getKey(), false) .put(XPackSettings.SECURITY_ENABLED.getKey(), false) .put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial") .put("thread_pool.write.size", 1)