diff --git a/docs/changelog/108860.yaml b/docs/changelog/108860.yaml new file mode 100644 index 0000000000000..93aa8ce7c08ff --- /dev/null +++ b/docs/changelog/108860.yaml @@ -0,0 +1,5 @@ +pr: 108860 +summary: "Apm-data: enable plugin by default" +area: Data streams +type: enhancement +issues: [] diff --git a/modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/LogsDataStreamIT.java b/modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/LogsDataStreamIT.java index 79d33a95c4709..c2a7a76ab751a 100644 --- a/modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/LogsDataStreamIT.java +++ b/modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/LogsDataStreamIT.java @@ -11,8 +11,16 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.ResponseException; import org.elasticsearch.client.RestClient; +import org.elasticsearch.common.settings.SecureString; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.util.concurrent.ThreadContext; +import org.elasticsearch.test.cluster.ElasticsearchCluster; +import org.elasticsearch.test.cluster.FeatureFlag; +import org.elasticsearch.test.cluster.local.distribution.DistributionType; +import org.elasticsearch.test.rest.ESRestTestCase; import org.junit.After; import org.junit.Before; +import org.junit.ClassRule; import java.io.IOException; import java.util.List; @@ -27,7 +35,33 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.nullValue; -public class LogsDataStreamIT extends DisabledSecurityDataStreamTestCase { +public class LogsDataStreamIT extends ESRestTestCase { + + @ClassRule + public static ElasticsearchCluster cluster = ElasticsearchCluster.local() + .distribution(DistributionType.DEFAULT) + .feature(FeatureFlag.FAILURE_STORE_ENABLED) + .setting("xpack.security.enabled", "false") + .setting("xpack.watcher.enabled", "false") + // Disable apm-data so the index templates it installs do not impact + // tests such as testIgnoreDynamicBeyondLimit. + .setting("xpack.apm_data.enabled", "false") + .build(); + + @Override + protected String getTestRestCluster() { + return cluster.getHttpAddresses(); + } + + @Override + protected Settings restAdminSettings() { + if (super.restAdminSettings().keySet().contains(ThreadContext.PREFIX + ".Authorization")) { + return super.restAdminSettings(); + } else { + String token = basicAuthHeaderValue("admin", new SecureString("admin-password".toCharArray())); + return Settings.builder().put(super.restAdminSettings()).put(ThreadContext.PREFIX + ".Authorization", token).build(); + } + } private RestClient client; diff --git a/x-pack/plugin/apm-data/src/yamlRestTest/java/org/elasticsearch/xpack/apmdata/APMYamlTestSuiteIT.java b/x-pack/plugin/apm-data/src/yamlRestTest/java/org/elasticsearch/xpack/apmdata/APMYamlTestSuiteIT.java index 1ed3892e2f8f4..82db91a8eedb3 100644 --- a/x-pack/plugin/apm-data/src/yamlRestTest/java/org/elasticsearch/xpack/apmdata/APMYamlTestSuiteIT.java +++ b/x-pack/plugin/apm-data/src/yamlRestTest/java/org/elasticsearch/xpack/apmdata/APMYamlTestSuiteIT.java @@ -34,7 +34,6 @@ public class APMYamlTestSuiteIT extends ESClientYamlSuiteTestCase { .module("x-pack-ilm") .module("x-pack-stack") .setting("ingest.geoip.downloader.enabled", "false") - .setting("xpack.apm_data.enabled", "true") .build(); public APMYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { 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 f10e7cf170bde..d33b2aecdab04 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 @@ -90,12 +90,8 @@ public Iterator> settings() { Setting.Property.NodeScope ); - /** Setting for enabling or disabling APM Data. Defaults to false. */ - public static final Setting APM_DATA_ENABLED = Setting.boolSetting( - "xpack.apm_data.enabled", - false, - Setting.Property.NodeScope - ); + /** Setting for enabling or disabling APM Data. Defaults to true. */ + public static final Setting APM_DATA_ENABLED = Setting.boolSetting("xpack.apm_data.enabled", true, Setting.Property.NodeScope); /** Setting for enabling or disabling enterprise search. Defaults to true. */ public static final Setting ENTERPRISE_SEARCH_ENABLED = Setting.boolSetting( diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle index 055561c747a63..eb1f9b9671bdc 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle @@ -57,6 +57,7 @@ testClusters.configureEach { setting 'slm.history_index_enabled', 'false' setting 'stack.templates.enabled', 'false' setting 'xpack.ent_search.enabled', 'false' + setting 'xpack.apm_data.enabled', 'false' // To spice things up a bit, one of the nodes is not an ML node nodes.'javaRestTest-0'.setting 'node.roles', '["master","data","ingest"]' nodes.'javaRestTest-1'.setting 'node.roles', '["master","data","ingest","ml"]'