Skip to content

Commit

Permalink
Deprecate Monitoring Settings (#79499)
Browse files Browse the repository at this point in the history
This PR deprecates all monitoring settings as well as adds deprecation info entries for each setting.

Collecting and shipping monitoring data using the Monitoring plugin will be deprecated in 7.16 and will be removed at some point in the 8.x line after sufficient wait time. The recommended approach for collecting and shipping monitoring data going forward is to use Metricbeat. The recommended approach for alerting is Kibana alerting.
  • Loading branch information
jbaiera committed Oct 20, 2021
1 parent f7454b8 commit 12d10b0
Show file tree
Hide file tree
Showing 38 changed files with 662 additions and 175 deletions.
4 changes: 4 additions & 0 deletions docs/reference/monitoring/collecting-monitoring-data.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,18 @@ For example, use the following APIs to review and change this setting:
[source,console]
----------------------------------
GET _cluster/settings
----------------------------------

[source,console]
----------------------------------
PUT _cluster/settings
{
"persistent": {
"xpack.monitoring.collection.enabled": true
}
}
----------------------------------
// TEST[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.]

Alternatively, you can enable this setting in {kib}. In the side navigation,
click *Monitoring*. If data collection is disabled, you are prompted to turn it
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/monitoring/configuring-metricbeat.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ You can use the following APIs to review and change this setting:
[source,console]
----------------------------------
GET _cluster/settings
----------------------------------

[source,console]
----------------------------------
PUT _cluster/settings
{
"persistent": {
"xpack.monitoring.collection.enabled": true
}
}
----------------------------------
// TEST[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.]

If {es} {security-features} are enabled, you must have `monitor` cluster privileges to
view the cluster settings and `manage` cluster privileges to change them.
Expand Down Expand Up @@ -201,6 +205,7 @@ PUT _cluster/settings
}
}
----------------------------------
// TEST[warning:[xpack.monitoring.elasticsearch.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.]

If {es} {security-features} are enabled, you must have `monitor` cluster
privileges to view the cluster settings and `manage` cluster privileges
Expand Down
1 change: 1 addition & 0 deletions docs/reference/snapshot-restore/restore-snapshot.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ PUT _cluster/settings
}
}
----
// TEST[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.]
// TEST[continued]
////

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,8 @@ private void wipeClusterSettings() throws IOException {
} else if (warnings.size() > 1) {
return true;
} else {
return warnings.get(0).startsWith("[transient settings removal]") == false;
return warnings.get(0).startsWith("[transient settings removal]") == false &&
warnings.get(0).contains("xpack.monitoring") == false;
}
}));

Expand Down
3 changes: 0 additions & 3 deletions x-pack/docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ testClusters.matching { it.name == "integTest" }.configureEach {
setting 'xpack.security.enabled', 'true'
setting 'xpack.security.authc.api_key.enabled', 'true'
setting 'xpack.security.authc.token.enabled', 'true'
// Disable monitoring exporters for the docs tests
setting 'xpack.monitoring.exporters._local.type', 'local'
setting 'xpack.monitoring.exporters._local.enabled', 'false'
// disable the ILM history for doc tests to avoid potential lingering tasks that'd cause test flakiness
setting 'indices.lifecycle.history_index_enabled', 'false'
setting 'xpack.license.self_generated.type', 'trial'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@ protected boolean isWatcherTest() {
return testName != null && (testName.contains("watcher/") || testName.contains("watcher\\"));
}

@Override
protected boolean isMonitoringTest() {
return false;
}

@Override
protected boolean isMachineLearningTest() {
String testName = getTestName();
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@ testClusters.configureEach {
setting 'xpack.security.enabled', 'true'
setting 'xpack.watcher.enabled', 'false'
// Integration tests are supposed to enable/disable exporters before/after each test
setting 'xpack.monitoring.exporters._local.type', 'local'
setting 'xpack.monitoring.exporters._local.enabled', 'false'
setting 'xpack.security.authc.token.enabled', 'true'
setting 'xpack.security.authc.api_key.enabled', 'true'
setting 'xpack.security.transport.ssl.enabled', 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ public void testDoCollect() throws Exception {
assertThat(document.getType(), is(AutoFollowStatsMonitoringDoc.TYPE));
assertThat(document.getId(), nullValue());
assertThat(document.stats(), is(autoFollowStats));

assertWarnings("[xpack.monitoring.collection.ccr.stats.timeout] setting was deprecated in Elasticsearch and will be removed in " +
"a future release! See the breaking changes documentation for the next major version.");
}

private List<FollowStatsAction.StatsResponse> mockStatuses() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public final class MonitoringField {
public static final Setting<TimeValue> HISTORY_DURATION = timeSetting("xpack.monitoring.history.duration",
TimeValue.timeValueHours(7 * 24), // default value (7 days)
HISTORY_DURATION_MINIMUM, // minimum value
Setting.Property.Dynamic, Setting.Property.NodeScope);
Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.Deprecated);

private MonitoringField() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,38 @@ private DeprecationChecks() {
NodeDeprecationChecks::checkSingleDataNodeWatermarkSetting,
NodeDeprecationChecks::checkExporterUseIngestPipelineSettings,
NodeDeprecationChecks::checkExporterPipelineMasterTimeoutSetting,
NodeDeprecationChecks::checkExporterCreateLegacyTemplateSetting
NodeDeprecationChecks::checkExporterCreateLegacyTemplateSetting,
NodeDeprecationChecks::checkMonitoringSettingHistoryDuration,
NodeDeprecationChecks::checkMonitoringSettingCollectIndexRecovery,
NodeDeprecationChecks::checkMonitoringSettingCollectIndices,
NodeDeprecationChecks::checkMonitoringSettingCollectCcrTimeout,
NodeDeprecationChecks::checkMonitoringSettingCollectEnrichStatsTimeout,
NodeDeprecationChecks::checkMonitoringSettingCollectIndexRecoveryStatsTimeout,
NodeDeprecationChecks::checkMonitoringSettingCollectIndexStatsTimeout,
NodeDeprecationChecks::checkMonitoringSettingCollectMlJobStatsTimeout,
NodeDeprecationChecks::checkMonitoringSettingCollectNodeStatsTimeout,
NodeDeprecationChecks::checkMonitoringSettingCollectClusterStatsTimeout,
NodeDeprecationChecks::checkMonitoringSettingExportersHost,
NodeDeprecationChecks::checkMonitoringSettingExportersBulkTimeout,
NodeDeprecationChecks::checkMonitoringSettingExportersConnectionTimeout,
NodeDeprecationChecks::checkMonitoringSettingExportersConnectionReadTimeout,
NodeDeprecationChecks::checkMonitoringSettingExportersAuthUsername,
NodeDeprecationChecks::checkMonitoringSettingExportersAuthPass,
NodeDeprecationChecks::checkMonitoringSettingExportersSSL,
NodeDeprecationChecks::checkMonitoringSettingExportersProxyBase,
NodeDeprecationChecks::checkMonitoringSettingExportersSniffEnabled,
NodeDeprecationChecks::checkMonitoringSettingExportersHeaders,
NodeDeprecationChecks::checkMonitoringSettingExportersTemplateTimeout,
NodeDeprecationChecks::checkMonitoringSettingExportersMasterTimeout,
NodeDeprecationChecks::checkMonitoringSettingExportersEnabled,
NodeDeprecationChecks::checkMonitoringSettingExportersType,
NodeDeprecationChecks::checkMonitoringSettingExportersAlertsEnabled,
NodeDeprecationChecks::checkMonitoringSettingExportersAlertsBlacklist,
NodeDeprecationChecks::checkMonitoringSettingExportersIndexNameTimeFormat,
NodeDeprecationChecks::checkMonitoringSettingDecommissionAlerts,
NodeDeprecationChecks::checkMonitoringSettingEsCollectionEnabled,
NodeDeprecationChecks::checkMonitoringSettingCollectionEnabled,
NodeDeprecationChecks::checkMonitoringSettingCollectionInterval
);

static List<Function<IndexMetadata, DeprecationIssue>> INDEX_SETTINGS_CHECKS = List.of(
Expand Down
Loading

0 comments on commit 12d10b0

Please sign in to comment.