Skip to content

Commit

Permalink
Profiling: symbolization created on user opt-in (#156089)
Browse files Browse the repository at this point in the history
Signed-off-by: inge4pres <francesco.gualazzi@elastic.co>

## Summary

Include the creation of symbolizer package policy in the setup initiated
by users when they opt-in Universal Profiling.

### Checklist

- [X]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Related issues or PRs
* #155642
* #150885

---------

Signed-off-by: inge4pres <francesco.gualazzi@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jen Huang <its.jenetic@gmail.com>
  • Loading branch information
3 people authored May 2, 2023
1 parent 06054cd commit d4f6cf7
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
);
},
};
}

0 comments on commit d4f6cf7

Please sign in to comment.