File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed
x-pack/platform/plugins/shared/dataset_quality/server/services/data_telemetry Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ export function getIndexBasicStats({
241241 ) . pipe (
242242 delay ( breatheDelay ) ,
243243 concatMap ( ( allIndexStats ) => {
244- return from ( getFailureStoreStats ( { esClient, indexNames } ) ) . pipe (
244+ return from ( getFailureStoreStats ( { esClient, indexName : indexNames . join ( ',' ) } ) ) . pipe (
245245 map ( ( allFailureStoreStats ) => {
246246 return indices . map ( ( info ) =>
247247 getIndexStats ( allIndexStats . indices , allFailureStoreStats , info )
@@ -365,23 +365,22 @@ function getIndexNamespace(indexInfo: IndexBasicInfo): string | undefined {
365365
366366async function getFailureStoreStats ( {
367367 esClient,
368- indexNames ,
368+ indexName ,
369369} : {
370370 esClient : ElasticsearchClient ;
371- indexNames : string [ ] ;
371+ indexName : string ;
372372} ) : Promise < IndicesStatsResponse [ 'indices' ] > {
373373 try {
374- const { indices } = await reduceAsyncChunks ( indexNames , ( chunk ) =>
375- esClient . transport . request < ReturnType < typeof esClient . indices . stats > > ( {
376- method : 'GET' ,
377- path : `/${ chunk . join ( ',' ) } /_stats` ,
378- querystring : {
379- failure_store : 'only' ,
380- } ,
381- } )
382- ) ;
383-
384- return indices ;
374+ // TODO: Use the failure store API when it is available
375+ const resp = await esClient . transport . request < ReturnType < typeof esClient . indices . stats > > ( {
376+ method : 'GET' ,
377+ path : `/${ indexName } /_stats` ,
378+ querystring : {
379+ failure_store : 'only' ,
380+ } ,
381+ } ) ;
382+
383+ return ( await resp ) . indices ;
385384 } catch ( e ) {
386385 // Failure store API may not be available
387386 return { } ;
You can’t perform that action at this time.
0 commit comments