Skip to content

Commit fedf8b1

Browse files
authored
Update ccr-stats telemetry device
The ccr-stats API endpoint has been updated in [1]; update the telemetry device and tests to align with the changes introduced. [1] elastic/elasticsearch#34912 Relates #590
1 parent 3606f80 commit fedf8b1

File tree

2 files changed

+236
-182
lines changed

2 files changed

+236
-182
lines changed

esrally/mechanic/telemetry.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -384,15 +384,17 @@ def record(self):
384384

385385
try:
386386
ccr_stats_api_endpoint = "/_ccr/stats"
387-
stats = self.client.transport.perform_request("GET", ccr_stats_api_endpoint, params={"human": "false"})
387+
filter_path = "follow_stats"
388+
stats = self.client.transport.perform_request("GET", ccr_stats_api_endpoint, params={"human": "false",
389+
"filter_path": filter_path})
388390
except elasticsearch.TransportError as e:
389-
msg = "A transport error occurred while collecting CCR stats from the endpoint [{}] on " \
390-
"cluster [{}]".format(ccr_stats_api_endpoint, self.cluster_name)
391+
msg = "A transport error occurred while collecting CCR stats from the endpoint [{}?filter_path={}] on " \
392+
"cluster [{}]".format(ccr_stats_api_endpoint, filter_path, self.cluster_name)
391393
self.logger.exception(msg)
392394
raise exceptions.RallyError(msg)
393395

394-
if "indices" in stats:
395-
for indices in stats["indices"]:
396+
if filter_path in stats and "indices" in stats[filter_path]:
397+
for indices in stats[filter_path]["indices"]:
396398
try:
397399
if self.indices and indices["index"] not in self.indices:
398400
# Skip metrics for indices not part of user supplied whitelist (ccr-stats-indices) in telemetry params.

0 commit comments

Comments
 (0)