-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APM] APM agent config created prior to Fleet migration is not inject…
…ed into integration policy (#105504) (#105657) Co-authored-by: Cauê Marcondes <[email protected]>
- Loading branch information
1 parent
6c64b24
commit 19248f7
Showing
4 changed files
with
65 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
x-pack/plugins/apm/server/lib/fleet/merge_package_policy_with_apm.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { Setup } from '../helpers/setup_request'; | ||
import { APMPluginStartDependencies } from '../../types'; | ||
import { listConfigurations } from '../settings/agent_configuration/list_configurations'; | ||
import { | ||
getPackagePolicyWithAgentConfigurations, | ||
PackagePolicy, | ||
} from './register_fleet_policy_callbacks'; | ||
import { getPackagePolicyWithSourceMap, listArtifacts } from './source_maps'; | ||
|
||
export async function mergePackagePolicyWithApm({ | ||
packagePolicy, | ||
setup, | ||
fleetPluginStart, | ||
}: { | ||
packagePolicy: PackagePolicy; | ||
setup: Setup; | ||
fleetPluginStart: NonNullable<APMPluginStartDependencies['fleet']>; | ||
}) { | ||
const agentConfigurations = await listConfigurations({ setup }); | ||
const artifacts = await listArtifacts({ fleetPluginStart }); | ||
return getPackagePolicyWithAgentConfigurations( | ||
getPackagePolicyWithSourceMap({ packagePolicy, artifacts }), | ||
agentConfigurations | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters