Skip to content

Commit fb03fea

Browse files
committed
Add docs for the include_remotes part
1 parent 172c473 commit fb03fea

File tree

2 files changed

+88
-1
lines changed

2 files changed

+88
-1
lines changed

docs/reference/cluster/stats.asciidoc

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ If a node does not respond before its timeout expires, the response does not inc
4040
However, timed out nodes are included in the response's `_nodes.failed` property.
4141
Defaults to no timeout.
4242

43+
`include_remotes`::
44+
(Optional, Boolean) If `true`, includes remote cluster information in the response.
45+
Defaults to no remote cluster information.
46+
4347
[role="child_attributes"]
4448
[[cluster-stats-api-response-body]]
4549
==== {api-response-body-title}
@@ -1314,6 +1318,56 @@ Each repository type may also include other statistics about the repositories of
13141318
[%collapsible%open]
13151319
=====
13161320
1321+
`clusters`:::
1322+
(object) Contains remote cluster settings and metrics collected from them. Only present if `include_remotes` option is
1323+
set to `true` and there are any remote clusters configured. If the node filter is specified, it will be passed
1324+
to the remote clusters.
1325+
The keys are cluster names, and the values are per-cluster data.
1326+
1327+
+
1328+
.Properties of `clusters`
1329+
[%collapsible%open]
1330+
======
1331+
`cluster_uuid`:::
1332+
(string) The UUID of the remote cluster.
1333+
1334+
`mode`:::
1335+
(string) The <<sniff-proxy-modes, connection mode>> used to communicate with the remote cluster.
1336+
1337+
`skip_unavailable`:::
1338+
(Boolean) The `skip_unavailable` <<skip-unavailable-clusters, setting>> used for this remote cluster.
1339+
1340+
`transport.compress`:::
1341+
(string) Transport compression setting used for this remote cluster.
1342+
1343+
`version`:::
1344+
(array of strings) The list of {es} versions used by the nodes on the remote cluster.
1345+
1346+
`status`:::
1347+
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=cluster-health-status]
1348+
+
1349+
See <<cluster-health>>.
1350+
1351+
`nodes_count`:::
1352+
(integer) The total count of nodes in the remote cluster.
1353+
1354+
`shards_count`:::
1355+
(integer) The total number of shards in the remote cluster.
1356+
1357+
`indices_count`:::
1358+
(integer) The total number of indices in the remote cluster.
1359+
1360+
`indices_total_size_bytes`:::
1361+
(integer) Total data set size, in bytes, of all shards assigned to selected nodes.
1362+
1363+
`max_heap_bytes`:::
1364+
(integer) Maximum amount of memory, in bytes, available for use by the heap across the nodes of the remote cluster.
1365+
1366+
`mem_total_bytes`:::
1367+
(string) Total amount, in bytes, of physical memory across the nodes of the remote cluster.
1368+
1369+
======
1370+
13171371
13181372
`_search`:::
13191373
(object) Contains the telemetry information about the <<modules-cross-cluster-search, {ccs}>> usage in the cluster.
@@ -1812,3 +1866,36 @@ This API can be restricted to a subset of the nodes using <<cluster-nodes,node f
18121866
--------------------------------------------------
18131867
GET /_cluster/stats/nodes/node1,node*,master:false
18141868
--------------------------------------------------
1869+
1870+
This API call will return data about the remote clusters if any are configured:
1871+
1872+
[source,console]
1873+
--------------------------------------------------
1874+
GET /_cluster/stats?include_remotes=true
1875+
--------------------------------------------------
1876+
The resulting response will contain the `ccs` object with information about the remote clusters:
1877+
1878+
[source, js]
1879+
--------------------------------------------------
1880+
{
1881+
"ccs": {
1882+
"clusters": {
1883+
"remote_cluster": {
1884+
"cluster_uuid": "YjAvIhsCQ9CbjWZb2qJw3Q",
1885+
"mode": "sniff",
1886+
"skip_unavailable": false,
1887+
"transport.compress": "true",
1888+
"version": ["8.16.0"],
1889+
"status": "green",
1890+
"nodes_count": 10,
1891+
"shards_count": 420,
1892+
"indices_count": 10,
1893+
"indices_total_size_bytes": 6232658362,
1894+
"max_heap_bytes": 1037959168,
1895+
"mem_total_bytes": 137438953472
1896+
}
1897+
}
1898+
}
1899+
}
1900+
--------------------------------------------------
1901+
// TESTRESPONSE[skip:TODO]

server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStatsAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public String getName() {
4242
@Override
4343
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
4444
ClusterStatsRequest clusterStatsRequest = new ClusterStatsRequest(
45-
request.paramAsBoolean("remotes", false),
45+
request.paramAsBoolean("include_remotes", false),
4646
request.paramAsStringArray("nodeId", null)
4747
);
4848
clusterStatsRequest.timeout(getTimeout(request));

0 commit comments

Comments
 (0)