Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiling: symbolization created on user opt-in #156089

Merged
merged 6 commits into from
May 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
Copy link
Contributor

@jen-huang jen-huang Apr 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could consider omitting this field altogether, this will make it always install the latest symbolizer package it finds (including prerelease packages) that is compatible with this version of Kibana

this means that this version field will not need to be manually update for later releases, including patches. but it also means care should be given as to not accidentally release a package incorrectly (i.e. publishing a 8.9.0 without a >8.9.0 kibana version constraint)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks 👍🏼 TIL
I'll discuss this with the team and eventually update the PR accordingly after testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jen-huang whan you say omitting this field i suppose you mean not setting package at all? Or does it mean leaving it as an empty object o null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Erased in 7d70af9

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently this commit broke the tests... I'll remove it and re-run them

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only meant removing version: '8.8.0-preview', line :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks, good to know 😄
Will keep in mind for the next PR 👍🏼

},
name: 'elastic-universal-profiling-symbolizer',
namespace: 'default',
inputs: [
{
policy_template: 'universal_profiling_symbolizer',
enabled: true,
streams: [],
type: 'pf-elastic-symbolizer',
},
],
},
{ force: true }
);
},
};
}