Skip to content

Commit 08dfe36

Browse files
committed
bring back old version of getFailureStoreStats
1 parent be79c5c commit 08dfe36

File tree

1 file changed

+13
-14
lines changed
  • x-pack/platform/plugins/shared/dataset_quality/server/services/data_telemetry

1 file changed

+13
-14
lines changed

x-pack/platform/plugins/shared/dataset_quality/server/services/data_telemetry/helpers.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff 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

366366
async 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 {};

0 commit comments

Comments
 (0)