Skip to content

Commit 09520b5

Browse files
authored
[DOCS] Describe how to use Elastic Agent to monitor Elasticsearch (#94348) (#94754)
* [DOCS] Describe how to use Elastic Agent to monitor Elasticsearch * Temporarily fix doc build * Add question about showing Elastic Agent metrics in the monitoring UI * Apply changes from review * Activate link to Kibana docs * Fix broken link * Update docs/reference/monitoring/indices.asciidoc (cherry picked from commit a6c7c1f)
1 parent 6571e51 commit 09520b5

14 files changed

+167
-85
lines changed

docs/reference/monitoring/collecting-monitoring-data.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
include::{es-ref-dir}/settings/monitoring-settings.asciidoc[tag=monitoring-deprecation-notice]
99

1010
This method for collecting metrics about {es} involves sending the metrics to
11-
the monitoring cluster by using exporters. For the recommended method, see <<configuring-metricbeat>>.
11+
the monitoring cluster by using exporters.
1212

1313
Advanced monitoring settings enable you to control how frequently data is
1414
collected, configure timeouts, and set the retention period for locally-stored

docs/reference/monitoring/collectors.asciidoc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,7 @@
22
[[es-monitoring-collectors]]
33
== Collectors
44

5-
[IMPORTANT]
6-
=========================
7-
{metricbeat} is the recommended method for collecting and shipping monitoring
8-
data to a monitoring cluster.
9-
10-
If you have previously configured legacy collection methods, you should migrate
11-
to using {metricbeat} collection methods. Use either {metricbeat} collection or
12-
legacy collection methods; do not use both.
13-
14-
Learn more about <<configuring-metricbeat>>.
15-
=========================
5+
include::production.asciidoc[tag=monitoring-rec]
166

177
Collectors, as their name implies, collect things. Each collector runs once for
188
each collection interval to obtain data from the public APIs in {es} and {xpack}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
[[configuring-elastic-agent]]
2+
== Collecting {es} monitoring data with {agent}
3+
4+
[subs="attributes"]
5+
++++
6+
<titleabbrev>Collecting monitoring data with {agent}</titleabbrev>
7+
++++
8+
9+
In 8.5 and later, you can use {agent} to collect data about {es} and ship it to
10+
the monitoring cluster, rather than <<configuring-metricbeat,using {metricbeat}>>
11+
or routing it through exporters as described in <<collecting-monitoring-data>>.
12+
13+
[discrete]
14+
=== Prerequisites
15+
16+
* (Optional) Create a monitoring cluster as described in <<monitoring-production>>.
17+
18+
* Create a user on the production cluster that has the
19+
`remote_monitoring_collector` {ref}/built-in-roles.html[built-in role].
20+
21+
[discrete]
22+
=== Add {es} monitoring data
23+
24+
To collect {es} monitoring data, add an {es} integration to an {agent} and
25+
deploy it to the host where {es} is running.
26+
27+
. Go to the {kib} home page and click **Add integrations**.
28+
. In the query bar, search for and select the **{es}** integration for
29+
{agent}.
30+
. Read the overview to make sure you understand integration requirements and
31+
other considerations.
32+
. Click **Add Elasticsearch**.
33+
+
34+
TIP: If you're installing an integration for the first time, you may be prompted
35+
to install {agent}. Click **Add integration only (skip agent installation)**.
36+
37+
. Configure the integration name and optionally add a description. Make sure you
38+
configure all required settings:
39+
.. Under **Collect Elasticsearch logs**, modify the log paths to match your {es}
40+
environment.
41+
.. Under **Collect Elasticsearch metrics**, make sure the hosts setting points to
42+
your {es} host URLs. By default, the integration collects {es} monitoring
43+
metrics from `localhost:9200`. If that host and port number are not correct,
44+
update the `hosts` setting. If you configured {es} to use encrypted
45+
communications, you must access it via HTTPS. For example, use a `hosts` setting
46+
like `https://localhost:9200`.
47+
.. Expand **Advanced options**. If the Elastic {security-features} are enabled,
48+
enter the username and password of a user that has the
49+
`remote_monitoring_collector` role.
50+
.. Specify the scope:
51+
** Specify `cluster` if each entry in the hosts list indicates a single
52+
endpoint for a distinct {es} cluster (for example, a load-balancing proxy
53+
fronting the cluster that directs requests to the master-ineligible nodes in the
54+
cluster).
55+
** Otherwise, accept the default scope, `node`. If this scope is set, you
56+
will need to install {agent} on each {es} node to collect all metrics. {agent}
57+
will collect most of the metrics from the elected master of the cluster, so you
58+
must scale up all your master-eligible nodes to account for this extra load. Do
59+
not use this `node` if you have dedicated master nodes.
60+
. Choose where to add the integration policy. Click **New hosts** to add it to
61+
new agent policy or **Existing hosts** to add it to an existing agent policy.
62+
. Click **Save and continue**. This step takes a minute or two to complete. When
63+
it's done, you'll have an agent policy that contains an integration for
64+
collecting monitoring data from {es}.
65+
. If an {agent} is already assigned to the policy and deployed to the host where
66+
{es} is running, you're done. Otherwise, you need to deploy an {agent}. To
67+
deploy an {agent}:
68+
.. Go to **{fleet} -> Agents**, then click **Add agent**.
69+
.. Follow the steps in the **Add agent** flyout to download, install,
70+
and enroll the {agent}. Make sure you choose the agent policy you created
71+
earlier.
72+
. Wait a minute or two until incoming data is confirmed.
73+
. {kibana-ref}/monitoring-data.html[View the monitoring data in {kib}].

docs/reference/monitoring/configuring-filebeat.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ You can use {filebeat} to monitor the {es} log files, collect log events, and
1111
ship them to the monitoring cluster. Your recent logs are visible on the
1212
*Monitoring* page in {kib}.
1313

14+
IMPORTANT: If you're using {agent}, do not deploy {filebeat} for log collection.
15+
Instead, configure the {es} integration to collect logs.
16+
1417
//NOTE: The tagged regions are re-used in the Stack Overview.
1518

1619
. Verify that {es} is running and that the monitoring cluster is ready to

docs/reference/monitoring/configuring-metricbeat.asciidoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
In 6.5 and later, you can use {metricbeat} to collect data about {es}
1111
and ship it to the monitoring cluster, rather than routing it through exporters
12-
as described in <<collecting-monitoring-data>>.
12+
as described in <<collecting-monitoring-data>>.
13+
14+
Want to use {agent} instead? Refer to <<configuring-elastic-agent>>.
1315

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

docs/reference/monitoring/exporters.asciidoc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,7 @@
22
[[es-monitoring-exporters]]
33
== Exporters
44

5-
[IMPORTANT]
6-
=========================
7-
{metricbeat} is the recommended method for collecting and shipping monitoring
8-
data to a monitoring cluster.
9-
10-
If you have previously configured legacy collection methods, you should migrate
11-
to using {metricbeat} collection methods. Use either {metricbeat} collection or
12-
legacy collection methods; do not use both.
13-
14-
Learn more about <<configuring-metricbeat>>.
15-
=========================
5+
include::production.asciidoc[tag=monitoring-rec]
166

177
The purpose of exporters is to take data collected from any Elastic Stack
188
source and route it to the monitoring cluster. It is possible to configure

docs/reference/monitoring/how-monitoring-works.asciidoc

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,41 @@
55
<titleabbrev>How it works</titleabbrev>
66
++++
77

8-
Each {es} node, {ls} node, {kib} instance, and Beat instance is considered
9-
unique in the cluster based on its persistent UUID, which is written to the
10-
<<path-settings,`path.data`>> directory when the node or instance starts.
8+
Each monitored {stack} component is considered unique in the cluster based on
9+
its persistent UUID, which is written to the <<path-settings,`path.data`>>
10+
directory when the node or instance starts.
1111

1212
Monitoring documents are just ordinary JSON documents built by monitoring each
13-
{stack} component at a specified collection interval. If you want to alter the
14-
templates for these indices, see <<config-monitoring-indices>>.
13+
{stack} component at a specified collection interval. If you want to alter how
14+
these documents are structured or stored, refer to <<config-monitoring-indices>>.
1515

16-
{metricbeat} is used to collect monitoring data and to ship it directly to the
17-
monitoring cluster.
16+
You can use {agent} or {metricbeat} to collect monitoring data and to ship it
17+
directly to the monitoring cluster.
1818

19-
To learn how to collect monitoring data, see:
19+
To learn how to collect monitoring data, refer to:
2020

21-
* <<collecting-monitoring-data>>
22-
* <<configuring-metricbeat>>
21+
* One of the following topics depending on how you want to collect monitoring
22+
data from {es}:
23+
** <<configuring-elastic-agent>>: Uses a single agent to
24+
gather logs and metrics. Can be managed from a central location in {fleet}.
25+
** <<configuring-metricbeat>>: Uses a lightweight {beats}
26+
shipper to gather metrics. May be preferred if you have an existing investment
27+
in {beats} or are not yet ready to use {agent}.
28+
** <<collecting-monitoring-data>>: Uses internal exporters to
29+
gather metrics. Not recommended. If you have previously configured legacy
30+
collection methods, you should migrate to using {agent} or {metricbeat}.
2331
* {kibana-ref}/xpack-monitoring.html[Monitoring {kib}]
2432
* {logstash-ref}/configuring-logstash.html[Monitoring {ls}]
25-
* Monitoring Beats:
33+
* {enterprise-search-ref}/monitoring.html[Monitoring {ents}]
34+
* Monitoring {beats}:
2635
** {auditbeat-ref}/monitoring.html[{auditbeat}]
2736
** {filebeat-ref}/monitoring.html[{filebeat}]
2837
** {functionbeat-ref}/monitoring.html[{functionbeat}]
2938
** {heartbeat-ref}/monitoring.html[{heartbeat}]
3039
** {metricbeat-ref}/monitoring.html[{metricbeat}]
3140
** {packetbeat-ref}/monitoring.html[{packetbeat}]
3241
** {winlogbeat-ref}/monitoring.html[{winlogbeat}]
42+
* {apm-guide-ref}/monitor-apm.html[Monitoring APM Server]
43+
* {fleet-guide}/monitor-elastic-agent.html[Monitoring {agent}s]
44+
{fleet}-managed agents) or
45+
{fleet-guide}/elastic-agent-monitoring-configuration.html[Configure monitoring for standalone {agent}s]

docs/reference/monitoring/http-export.asciidoc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,7 @@
22
[[http-exporter]]
33
=== HTTP exporters
44

5-
[IMPORTANT]
6-
=========================
7-
{metricbeat} is the recommended method for collecting and shipping monitoring
8-
data to a monitoring cluster.
9-
10-
If you have previously configured legacy collection methods, you should migrate
11-
to using {metricbeat} collection methods. Use either {metricbeat} collection or
12-
legacy collection methods; do not use both.
13-
14-
Learn more about <<configuring-metricbeat>>.
15-
=========================
5+
include::production.asciidoc[tag=monitoring-rec]
166

177
The `http` exporter is the preferred exporter in the {es} {monitor-features}
188
because it enables the use of a separate monitoring cluster. As a secondary

docs/reference/monitoring/index.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ performance of your {es} cluster.
1010
* <<monitoring-overview>>
1111
* <<how-monitoring-works>>
1212
* <<monitoring-production>>
13+
* <<configuring-elastic-agent>>
1314
* <<configuring-metricbeat>>
1415
* <<configuring-filebeat>>
1516
* <<config-monitoring-indices>>
@@ -24,6 +25,8 @@ include::how-monitoring-works.asciidoc[]
2425

2526
include::production.asciidoc[]
2627

28+
include::configuring-elastic-agent.asciidoc[]
29+
2730
include::configuring-metricbeat.asciidoc[]
2831

2932
include::configuring-filebeat.asciidoc[]

docs/reference/monitoring/indices.asciidoc

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,27 @@
22
[[config-monitoring-indices]]
33
== Configuring indices for monitoring
44

5-
<<indices-templates-v1,Index templates>> are used to configure the indices
6-
that store the monitoring data collected from a cluster.
5+
Sometimes the default index settings might not work for your situation. For
6+
example, you might want to change index lifecycle management (ILM) settings,
7+
add custom mappings, or set the number of shards and replicas
8+
for the monitoring indices.
9+
10+
You can change the default behavior. The steps you follow depend on which data
11+
collection method is used.
12+
13+
[float]
14+
=== Configuring data streams created by {agent}
15+
16+
{agent} uses data streams to store time series data across multiple indices
17+
while giving you a single named resource for requests. You can alter the
18+
settings of each dataset by configuring an `@custom` component template.
19+
For more information, refer to {fleet-guide}/data-streams.html[Data streams].
20+
21+
[float]
22+
=== Configuring indices created by {metricbeat}
23+
24+
<<indices-templates-v1,Index templates>> are used to configure the indices that
25+
store the monitoring data that {metricbeat} collects from a cluster.
726

827
You can retrieve the templates through the `_template` API:
928

@@ -32,7 +51,8 @@ PUT /_index_template/custom_monitoring
3251
".monitoring-beats-8-*",
3352
".monitoring-es-8-*",
3453
".monitoring-kibana-8-*",
35-
".monitoring-logstash-8-*"
54+
".monitoring-logstash-8-*",
55+
".monitoring-ent-search-8-*"
3656
],
3757
"priority": 1,
3858
"template": {

0 commit comments

Comments
 (0)