Open vjsamuel opened 2 weeks ago
Hi @vjsamuel thanks for reaching out. We're aware of the issue but we have not formulated a plan yet. I think now is a good time to formulate that plan so that people can get working on it.
I have some ideas around the topic that (I think) we can implement to reduce the size of these bundles:
@opentelemetry/api-logs
, @opentelemetry/api-events
, @opentelemetry/sdk-logs
) as there we can make breaking changes to improve bundle size they're still in semver 0.x range)@opentelemetry/otlp-exporter-logs-otlp-proto
, @opentelemetry/otlp-exporter-logs-otlp-http
, @opentelemetry/otlp-transformer
, @opentelemetry/otlp-exporter-base
). I am actually currently working on re-structuring them so that we can apply bundle-size and performance improvements in the future (See #4585, #4583, #4116). Their code does interweave a lot of different concepts which makes PRs extremely difficult to review and test. These issues need to be addressed first before we can consider working on bundle-size improvements.Questions about your specific situation:
@opentelemetry/otlp-exporter-logs-otlp-proto
is very large, while @opentelemetry/otlp-exporter-logs-otlp-http
is significantly smaller. They are quite different and the JSON exporter does not have to pull in generated code and protobufjs
.@opentelemetry/*
packages are you using in your bundle at the moment? Knowing this may help us get a first list of priority packages.Please let me know what you think of the proposed steps, I'll then create the issues for the tasks and will bring it up in the SIG meeting so that we can have a broader discussion on it before starting to work on it. :slightly_smiling_face:
We have been in the process of doing instrumentation for our frontend applications. As a first step, the team has done some boiler plate instrumentation for events/exceptions using the logs SDK. However we see that the bundle size is way too large for us to ship it out without impacting page speed. The size can be seen in the screenshot below:![image](https://github.com/open-telemetry/opentelemetry-js/assets/3927228/e758e549-e06c-4536-a368-ff8064536efb)
Is there any opportunity to some short/mid/long term iterations to make sure that we substantially bring this number down?
Thank you for the great work that is being done here :)