Closed utezduyar closed 1 year ago
Hey @jpkrohling,
Looking at https://github.com/open-telemetry/opentelemetry-collector/blob/v0.69.0/go.mod#L25
It looks like it depends on the previous version of pdata
which is trying to resolve the packages for v0.68.0
and causes issues since the go code in config/
was removed causing it to fail.
I suspect this didn't fail the builds in the collector repos since it uses replace statements.
It seems like adding some contrib components to the list fixes the issue. For example, adding the hostmetrics receiver fixes this (the following manifest builds correctly):
# This one builds successfully
receivers:
- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.69.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.69.0
exporters:
- gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.69.0
But adding some other contrib components does not fix the build; e.g. only adding the file exporter does not (the following manifest fails to build with the same error as the above):
# This one fails to build with the same error
receivers:
- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.69.0
exporters:
- gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.69.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.69.0
I have not been able to tell what the difference is between the two that makes one fail and the other succeed.
The fact that adding the host metrics receiver fixes the build explains why the official binaries were built without any problems, since both distros include this component. This also means that the official binaries have the correct version of every module (I haven't checked this explicitly, but am reasonably sure about it).
I think we need a core v0.69.1 tag that fixes the issue @MovieStoreGuy mentioned.
How about adding a replace statement for go.opentelemetry.io/collector/pdata
, pointing to the expected version? Would it make the build work? I suspect this has to do with the module splits that happened in the core, not caused by the builder itself.
@jpkrohling see https://github.com/open-telemetry/opentelemetry-collector/issues/6908#issuecomment-1380135220, it looks like the require statements on the main core go.mod
file for v0.69.0 are incorrectly pointing to v0.68.0/v1.0.0-rc2
Sorry, I meant to add a replace statement to the manifest used with the builder.
Ah, my bad, thanks for clarifying :)
How about adding a replace statement for
go.opentelemetry.io/collector/pdata
, pointing to the expected version? Would it make the build work? I suspect this has to do with the module splits that happened in the core, not caused by the builder itself.
I had tried doing that in my internal project, and it has no affect unfortunately.
I am not able to reproduce this with v0.69.1, but there is a bug report of the issue on v0.69.1 over at #6942.
@utezduyar, does v0.69.1 fix the issue for you?
0.69.1 works for me. To follow up I have created https://github.com/open-telemetry/opentelemetry-collector/pull/6944
I am following the README on the repository but it complains about
not contain package go.opentelemetry.io/collector/config
.I also played around with the yaml file and seems like the build works if
zpagesextension
is in the yaml file.The failure is at
cmd := exec.Command(cfg.Distribution.Go, "mod", "tidy", "-compat=1.18")
inGetModules
.It works if I enable zpagesextension