You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Core binary footprint increased significantly between v0.158.0 and v0.159.0 #16075
After upgrading to the latest release for some custom collector builds, noticed that the binary size increased significantly. An investigation has pinpointed this between the v0.158.0 and v0.159.0 releases.
To demonstrate the issue, the following configuration YAML was built under these two tags:
Builds were done in a golang:trixie container under go version:
root@9a4974680dba:/go# go version
go version go1.27.1 linux/arm64
The resulting binary sizes were
v0.158.0 --> 26M
v0.159.0 --> 30M
By investigating deeper, it was found that most of the additional size can be attributed to package go.opentelemetry.io/contrib/otelconf which got upgraded from v0.24.0 to v0.25.0:
This package now has got full support for interfacing to the most popular cloud environments for fetching resource related information.
From what I understood, this package is used for the telemetry information that the collector emits on itself.
We are making a custom, lean build of the collector, embedding it in a resources poor environment so every MB that we can spare counts. I was wondering, would it be possible to make this diverse cloud environments support opt-in, so that they are included only when they are actually needed / used?
Thank you!
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Although this isn't ideal, one option to avoid taking on the additional size for the resource detectors is to use a replace statement at build time, essentially replacing resource detectors via some kind of no-op implementation, something like this:
This approach is kinda hacky but in the short term it might unblock you until a better solution is decided upon. I've added this to the next SIG meeting agenda.
A useful build-integrity invariant here is: component set selected != dependency capability set selected.
A lean custom distribution can omit every cloud-specific component yet still inherit their transitive detector code, so the binary artifact carries capabilities the distribution never asked for.
I’d add one reproducible “minimal distribution footprint” test that records both:
final stripped binary size;
symbol/package provenance for the largest newly linked dependency groups.
Then a dependency update that increases the minimal artifact beyond a threshold can fail with evidence showing which package families became reachable. That is more actionable than a raw size delta and avoids treating all growth as equivalent.
The stronger contract is:
declared distribution features -> reachable dependency graph -> artifact footprint
Activity
codeboten commentedon Oct 1, 2026
Thanks for the report, this was something that was on my radar with #15869, but I missed that the update of v0.25.0 also bumped the size up.
ps-mir commentedon Oct 1, 2026
oletconf(Go Contrib) has added popular cloud resource detectors since July. A sequence of how otelconf size has changed
Analysis done using Claude.
nozomi-gedimitr commentedon Oct 1, 2026
The other package whose upgrade has made a significant bump in output size is
github.com/felixge/httpsnoopv1.0.4tov1.1.0has brought an increase of ~1.3 MBBase lean v0.159.0 build
Doing the same barebones v0.159.0 build as in the description, to get more detailed output binary sizes
The output binary was:
Replacing otelconf to 0.24.0
The same configuration was built, but a
replacessection was added to moveotelconfto thev0.24.0releaseThe output binary was
Replacing also httpsnoop to v1.0.4
Another line was added in the
replacessection to movehttpsnooptov1.0.4The output binary was
codeboten commentedon Oct 1, 2026
Although this isn't ideal, one option to avoid taking on the additional size for the resource detectors is to use a replace statement at build time, essentially replacing resource detectors via some kind of no-op implementation, something like this:
And replacing all the detectors in the build file:
This approach is kinda hacky but in the short term it might unblock you until a better solution is decided upon. I've added this to the next SIG meeting agenda.
aetherxeg-source commentedon Oct 2, 2026
A useful build-integrity invariant here is: component set selected != dependency capability set selected.
A lean custom distribution can omit every cloud-specific component yet still inherit their transitive detector code, so the binary artifact carries capabilities the distribution never asked for.
I’d add one reproducible “minimal distribution footprint” test that records both:
Then a dependency update that increases the minimal artifact beyond a threshold can fail with evidence showing which package families became reachable. That is more actionable than a raw size delta and avoids treating all growth as equivalent.
The stronger contract is:
declared distribution features -> reachable dependency graph -> artifact footprintwith unexpected reachability visible in CI.
Related runtime-integrity work: https://github.com/AETHERXGLOBAL/execsurface
codeboten commentedon Oct 5, 2026
@nozomi-gedimitr i submitted a PR to the otel-go-contrib repo to introduce build tags that would support omitting individual resource detectors: open-telemetry/opentelemetry-go-contrib#9818
[chore] add a check for binary otelcorecol binary size (open-telemetr…
iblancasa commentedon Nov 16, 2026
I think this ticket can be closed now, right?
codeboten commentedon Nov 16, 2026
@iblancasa correct, the documentation for the builder has been updated to demonstrate how to configure resource detectors: https://github.com/open-telemetry/opentelemetry-collector/tree/main/cmd/builder#configuration