File tree Expand file tree Collapse file tree
src/plugins/usage_collection/server/routes Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments