Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OsQuery] fix usage collector when .fleet indices are empty #102977

Merged
merged 2 commits into from
Jun 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions x-pack/plugins/osquery/server/usage/fetchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -118,6 +119,7 @@ export async function getLiveQueryUsage(
},
},
index: '.fleet-actions',
ignore_unavailable: true,
});
const result: LiveQueryUsage = {
session: await getRouteMetric(soClient, 'live_query'),
Expand Down Expand Up @@ -226,6 +228,7 @@ export async function getBeatUsage(esClient: ElasticsearchClient) {
},
},
index: METRICS_INDICES,
ignore_unavailable: true,
});

return extractBeatUsageMetrics(metricResponse);
Expand Down