Skip to content

Commit b8e513b

Browse files
committed
Add ccs_telemetry documentation
1 parent 49de378 commit b8e513b

File tree

5 files changed

+204
-34
lines changed

5 files changed

+204
-34
lines changed

docs/reference/cluster/stats.asciidoc

Lines changed: 171 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,142 @@ Each repository type may also include other statistics about the repositories of
13071307
13081308
====
13091309

1310+
`ccs`::
1311+
(object) Contains information relating to <<modules-cross-cluster-search, cross-cluster search>> settings and activity in the cluster.
1312+
+
1313+
.Properties of `ccs`
1314+
[%collapsible%open]
1315+
=====
1316+
1317+
1318+
`_search`:::
1319+
(object) Contains telemetry information about the <<modules-cross-cluster-search, cross-cluster searches>> in the cluster.
1320+
+
1321+
.Properties of `_search`
1322+
[%collapsible%open]
1323+
======
1324+
`total`:::
1325+
(integer) The total number of cross-cluster search requests that have been executed by the cluster.
1326+
1327+
`success`:::
1328+
(integer) The total number of cross-cluster search requests that have been successfully executed by the cluster.
1329+
1330+
`skipped`:::
1331+
(integer) The total number of cross-cluster search requests that had at least one remote cluster skipped.
1332+
1333+
`took`:::
1334+
(object) Contains statistics about the time taken to execute cross-cluster search requests.
1335+
+
1336+
.Properties of `took`
1337+
[%collapsible%open]
1338+
=======
1339+
`max`:::
1340+
(integer) The maximum time taken to execute a cross-cluster search request, in milliseconds.
1341+
1342+
`avg`:::
1343+
(integer) The median time taken to execute a cross-cluster search request, in milliseconds.
1344+
1345+
`p90`:::
1346+
(integer) The 90th percentile of the time taken to execute cross-cluster search requests, in milliseconds.
1347+
=======
1348+
1349+
`took_mrt_true`::
1350+
(object) Contains statistics about the time taken to execute cross-cluster search requests for which the
1351+
<<ccs-minimize-roundtrips,`ccs_minimize_roundtrips`>> setting was set to `true`.
1352+
+
1353+
.Properties of `took_mrt_true`
1354+
[%collapsible%open]
1355+
=======
1356+
`max`:::
1357+
(integer) The maximum time taken to execute a cross-cluster search request, in milliseconds.
1358+
1359+
`avg`:::
1360+
(integer) The median time taken to execute a cross-cluster search request, in milliseconds.
1361+
1362+
`p90`:::
1363+
(integer) The 90th percentile of the time taken to execute cross-cluster search requests, in milliseconds.
1364+
=======
1365+
1366+
`took_mrt_false`::
1367+
(object) Contains statistics about the time taken to execute cross-cluster search requests for which the
1368+
<<ccs-minimize-roundtrips,`ccs_minimize_roundtrips`>> setting was set to `false`.
1369+
+
1370+
.Properties of `took_mrt_false`
1371+
[%collapsible%open]
1372+
=======
1373+
`max`:::
1374+
(integer) The maximum time taken to execute a cross-cluster search request, in milliseconds.
1375+
1376+
`avg`:::
1377+
(integer) The median time taken to execute a cross-cluster search request, in milliseconds.
1378+
1379+
`p90`:::
1380+
(integer) The 90th percentile of the time taken to execute cross-cluster search requests, in milliseconds.
1381+
=======
1382+
1383+
`remotes_per_search_max`::
1384+
(integer) The maximum number of remote clusters that were queried in a single cross-cluster search request.
1385+
1386+
`remotes_per_search_avg`::
1387+
(integer) The average number of remote clusters that were queried in a single cross-cluster search request.
1388+
1389+
`failure_reasons`::
1390+
(object) Contains statistics about the reasons for cross-cluster search request failures.
1391+
The keys are the failure reasons names and the values are the number of requests that failed for that reason.
1392+
1393+
`features`::
1394+
(object) Contains statistics about the features used in cross-cluster search requests. The keys are the names of the search feature,
1395+
and the values are the number of requests that used that feature. Single request can use more than one feature
1396+
(e.g. both `async` and `wildcard`). Known features are:
1397+
1398+
* `async` - <<async-search, Async search>>
1399+
1400+
* `mrt` - <<ccs-minimize-roundtrips,`ccs_minimize_roundtrips`>> setting was set to `true`.
1401+
1402+
* `wildcard` - <<api-multi-index,Multi-target syntax>> for indices with wildcards was used in the search request.
1403+
1404+
`clients`::
1405+
(object) Contains statistics about the clients that executed cross-cluster search requests.
1406+
The keys are the names of the clients, and the values are the number of requests that were executed by that client.
1407+
Only known clients (such as `kibana` or `elasticsearch`) are counted.
1408+
1409+
`clusters`::
1410+
(object) Contains statistics about the clusters that were queried in cross-cluster search requests.
1411+
The keys are cluster names, and the values are per-cluster telemetry data.
1412+
This also includes the local cluster itself, which uses the name `(local)`.
1413+
+
1414+
.Properties of per-cluster data:
1415+
[%collapsible%open]
1416+
=======
1417+
`total`:::
1418+
(integer) The total number of successful (not skipped) cross-cluster search requests that were executed against this cluster.
1419+
This may include requests where partial results were returned, but not requests in which the cluster has been skipped entirely.
1420+
1421+
`skipped`:::
1422+
(integer) The total number of cross-cluster search requests for which this cluster was skipped.
1423+
1424+
`took`:::
1425+
(object) Contains statistics about the time taken to execute requests against this cluster.
1426+
+
1427+
.Properties of `took`
1428+
[%collapsible%open]
1429+
========
1430+
`max`:::
1431+
(integer) The maximum time taken to execute a cross-cluster search request, in milliseconds.
1432+
1433+
`avg`:::
1434+
(integer) The median time taken to execute a cross-cluster search request, in milliseconds.
1435+
1436+
`p90`:::
1437+
(integer) The 90th percentile of the time taken to execute cross-cluster search requests, in milliseconds.
1438+
========
1439+
1440+
=======
1441+
1442+
======
1443+
1444+
=====
1445+
13101446
[[cluster-stats-api-example]]
13111447
==== {api-examples-title}
13121448

@@ -1607,7 +1743,35 @@ The API returns the following response:
16071743
},
16081744
"repositories": {
16091745
...
1610-
}
1746+
},
1747+
"ccs": {
1748+
"_search": {
1749+
"total": 7,
1750+
"success": 7,
1751+
"skipped": 0,
1752+
"took": {
1753+
"max": 36,
1754+
"avg": 20,
1755+
"p90": 33
1756+
},
1757+
"took_mrt_true": {
1758+
"max": 33,
1759+
"avg": 15,
1760+
"p90": 33
1761+
},
1762+
"took_mrt_false": {
1763+
"max": 36,
1764+
"avg": 26,
1765+
"p90": 36
1766+
},
1767+
"remotes_per_search_max": 3,
1768+
"remotes_per_search_avg": 2.0,
1769+
"failure_reasons": { ... },
1770+
"features": { ... },
1771+
"clients": { ... },
1772+
"clusters": { ... }
1773+
}
1774+
}
16111775
}
16121776
--------------------------------------------------
16131777
// TESTRESPONSE[s/"plugins": \[[^\]]*\]/"plugins": $body.$_path/]
@@ -1618,10 +1782,15 @@ The API returns the following response:
16181782
// TESTRESPONSE[s/"packaging_types": \[[^\]]*\]/"packaging_types": $body.$_path/]
16191783
// TESTRESPONSE[s/"snapshots": \{[^\}]*\}/"snapshots": $body.$_path/]
16201784
// TESTRESPONSE[s/"repositories": \{[^\}]*\}/"repositories": $body.$_path/]
1785+
// TESTRESPONSE[s/"clusters": \{[^\}]*\}/"clusters": $body.$_path/]
1786+
// TESTRESPONSE[s/"features": \{[^\}]*\}/"features": $body.$_path/]
1787+
// TESTRESPONSE[s/"clients": \{[^\}]*\}/"clients": $body.$_path/]
1788+
// TESTRESPONSE[s/"failure_reasons": \{[^\}]*\}/"failure_reasons": $body.$_path/]
16211789
// TESTRESPONSE[s/"field_types": \[[^\]]*\]/"field_types": $body.$_path/]
16221790
// TESTRESPONSE[s/"runtime_field_types": \[[^\]]*\]/"runtime_field_types": $body.$_path/]
16231791
// TESTRESPONSE[s/"search": \{[^\}]*\}/"search": $body.$_path/]
1624-
// TESTRESPONSE[s/: true|false/: $body.$_path/]
1792+
// TESTRESPONSE[s/"remotes_per_search_avg": [.0-9]+/"remotes_per_search_avg": $body.$_path/]
1793+
// TESTRESPONSE[s/: (true|false)/: $body.$_path/]
16251794
// TESTRESPONSE[s/: (\-)?[0-9]+/: $body.$_path/]
16261795
// TESTRESPONSE[s/: "[^"]*"/: $body.$_path/]
16271796
// These replacements do a few things:

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ static TransportVersion def(int id) {
207207
public static final TransportVersion UNASSIGNED_PRIMARY_COUNT_ON_CLUSTER_HEALTH = def(8_737_00_0);
208208
public static final TransportVersion ESQL_AGGREGATE_EXEC_TRACKS_INTERMEDIATE_ATTRS = def(8_738_00_0);
209209

210-
211210
public static final TransportVersion CCS_TELEMETRY_STATS = def(8_733_00_0);
212211
/*
213212
* STOP! READ THIS FIRST! No, really,

server/src/main/java/org/elasticsearch/action/admin/cluster/stats/CCSUsageTelemetry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public static class PerClusterCCSTelemetry {
175175
// The number of successful (not skipped) requests to this cluster.
176176
private final LongAdder count;
177177
private final LongAdder skippedCount;
178-
// This is only over the successful requetss, skipped ones do not count here.
178+
// This is only over the successful requests, skipped ones do not count here.
179179
private final LongMetric took;
180180

181181
PerClusterCCSTelemetry(String clusterAlias) {

server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsResponse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
136136
repositoryUsageStats.toXContent(builder, params);
137137

138138
if (CCS_TELEMETRY_FEATURE_FLAG.isEnabled()) {
139+
builder.startObject("ccs");
139140
ccsMetrics.toXContent(builder, params);
141+
builder.endObject();
140142
}
141143

142144
return builder;

x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -755,37 +755,37 @@ public void testToXContent() throws IOException {
755755
"repositories": {}
756756
},
757757
"repositories": {},
758-
"ccs_telemetry": {
759-
"total": 0,
760-
"success": 0,
761-
"skipped": 0,
762-
"took": {
763-
"max": 0,
764-
"avg": 0,
765-
"p90": 0
766-
},
767-
"took_mrt_true": {
768-
"max": 0,
769-
"avg": 0,
770-
"p90": 0
771-
},
772-
"took_mrt_false": {
773-
"max": 0,
774-
"avg": 0,
775-
"p90": 0
776-
},
777-
"remotes_per_search_max": 0,
778-
"remotes_per_search_avg": 0.0,
779-
"failure_reasons": {
780-
},
781-
"features": {
782-
},
783-
"clients": {
784-
},
785-
"clusters": {
786-
"count": 0
758+
"ccs": {
759+
"_search": {
760+
"total": 0,
761+
"success": 0,
762+
"skipped": 0,
763+
"took": {
764+
"max": 0,
765+
"avg": 0,
766+
"p90": 0
767+
},
768+
"took_mrt_true": {
769+
"max": 0,
770+
"avg": 0,
771+
"p90": 0
772+
},
773+
"took_mrt_false": {
774+
"max": 0,
775+
"avg": 0,
776+
"p90": 0
777+
},
778+
"remotes_per_search_max": 0,
779+
"remotes_per_search_avg": 0.0,
780+
"failure_reasons": {
781+
},
782+
"features": {
783+
},
784+
"clients": {
785+
},
786+
"clusters": {}
787787
}
788-
}
788+
}
789789
},
790790
"cluster_state": {
791791
"nodes_hash": 1314980060,

0 commit comments

Comments
 (0)