diff --git a/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts b/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts index 05ed45a0e0c7a..e12de62564037 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts @@ -69,6 +69,7 @@ export async function _installPackage({ installSource: InstallSource; spaceId: string; }): Promise { + const start = Date.now(); const { name: pkgName, version: pkgVersion } = packageInfo; try { @@ -236,6 +237,10 @@ export async function _installPackage({ await packagePolicyService.upgrade(savedObjectsClient, esClient, policyIdsToUpgrade.items); } + const end = Date.now(); + + logger.debug(`Installation of ${pkgName}-${pkgVersion} took ${end - start}ms`); + return [ ...installedKibanaAssetsRefs, ...installedPipelines, diff --git a/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts b/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts index 518971a51e0ef..2efce474c33a7 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts @@ -65,6 +65,7 @@ export async function bulkInstallPackages({ }); if (installedPackageResult) { + logger.debug(`Retrieved installed package for ${pkgKeyProps.name}-${pkgKeyProps.version}`); const { name, version, @@ -84,6 +85,8 @@ export async function bulkInstallPackages({ const pkgkey = Registry.pkgToPkgKey(pkgKeyProps); + const start = Date.now(); + logger.debug(`Installing ${pkgkey} as part of bulk install`); const installResult = await installPackage({ savedObjectsClient, esClient, @@ -100,6 +103,9 @@ export async function bulkInstallPackages({ installType: installResult.installType, }; } + + const end = Date.now(); + logger.debug(`Installed ${pkgkey} in ${end - start}ms`); return { name: packageName, version: pkgKeyProps.version, diff --git a/x-pack/plugins/fleet/server/services/epm/packages/get.ts b/x-pack/plugins/fleet/server/services/epm/packages/get.ts index 364102c24f4c1..b83dc98f05471 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/get.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/get.ts @@ -144,6 +144,10 @@ export async function getPackageInfo(options: { }): Promise { const { savedObjectsClient, pkgName, pkgVersion } = options; + const logger = appContextService.getLogger(); + const start = Date.now(); + logger.debug(`Getting package info for ${pkgName}-${pkgVersion}`); + const [savedObject, latestPackage] = await Promise.all([ getInstallationObject({ savedObjectsClient, pkgName }), Registry.fetchFindLatestPackageWithFallbackToBundled(pkgName), @@ -176,6 +180,10 @@ export async function getPackageInfo(options: { }; const updated = { ...packageInfo, ...additions }; + const end = Date.now(); + + logger.debug(`Retrieved package info in ${end - start}ms`); + return createInstallableFrom(updated, savedObject); } diff --git a/x-pack/test/security_solution_endpoint/config.ts b/x-pack/test/security_solution_endpoint/config.ts index b00df7732ea4f..10ed6f2c2044f 100644 --- a/x-pack/test/security_solution_endpoint/config.ts +++ b/x-pack/test/security_solution_endpoint/config.ts @@ -44,6 +44,9 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { // always install Endpoint package by default when Fleet sets up `--xpack.fleet.packages.0.name=endpoint`, `--xpack.fleet.packages.0.version=latest`, + '--logging.loggers[0].name=plugins.fleet', + '--logging.loggers[0].level=debug', + '--logging.loggers[0].appenders[0]=console', ], }, layout: {