Skip to content

apm-data: enable plugin by default #108860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/changelog/108860.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 108860
summary: "Apm-data: enable plugin by default"
area: Data streams
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,8 @@ public Iterator<Setting<?>> settings() {
Setting.Property.NodeScope
);

/** Setting for enabling or disabling APM Data. Defaults to false. */
public static final Setting<Boolean> 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<Boolean> 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<Boolean> ENTERPRISE_SEARCH_ENABLED = Setting.boolSetting(
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"]'
Expand Down