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

[APM] APM-Fleet integration version check & upgrade message #115297

Conversation

ogupte
Copy link
Contributor

@ogupte ogupte commented Oct 16, 2021

Closes #111829.

Looks up the current APM package policy version associated with the cloud agent policy and checks it against the latest supported stack version defined in the APM UI. If there's a new version is supported, it shows the user an alternate card to with a prompt to upgrade to the latest version.

Screen Shot 2021-10-16 at 3 54 33 AM
Screen Shot 2021-10-16 at 3 55 12 AM
Screen Shot 2021-10-16 at 3 56 02 AM

@ogupte ogupte added release_note:enhancement auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 labels Oct 16, 2021
@ogupte ogupte requested a review from a team as a code owner October 16, 2021 08:07
@botelastic botelastic bot added the Team:APM - DEPRECATED Use Team:obs-ux-infra_services. label Oct 16, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

@ogupte ogupte enabled auto-merge (squash) October 16, 2021 08:46
@ogupte ogupte disabled auto-merge October 16, 2021 08:46
@ogupte
Copy link
Contributor Author

ogupte commented Oct 17, 2021

@elasticmachine merge upstream

@ogupte
Copy link
Contributor Author

ogupte commented Oct 18, 2021

@elasticmachine merge upstream

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

LGTM just some nits

Comment on lines 286 to 375
function SuccessfulMigrationCard() {
return (
<EuiCard
icon={<EuiIcon size="xxl" type="checkInCircleFilled" color="success" />}
title={i18n.translate('xpack.apm.settings.schema.success.title', {
defaultMessage: 'Elastic Agent successfully setup!',
})}
description={i18n.translate(
'xpack.apm.settings.schema.success.description',
{
defaultMessage:
'Your APM integration is now setup and ready to receive data from your currently instrumented agents. Feel free to review the policies applied to your integtration.',
}
)}
footer={<CardFooter />}
/>
);
}

function UpgradeAvailableCard({
apmPackagePolicyId,
}: {
apmPackagePolicyId: string | undefined;
}) {
const upgradeApmPackagePolicyHref =
useUpgradeApmPackagePolicyHref(apmPackagePolicyId);

return (
<EuiCard
icon={<EuiIcon size="xxl" type="alert" color="warning" />}
title={i18n.translate(
'xpack.apm.settings.schema.upgradeAvailable.title',
{
defaultMessage: 'APM integration upgrade available!',
}
)}
description={
<FormattedMessage
id="xpack.apm.settings.upgradeAvailable.description"
defaultMessage="Although your APM integration is setup, a new version of the APM integration is available for upgrade with your fleet policy. {upgradePackagePolicyLink} to get the most out your setup!"
values={{
upgradePackagePolicyLink: (
<EuiLink href={upgradeApmPackagePolicyHref}>
{i18n.translate(
'xpack.apm.settings.schema.upgradeAvailable.upgradePackagePolicyLink',
{ defaultMessage: 'Upgrade your APM integration' }
)}
</EuiLink>
),
}}
/>
}
footer={<CardFooter />}
/>
);
}

function CardFooter() {
const fleetCloudAgentPolicyHref = useFleetCloudAgentPolicyHref();

return (
<div>
<EuiButton href={fleetCloudAgentPolicyHref}>
{i18n.translate(
'xpack.apm.settings.schema.success.viewIntegrationInFleet.buttonText',
{ defaultMessage: 'View the APM integration in Fleet' }
)}
</EuiButton>
<EuiSpacer size="xs" />
<EuiText size="s">
<p>
<FormattedMessage
id="xpack.apm.settings.schema.success.returnText"
defaultMessage="or simply return to the {serviceInventoryLink}."
values={{
serviceInventoryLink: (
<APMLink path="/services">
{i18n.translate(
'xpack.apm.settings.schema.success.returnText.serviceInventoryLink',
{ defaultMessage: 'Service inventory' }
)}
</APMLink>
),
}}
/>
</p>
</EuiText>
</div>
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you could break this file down by creating separate components for these components?

@@ -189,13 +191,34 @@ const createCloudApmPackagePolicyRoute = createApmServerRoute({
},
});

const devRoute = createApmServerRoute({
endpoint: 'GET /internal/apm/fleet/dev',
Copy link
Contributor

Choose a reason for hiding this comment

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

By reading the endpoint internal/apm/fleet/dev, doesn't say much about what it will return. Maybe you could improve its name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh whoops i was suppose to take this one out. it was just for my own development/testing

@ogupte
Copy link
Contributor Author

ogupte commented Oct 18, 2021

@elasticmachine merge upstream

@@ -92,7 +92,7 @@ const fleetAgentsRoute = createApmServerRoute({
});

const saveApmServerSchemaRoute = createApmServerRoute({
endpoint: 'POST /internal/apm/fleet/apm_server_schema',
endpoint: 'POST /api/apm/fleet/apm_server_schema',
Copy link
Member

Choose a reason for hiding this comment

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

Good call. This should be considered public

Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

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

lgtm. Casper would be proud.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1177 1187 +10

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 2.7MB 2.7MB +8.7KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:enhancement Team:APM - DEPRECATED Use Team:obs-ux-infra_services. v7.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM] Fleet: Show warning if apm package and Kibana is not the same version
5 participants