mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[OsQuery] fix usage collector when .fleet indices are empty (#102977)
This commit is contained in:
parent
c6e697f38c
commit
a6bef93225
1 changed files with 3 additions and 0 deletions
|
@ -56,6 +56,7 @@ export async function getPolicyLevelUsage(
|
|||
},
|
||||
},
|
||||
index: '.fleet-agents',
|
||||
ignore_unavailable: true,
|
||||
});
|
||||
const policied = agentResponse.body.aggregations?.policied as AggregationsSingleBucketAggregate;
|
||||
if (policied && typeof policied.doc_count === 'number') {
|
||||
|
@ -118,6 +119,7 @@ export async function getLiveQueryUsage(
|
|||
},
|
||||
},
|
||||
index: '.fleet-actions',
|
||||
ignore_unavailable: true,
|
||||
});
|
||||
const result: LiveQueryUsage = {
|
||||
session: await getRouteMetric(soClient, 'live_query'),
|
||||
|
@ -226,6 +228,7 @@ export async function getBeatUsage(esClient: ElasticsearchClient) {
|
|||
},
|
||||
},
|
||||
index: METRICS_INDICES,
|
||||
ignore_unavailable: true,
|
||||
});
|
||||
|
||||
return extractBeatUsageMetrics(metricResponse);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue