Skip to content

Commit

Permalink
Report agentless uage via telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenIdo authored Oct 16, 2024
1 parent 983a3e5 commit 8787fd8
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
SO_SEARCH_LIMIT,
} from '@kbn/fleet-plugin/common';
import { agentPolicyService } from '@kbn/fleet-plugin/server/services';
import { AGENTLESS_POLICY_ID } from '@kbn/fleet-plugin/common/constants';
import type {
CloudbeatConfigKeyType,
CloudSecurityInstallationStats,
Expand Down Expand Up @@ -100,10 +99,12 @@ const getInstalledPackagePolicies = (
const installationStats = packagePolicies.flatMap(
(packagePolicy: PackagePolicy): CloudSecurityInstallationStats[] =>
packagePolicy.policy_ids.map((agentPolicyId) => {
const agentCounts =
agentPolicies?.find((agentPolicy) => agentPolicy?.id === agentPolicyId)?.agents ?? 0;
const matchedAgentPolicy = agentPolicies?.find(
(agentPolicy) => agentPolicy?.id === agentPolicyId
);

const isAgentless = agentPolicyId === AGENTLESS_POLICY_ID;
const agentCounts = matchedAgentPolicy?.agents || 0;
const isAgentless = !!matchedAgentPolicy?.supports_agentless;

const isSetupAutomatic = getEnabledIsSetupAutomatic(packagePolicy);

Expand Down

0 comments on commit 8787fd8

Please sign in to comment.