Skip to content

Commit ebd434f

Browse files
committed
update to cover cases when Integration is not brought back yet
1 parent cc24e6e commit ebd434f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/indices_stats_collector.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,13 @@ export const getIndicesStats = async (
8282

8383
const [, cloudDefendPluginStartDeps] = await coreServices;
8484

85-
const { status, latestPackageVersion, installedPackagePolicies, healthyAgents } =
86-
await getCloudDefendStatus({
85+
let status = 'not_installed';
86+
let latestPackageVersion = 'unknown';
87+
let installedPackagePolicies = 0;
88+
let healthyAgents = 0;
89+
90+
try {
91+
const statusResult = await getCloudDefendStatus({
8792
logger,
8893
esClient,
8994
soClient,
@@ -93,6 +98,14 @@ export const getIndicesStats = async (
9398
packageService: cloudDefendPluginStartDeps.fleet.packageService,
9499
});
95100

101+
status = statusResult.status;
102+
latestPackageVersion = statusResult.latestPackageVersion;
103+
installedPackagePolicies = statusResult.installedPackagePolicies;
104+
healthyAgents = statusResult.healthyAgents;
105+
} catch (error) {
106+
logger.warn(`Failed to get cloud defend status: ${error.message}`);
107+
}
108+
96109
return {
97110
alerts,
98111
file,

0 commit comments

Comments
 (0)