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

Reduce package install size #532

Open
domdomegg opened this issue Mar 10, 2023 · 3 comments
Open

Reduce package install size #532

domdomegg opened this issue Mar 10, 2023 · 3 comments
Labels
enhancement accepted An actionable enhancement for which PRs will be accepted enhancement New feature or request priority: p3

Comments

@domdomegg
Copy link

Is your feature request related to a problem? Please describe.

When using this library on products like Google App Engine, all the dependencies are installed as part of deployment: https://cloud.google.com/appengine/docs/standard/nodejs/runtime#dependencies

Currently, almost 80% of our install size is just these libraries and their dependencies. This slows down deployments, and results in warning logs about the package size.

For example:

Describe the solution you'd like
Where possible, the number and size of dependencies is cut down so that using these libraries does not negatively affect GAE deployment speed.

Describe alternatives you've considered
Manually bundling and minifying the libraries ourselves. However, this seems likely error prone and adds complexity.

@domdomegg
Copy link
Author

Looks like it's mainly from:

  • opentelemetry-cloud-monitoring-exporter > googleapis
  • opentelemetry-cloud-trace-exporter > google-proto-files

@aabmass
Copy link
Contributor

aabmass commented Mar 13, 2023

googleapis

This repo is the main problem, we've seen the issue come up a few times. See #396

There is an alternative library @google-cloud/monitoring that can be used (or we could generate our own stubs) but I don't have time to work on this right now.

Manually bundling and minifying the libraries ourselves. However, this seems likely error prone and adds complexity.

In #396, they used @vercel/ncc to minify the node deps. This works pretty well in my experience.

@aabmass aabmass added enhancement New feature or request enhancement accepted An actionable enhancement for which PRs will be accepted priority: p3 labels Mar 13, 2023
@aabmass
Copy link
Contributor

aabmass commented Sep 26, 2024

Looks like it's mainly from:

  • opentelemetry-cloud-trace-exporter > google-proto-files

This was fixed for the trace exporter for #404, released in v2.4.1. Packagephobia now shows 15.3 MB which is mostly @opentelemetry packages
Screenshot 2024-09-26 at 1 36 31 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement accepted An actionable enhancement for which PRs will be accepted enhancement New feature or request priority: p3
Projects
None yet
Development

No branches or pull requests

2 participants