Skip to content

Conversation

@sorenlouv
Copy link
Member

@sorenlouv sorenlouv commented Nov 19, 2020

Fixes issue reported on Discuss where custom links result in an error for users on basic license.

Improvements:

  • Only fetch custom links for users with a gold license or higher
  • lazy load custom links when the action menu is opened
  • Clean up TransactionActionMenu component by co-locating everything related to custom links in the CustomLinkMenuSection

Bug introduced in 7.10 by #77630

How to downgrade to basic license:

curl http://localhost:9200/_license/start_basic\?acknowledge=true -X POST -u admin:changeme

@sorenlouv sorenlouv requested a review from a team as a code owner November 19, 2020 17:38
@botelastic botelastic bot added the Team:APM - DEPRECATED Use Team:obs-ux-infra_services. label Nov 19, 2020
@elasticmachine
Copy link
Contributor

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

@sorenlouv sorenlouv changed the title [APM] Only fetch custom links when user has valid license [APM] Only fetch custom links for users with a valid license Nov 19, 2020
@sorenlouv sorenlouv added bug Fixes for quality problems that affect the customer experience apm:test-plan-regression labels Nov 20, 2020
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.

When opening the Custom link page inside Settings I still see a 403 error. We should also avoid calling the API if the License is not Gold+

Screenshot 2020-11-20 at 11 38 14

@cauemarcondes
Copy link
Contributor

Bug introduced in 7.10 by #77630

Are you sure this bug was introduced by this issue? I ask it because we only notify the usage when the POST API is called, not when the GET API is called to return all custom links.

@sorenlouv
Copy link
Member Author

sorenlouv commented Nov 20, 2020

Are you sure this bug was introduced by this issue? I ask it because we only notify the usage when the POST API is called, not when the GET API is called to return all custom links.

The linked PR added the following check to the GET /api/apm/settings/custom_links endpoint that throws unless the user has Gold+:

if (!isActiveGoldLicense(context.licensing.license)) {
throw Boom.forbidden(INVALID_LICENSE);
}

@sorenlouv
Copy link
Member Author

@cauemarcondes All feedback addressed

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.

Looks great, the new design looks way better, thanks for improving it. 🎉

@sorenlouv sorenlouv merged commit a703524 into elastic:master Nov 20, 2020
@sorenlouv sorenlouv deleted the fix-issue-with-custom-link-license branch November 20, 2020 18:59
sorenlouv added a commit to sorenlouv/kibana that referenced this pull request Nov 20, 2020
…#83836)

* [APM] Only fetch custom links when user has valid license

* Rename more files for consistency

* i18n fixes

* Fix tests

* Addess feedback and minor cleanup

* Fix test (and more cleanup)

* Make cachable
# Conflicts:
#	x-pack/plugins/apm/jest.config.js
#	x-pack/plugins/apm/public/components/app/Settings/CustomizeUI/CustomLink/Title.tsx
#	x-pack/plugins/apm/public/components/app/Settings/CustomizeUI/CustomLink/index.tsx
#	x-pack/plugins/apm/public/components/shared/TransactionActionMenu/TransactionActionMenu.tsx
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1162 1160 -2

Async chunks

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

id before after diff
apm 3.1MB 3.1MB +168.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
observability 71.3KB 72.1KB +789.0B

History

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

@RickyLau
Copy link

RickyLau commented Dec 4, 2020

Where can I find the kibana linux 64-bit distribution for git 7.10 branch.

@cauemarcondes
Copy link
Contributor

cauemarcondes commented Dec 29, 2020

Tests ok.
New bug opened #86989

@cauemarcondes cauemarcondes added the apm:test-plan-done Pull request that was successfully tested during the test plan label Dec 29, 2020
sorenlouv added a commit that referenced this pull request Aug 15, 2023
Originally fixed in #83836


**Problem**

When running in basic mode and navigates to the transactions details
page a toast is display with the warning:

>To create custom links, you must be subscribed to an Elastic Gold
license or above. With it, you'll have the ability to create custom
links to improve your workflow when analyzing your services.

This is caused by a request to `GET internal/apm/settings/custom_links`.
This PR ensures that only when users have a valid license custom links
will be attempted loaded


<img width="1705" alt="image"
src="https://github.com/elastic/kibana/assets/209966/60c59c87-9837-4fbb-8172-5a4add121db0">
bryce-b pushed a commit that referenced this pull request Aug 22, 2023
Originally fixed in #83836


**Problem**

When running in basic mode and navigates to the transactions details
page a toast is display with the warning:

>To create custom links, you must be subscribed to an Elastic Gold
license or above. With it, you'll have the ability to create custom
links to improve your workflow when analyzing your services.

This is caused by a request to `GET internal/apm/settings/custom_links`.
This PR ensures that only when users have a valid license custom links
will be attempted loaded


<img width="1705" alt="image"
src="https://github.com/elastic/kibana/assets/209966/60c59c87-9837-4fbb-8172-5a4add121db0">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apm:test-plan-7.11.0 apm:test-plan-done Pull request that was successfully tested during the test plan apm:test-plan-regression bug Fixes for quality problems that affect the customer experience release_note:fix Team:APM - DEPRECATED Use Team:obs-ux-infra_services. v7.10.0 v7.11.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants