diff --git a/x-pack/plugins/profiling/server/lib/setup/steps/get_fleet_policy_step.ts b/x-pack/plugins/profiling/server/lib/setup/steps/get_fleet_policy_step.ts index 7f7222a8a6e9d..a89be86280114 100644 --- a/x-pack/plugins/profiling/server/lib/setup/steps/get_fleet_policy_step.ts +++ b/x-pack/plugins/profiling/server/lib/setup/steps/get_fleet_policy_step.ts @@ -101,6 +101,35 @@ export function getFleetPolicyStep({ ...omit(apmPolicy, 'id', 'revision', 'updated_at', 'updated_by'), inputs: modifiedPolicyInputs, }); + + // We add here the creation of the new package_policy for symbolizer. + // We create the new policy and bind it to the Cloud default agent policy; + // to do so, force s required to be set to true. + const cloudAgentPolicyId = 'policy-elastic-agent-on-cloud'; + await packagePolicyClient.create( + soClient, + esClient, + { + policy_id: cloudAgentPolicyId, + enabled: true, + package: { + name: 'profiler_symbolizer', + title: 'Universal Profiling Symbolizer', + version: '8.8.0-preview', + }, + name: 'elastic-universal-profiling-symbolizer', + namespace: 'default', + inputs: [ + { + policy_template: 'universal_profiling_symbolizer', + enabled: true, + streams: [], + type: 'pf-elastic-symbolizer', + }, + ], + }, + { force: true } + ); }, }; }