open-telemetry/opentelemetry-collector-builder

Build Collector binary on demond

wangzlei opened this issue · 3 comments

Is your feature request related to a problem? Please describe.
The current Collector binary includes all of components, Collector-contrib includes more 3rd party receivers and exporters the binary size is over 100MB and would be larger in the future. For some resource sensitive environment like AWS Lambda, it calculates memory usage by Cache + RSS, the larger size of Collector the higher bill users may have to pay. So, it is better to provide a way to build Collector based on user's config. For example, if user want to use otlp receiver and xray exporter, he can build a small Collector with only these 2 components besides the core components.

Describe the solution you'd like
Since goLang is a compiled language, dynamically build binary is a challenge. A possible way but not safe is can we generate defaults.go by a template? The components are got from user's config.

There is a 3rd party repo https://github.com/observatorium/opentelemetry-collector-builder, can we think about merge the logic into Collector?

Describe alternatives you've considered
Now I can manually delete the components what I don't want from defaults.go, but that is not a general solution for normal user.

Now that the collector builder repo is in open telemetry org https://github.com/open-telemetry/opentelemetry-collector-builder moving this issue to that repo

Thank you for your suggestion, @wangzlei . We had the same idea in the past and I proposed moving this repository under the open-telemetry organization, which happened just right as you opened the issue.

Thanks!