Skip to content

Commit 06c27ec

Browse files
authored
apm-data: enable plugin by default (#108860)
We will enable the plugin by default in 8.15.0 as the default means of installing APM index templates and ingest pipelines.
1 parent e6eabc8 commit 06c27ec

File tree

5 files changed

+43
-8
lines changed

5 files changed

+43
-8
lines changed

docs/changelog/108860.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 108860
2+
summary: "Apm-data: enable plugin by default"
3+
area: Data streams
4+
type: enhancement
5+
issues: []

modules/data-streams/src/javaRestTest/java/org/elasticsearch/datastreams/LogsDataStreamIT.java

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,16 @@
1111
import org.elasticsearch.client.Request;
1212
import org.elasticsearch.client.ResponseException;
1313
import org.elasticsearch.client.RestClient;
14+
import org.elasticsearch.common.settings.SecureString;
15+
import org.elasticsearch.common.settings.Settings;
16+
import org.elasticsearch.common.util.concurrent.ThreadContext;
17+
import org.elasticsearch.test.cluster.ElasticsearchCluster;
18+
import org.elasticsearch.test.cluster.FeatureFlag;
19+
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
20+
import org.elasticsearch.test.rest.ESRestTestCase;
1421
import org.junit.After;
1522
import org.junit.Before;
23+
import org.junit.ClassRule;
1624

1725
import java.io.IOException;
1826
import java.util.List;
@@ -27,7 +35,33 @@
2735
import static org.hamcrest.Matchers.not;
2836
import static org.hamcrest.Matchers.nullValue;
2937

30-
public class LogsDataStreamIT extends DisabledSecurityDataStreamTestCase {
38+
public class LogsDataStreamIT extends ESRestTestCase {
39+
40+
@ClassRule
41+
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
42+
.distribution(DistributionType.DEFAULT)
43+
.feature(FeatureFlag.FAILURE_STORE_ENABLED)
44+
.setting("xpack.security.enabled", "false")
45+
.setting("xpack.watcher.enabled", "false")
46+
// Disable apm-data so the index templates it installs do not impact
47+
// tests such as testIgnoreDynamicBeyondLimit.
48+
.setting("xpack.apm_data.enabled", "false")
49+
.build();
50+
51+
@Override
52+
protected String getTestRestCluster() {
53+
return cluster.getHttpAddresses();
54+
}
55+
56+
@Override
57+
protected Settings restAdminSettings() {
58+
if (super.restAdminSettings().keySet().contains(ThreadContext.PREFIX + ".Authorization")) {
59+
return super.restAdminSettings();
60+
} else {
61+
String token = basicAuthHeaderValue("admin", new SecureString("admin-password".toCharArray()));
62+
return Settings.builder().put(super.restAdminSettings()).put(ThreadContext.PREFIX + ".Authorization", token).build();
63+
}
64+
}
3165

3266
private RestClient client;
3367

x-pack/plugin/apm-data/src/yamlRestTest/java/org/elasticsearch/xpack/apmdata/APMYamlTestSuiteIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public class APMYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
3434
.module("x-pack-ilm")
3535
.module("x-pack-stack")
3636
.setting("ingest.geoip.downloader.enabled", "false")
37-
.setting("xpack.apm_data.enabled", "true")
3837
.build();
3938

4039
public APMYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackSettings.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,8 @@ public Iterator<Setting<?>> settings() {
9090
Setting.Property.NodeScope
9191
);
9292

93-
/** Setting for enabling or disabling APM Data. Defaults to false. */
94-
public static final Setting<Boolean> APM_DATA_ENABLED = Setting.boolSetting(
95-
"xpack.apm_data.enabled",
96-
false,
97-
Setting.Property.NodeScope
98-
);
93+
/** Setting for enabling or disabling APM Data. Defaults to true. */
94+
public static final Setting<Boolean> APM_DATA_ENABLED = Setting.boolSetting("xpack.apm_data.enabled", true, Setting.Property.NodeScope);
9995

10096
/** Setting for enabling or disabling enterprise search. Defaults to true. */
10197
public static final Setting<Boolean> ENTERPRISE_SEARCH_ENABLED = Setting.boolSetting(

x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ testClusters.configureEach {
5757
setting 'slm.history_index_enabled', 'false'
5858
setting 'stack.templates.enabled', 'false'
5959
setting 'xpack.ent_search.enabled', 'false'
60+
setting 'xpack.apm_data.enabled', 'false'
6061
// To spice things up a bit, one of the nodes is not an ML node
6162
nodes.'javaRestTest-0'.setting 'node.roles', '["master","data","ingest"]'
6263
nodes.'javaRestTest-1'.setting 'node.roles', '["master","data","ingest","ml"]'

0 commit comments

Comments
 (0)