mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
use ecs properties in fetch_index_shard_size
This commit is contained in:
parent
63759503b4
commit
cdf8b2493e
2 changed files with 11 additions and 4 deletions
|
@ -186,6 +186,7 @@ describe('fetchIndexShardSize', () => {
|
|||
'_index',
|
||||
'index_stats.shards.primaries',
|
||||
'index_stats.primaries.store.size_in_bytes',
|
||||
'elasticsearch.index.shards.primaries',
|
||||
'elasticsearch.index.primaries.store.size_in_bytes',
|
||||
],
|
||||
},
|
||||
|
|
|
@ -90,6 +90,7 @@ export async function fetchIndexShardSize(
|
|||
'_index',
|
||||
'index_stats.shards.primaries',
|
||||
'index_stats.primaries.store.size_in_bytes',
|
||||
'elasticsearch.index.shards.primaries',
|
||||
'elasticsearch.index.primaries.store.size_in_bytes',
|
||||
],
|
||||
},
|
||||
|
@ -134,15 +135,20 @@ export async function fetchIndexShardSize(
|
|||
}
|
||||
const {
|
||||
_index: monitoringIndexName,
|
||||
_source: { index_stats: indexStats },
|
||||
_source: { index_stats: indexStats, elasticsearch },
|
||||
} = topHit;
|
||||
|
||||
if (!indexStats || !indexStats.primaries) {
|
||||
const isLegacy = !!(indexStats && indexStats.primaries);
|
||||
const isMb = !!(elasticsearch && elasticsearch.index);
|
||||
|
||||
if (!isLegacy && !isMb) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const { primaries: totalPrimaryShards } = indexStats.shards;
|
||||
const { size_in_bytes: primaryShardSizeBytes = 0 } = indexStats.primaries.store || {};
|
||||
const { primaries: totalPrimaryShards } =
|
||||
indexStats?.shards || elasticsearch?.index?.shards || {};
|
||||
const { size_in_bytes: primaryShardSizeBytes = 0 } =
|
||||
indexStats?.primaries?.store || elasticsearch?.index?.primaries?.store || {};
|
||||
if (!primaryShardSizeBytes || !totalPrimaryShards) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue