-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[APM] APM-Fleet integration version check & upgrade message #115297
Conversation
Pinging @elastic/apm-ui (Team:apm) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
There was a problem hiding this 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
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> | ||
); | ||
} |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
@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', |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…#115484) Co-authored-by: Oliver Gupte <[email protected]>
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.