Skip to content

Commit 12ca461

Browse files
committed
Reverts back to using callCluster to get the cluster info in stats route
1 parent ce3a9a0 commit 12ca461

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • src/plugins/usage_collection/server/routes

src/plugins/usage_collection/server/routes/stats.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ export function registerStatsRoute({
7070
return collectorSet.toObject(usage);
7171
};
7272

73-
const getClusterUuid = async (esClient: ElasticsearchClient): Promise<string> => {
74-
const result = await esClient.info<{ cluster_uuid: string }>();
75-
const { cluster_uuid: uuid } = result.body;
73+
const getClusterUuid = async (callCluster: LegacyAPICaller): Promise<string> => {
74+
const { cluster_uuid: uuid } = await callCluster('info', { filterPath: 'cluster_uuid' });
7675
return uuid;
7776
};
7877

@@ -109,7 +108,7 @@ export function registerStatsRoute({
109108
}
110109

111110
const usagePromise = shouldGetUsage ? getUsage(callCluster, esClient) : Promise.resolve({});
112-
const [usage, clusterUuid] = await Promise.all([usagePromise, getClusterUuid(esClient)]);
111+
const [usage, clusterUuid] = await Promise.all([usagePromise, getClusterUuid(callCluster)]);
113112

114113
let modifiedUsage = usage;
115114
if (isLegacy) {

0 commit comments

Comments
 (0)