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

Add support for lazy loader on self hosted #1560

Closed
sdernbach-ionos opened this issue Oct 18, 2024 · 8 comments
Closed

Add support for lazy loader on self hosted #1560

sdernbach-ionos opened this issue Oct 18, 2024 · 8 comments
Labels

Comments

@sdernbach-ionos
Copy link

Hi,

officially Sentry supports a loader script that handles which parts are needed which is better from performance perspective. This does not work on self-hosted but a user suggested a solution here: getsentry/sentry#22715 (comment)

I guess we could implement a Job that is doing that as post-install hook by either reading the version from the web container or using the online url for the same JSON file: https://release-registry.services.sentry.io/sdks/sentry.javascript.browser/versions

The problem is more I'm not sure if we need a storage as if we just put it to the nginx /var/www/js-sdk folder I guess it is lost as soon as the pod gets recreated, right?

@patsevanton any opinions or ideas about that?

Thanks,
Sebastian

@patsevanton
Copy link
Contributor

@sdernbach-ionos Hi! What exactly are the JS files that need to be downloaded and put into the nginx pod? I'm reading, but I don't yet understand what JS files need to be downloaded.

@sdernbach-ionos
Copy link
Author

@patsevanton the JS files are basically like the modules of the Sentry JS SDK. A loader script is dynamically build based on the project settings which minimizes the filesize which improves the performance when including Sentry in web applications.

You can read more about the Sentry loader here: https://docs.sentry.io/platforms/javascript/install/loader/

@patsevanton
Copy link
Contributor

patsevanton commented Oct 18, 2024

I dowloaded by wget https://browser.sentry-cdn.com/8.34.0/browserprofiling.debug.min.js
but

sha384sum browserprofiling.debug.min.js 
fee7f6ef2d3f5c0b79f16c2b2f01399c59459d77950addd9c4982acf206f03458da4bc5bf2834067b28d454c4db79fd7  browserprofiling.debug.min.js

It doesn't match with

sha384-/uf27y0/XAt58WwrLwE5nFlFnXeVCt3ZxJgqzyBvA0WNpLxb8oNAZ7KNRUxNt5/X

@sdernbach-ionos
Copy link
Author

@patsevanton they use base64 with the hash, I used this and then I get the same as they have in the JSON file:

curl -s https://browser.sentry-cdn.com/8.34.0/browserprofiling.debug.min.js | openssl dgst -sha384 -binary |  openssl enc -base64

@aldy505
Copy link

aldy505 commented Oct 24, 2024

officially Sentry supports a loader script that handles which parts are needed which is better from performance perspective. This does not work on self-hosted but a user suggested a solution here: getsentry/sentry#22715 (comment)

Hello, coming from the repository across, please don't use that solution. Refer to this instead https://github.com/getsentry/self-hosted/blob/a29a7969f5f7a93e27c67f0aa622452b5ddc2687/install/setup-js-sdk-assets.sh

@Mokto
Copy link
Contributor

Mokto commented Nov 23, 2024

This issue is stale because it has been open for 30 days with no activity.

@Mokto Mokto added the stale label Nov 23, 2024
@Mokto
Copy link
Contributor

Mokto commented Dec 7, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@Mokto Mokto closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2024
@patsevanton
Copy link
Contributor

@sdernbach-ionos i am sorry. I don't have free time to add this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants