Skip to content
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

Change setting's deprecation message wording #80900

Closed
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the deprecation 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
64 changes: 32 additions & 32 deletions docs/reference/monitoring/configuring-metricbeat.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<titleabbrev>Collecting monitoring data with {metricbeat}</titleabbrev>
++++

In 6.5 and later, you can use {metricbeat} to collect data about {es}
and ship it to the monitoring cluster, rather than routing it through exporters
as described in <<collecting-monitoring-data>>.
In 6.5 and later, you can use {metricbeat} to collect data about {es}
and ship it to the monitoring cluster, rather than routing it through exporters
as described in <<collecting-monitoring-data>>.

image::monitoring/images/metricbeat.png[Example monitoring architecture]

Expand All @@ -18,7 +18,7 @@ image::monitoring/images/metricbeat.png[Example monitoring architecture]
--
// tag::enable-collection[]
Set `xpack.monitoring.collection.enabled` to `true` on the
production cluster. By default, it is disabled (`false`).
production cluster. By default, it is disabled (`false`).

You can use the following APIs to review and change this setting:

Expand All @@ -36,9 +36,9 @@ 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[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the deprecation changes documentation for the next major version.]

If {es} {security-features} are enabled, you must have `monitor` cluster privileges to
If {es} {security-features} are enabled, you must have `monitor` cluster privileges to
view the cluster settings and `manage` cluster privileges to change them.
// end::enable-collection[]

Expand Down Expand Up @@ -69,8 +69,8 @@ in the `modules.d` directory, run the following command:
metricbeat modules enable elasticsearch-xpack
----------------------------------------------------------------------

For more information, refer to
{metricbeat-ref}/metricbeat-module-elasticsearch.html[{es} module].
For more information, refer to
{metricbeat-ref}/metricbeat-module-elasticsearch.html[{es} module].
--

. Configure the {es} module in {metricbeat} on each {es} node.
Expand Down Expand Up @@ -107,15 +107,15 @@ configure the endpoint in the `hosts` list not to direct requests to the
dedicated master nodes.

If Elastic {security-features} are enabled, you must also provide a user ID
and password so that {metricbeat} can collect metrics successfully:
and password so that {metricbeat} can collect metrics successfully:

.. Create a user on the production cluster that has the
<<built-in-roles,`remote_monitoring_collector` built-in role>>.
<<built-in-roles,`remote_monitoring_collector` built-in role>>.
Alternatively, use the
<<built-in-users,`remote_monitoring_user` built-in user>>.

.. Add the `username` and `password` settings to the {es} module configuration
file.
file.

.. If TLS is enabled on the HTTP layer of your {es} cluster, you must either use https as the URL scheme in the `hosts` setting or add the `ssl.enabled: true` setting. Depending on the TLS configuration of your {es} cluster, you might also need to specify {metricbeat-ref}/configuration-ssl.html[additional ssl.*] settings.
--
Expand All @@ -138,59 +138,59 @@ metricbeat modules disable system
. Identify where to send the monitoring data.
+
--
TIP: In production environments, we strongly recommend using a separate cluster
(referred to as the _monitoring cluster_) to store the data. Using a separate
monitoring cluster prevents production cluster outages from impacting your
ability to access your monitoring data. It also prevents monitoring activities
TIP: In production environments, we strongly recommend using a separate cluster
(referred to as the _monitoring cluster_) to store the data. Using a separate
monitoring cluster prevents production cluster outages from impacting your
ability to access your monitoring data. It also prevents monitoring activities
from impacting the performance of your production cluster.

For example, specify the {es} output information in the {metricbeat}
For example, specify the {es} output information in the {metricbeat}
configuration file (`metricbeat.yml`):

[source,yaml]
----------------------------------
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["http://es-mon-1:9200", "http://es-mon-2:9200"] <1>

# Optional protocol and basic auth credentials.
#protocol: "https"
#username: "elastic"
#password: "changeme"
----------------------------------
<1> In this example, the data is stored on a monitoring cluster with nodes
`es-mon-1` and `es-mon-2`.
<1> In this example, the data is stored on a monitoring cluster with nodes
`es-mon-1` and `es-mon-2`.

If you configured the monitoring cluster to use encrypted communications, you
must access it via HTTPS. For example, use a `hosts` setting like
`https://es-mon-1:9200`.

IMPORTANT: The {es} {monitor-features} use ingest pipelines, therefore the
cluster that stores the monitoring data must have at least one
<<ingest,ingest node>>.
cluster that stores the monitoring data must have at least one
<<ingest,ingest node>>.

If {es} {security-features} are enabled on the monitoring cluster, you must
provide a valid user ID and password so that {metricbeat} can send metrics
successfully:
provide a valid user ID and password so that {metricbeat} can send metrics
successfully:

.. Create a user on the monitoring cluster that has the
<<built-in-roles,`remote_monitoring_agent` built-in role>>.
Alternatively, use the
.. Create a user on the monitoring cluster that has the
<<built-in-roles,`remote_monitoring_agent` built-in role>>.
Alternatively, use the
<<built-in-users,`remote_monitoring_user` built-in user>>.

.. Add the `username` and `password` settings to the {es} output information in
.. Add the `username` and `password` settings to the {es} output information in
the {metricbeat} configuration file.

For more information about these configuration options, see
For more information about these configuration options, see
{metricbeat-ref}/elasticsearch-output.html[Configure the {es} output].
--

. {metricbeat-ref}/metricbeat-starting.html[Start {metricbeat}] on each node.
. {metricbeat-ref}/metricbeat-starting.html[Start {metricbeat}] on each node.

. Disable the default collection of {es} monitoring metrics.
+
--
Set `xpack.monitoring.elasticsearch.collection.enabled` to `false` on the
Set `xpack.monitoring.elasticsearch.collection.enabled` to `false` on the
production cluster.

You can use the following API to change this setting:
Expand All @@ -204,11 +204,11 @@ 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.]
// TEST[warning:[xpack.monitoring.elasticsearch.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the deprecation 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.
--

. {kibana-ref}/monitoring-data.html[View the monitoring data in {kib}].
. {kibana-ref}/monitoring-data.html[View the monitoring data in {kib}].
4 changes: 2 additions & 2 deletions docs/reference/snapshot-restore/restore-snapshot.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,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[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the deprecation changes documentation for the next major version.]

* Watcher
+
Expand Down Expand Up @@ -462,7 +462,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[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the deprecation changes documentation for the next major version.]
// TEST[s/true/false/]

* Watcher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
* </pre>
*/
public class Setting<T> implements ToXContentObject {
private static final String DEPRECATED_MESSAGE_TEMPLATE =
"[{}] setting was deprecated in Elasticsearch and will be removed in a future release! "
+ "See the %s changes documentation for the next major version.";
private static final String DEPRECATED_WARN_MESSAGE = String.format(Locale.ROOT, DEPRECATED_MESSAGE_TEMPLATE, "deprecation");
private static final String DEPRECATED_CRITICAL_MESSAGE = String.format(Locale.ROOT, DEPRECATED_MESSAGE_TEMPLATE, "breaking");

public enum Property {
/**
Expand Down Expand Up @@ -582,12 +587,20 @@ void checkDeprecation(Settings settings) {
final String key = getKey();
List<String> skipTheseDeprecations = settings.getAsList("deprecation.skip_deprecated_settings");
if (Regex.simpleMatch(skipTheseDeprecations, key) == false) {
String message = "[{}] setting was deprecated in Elasticsearch and will be removed in a future release! "
+ "See the breaking changes documentation for the next major version.";
if (this.isDeprecatedWarningOnly()) {
Settings.DeprecationLoggerHolder.deprecationLogger.warn(DeprecationCategory.SETTINGS, key, message, key);
Settings.DeprecationLoggerHolder.deprecationLogger.warn(
DeprecationCategory.SETTINGS,
key,
DEPRECATED_WARN_MESSAGE,
key
);
} else {
Settings.DeprecationLoggerHolder.deprecationLogger.critical(DeprecationCategory.SETTINGS, key, message, key);
Settings.DeprecationLoggerHolder.deprecationLogger.critical(
DeprecationCategory.SETTINGS,
key,
DEPRECATED_CRITICAL_MESSAGE,
key
);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ protected final void assertSettingDeprecationsAndWarnings(final Setting<?>[] set
String warningMessage = String.format(
Locale.ROOT,
"[%s] setting was deprecated in Elasticsearch and will be "
+ "removed in a future release! See the breaking changes documentation for the next major version.",
+ "removed in a future release! See the deprecation changes documentation for the next major version.",
setting.getKey()
);
return new DeprecationWarning(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void testDoCollect() throws Exception {

assertWarnings(
"[xpack.monitoring.collection.enrich.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."
+ "in a future release! See the deprecation changes documentation for the next major version."
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ public void testSkipExecution() throws Exception {
assertThat(exporter.getExportsCount(), equalTo(1));
assertWarnings(
"[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.",
+ "a future release! See the deprecation changes documentation for the next major version.",
"[xpack.monitoring.collection.interval] setting was deprecated in Elasticsearch and will be removed in "
+ "a future release! See the breaking changes documentation for the next major version."
+ "a future release! See the deprecation changes documentation for the next major version."
);
}

Expand Down