-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[cmd/builder] ocb ignores otelcol_version
if set to v0.86.0 or higher
#8692
Comments
I can reproduce, a more minimal manifest would be the following:
This generates the following Generated
|
I cannot reproduce for v0.85.0 🤔 The following manifest builds fine:
|
Tested this with the following config and confirmed i couldn't reproduce the problem:
|
#8713 should fix this |
otelcol_version
if set to v0.86.0 or higher
Adds `go.opentelemetry.io/collector/otelcol` to `go.mod` template for the builder. This fixes #8692. Since #8443, the `otelcol` folder is its own component. Before this change, `otelcol_version` was enforced by the `collector` module dependency: https://github.com/open-telemetry/opentelemetry-collector/blob/287b98f6973fd6baa278150b9fca8c83abea0af4/cmd/builder/internal/builder/templates/go.mod.tmpl#L23 After this change, the `go mod tidy` step here: https://github.com/open-telemetry/opentelemetry-collector/blob/287b98f6973fd6baa278150b9fca8c83abea0af4/cmd/builder/internal/builder/main.go#L115 will add the latest available version for the `otelcol` module since none of the components actually depend on it. For example, with the `v0.86.0` builder config the output is as follows: ``` ❯ go mod tidy -v -compat=1.20 go: finding module for package go.opentelemetry.io/collector/otelcol go: found go.opentelemetry.io/collector/otelcol in go.opentelemetry.io/collector/otelcol v0.87.0 ``` Explicitly adding `otelcol` makes it so the `otelcol_version` is correctly honored. **Link to tracking Issue:** Fixes #8692
After some further investigating I believe it is not my setup that is causing this issue, so I moved it from Discussions to Issues.
I also split it to 2 separate issues, since they don't seem related (8691).
Describe the bug
Before 0.87.0 was released my setup was working, using 0.86.0. After release of 0.87.0 I get a build error saying:
See images in bottom for more details.
It seems that PR 8169 introduced a new required parameter, component.TelemetrySettings, which fails any build with a otlpreceiver of an older version than 0.87.0.
If I change my config to match the latest version it builds.
I tried downloading the binary version of the builder, just to make sure I did not have any issues there with versions etc and I got the same behavior.
Steps to reproduce
go install go.opentelemetry. io/collector/cmd/builder@v0.86.0
builder --config="path to yaml defined below" --output-path="some output path"
What did you expect to see?
A successful build
What did you see instead?
What version did you use?
Version: v0.86.0
What config did you use?
Config: yaml
Environment
OS: Win 11 Version 10.0.22621
Compiler: go 1.21.3
Discussed in #8668
Originally posted by robinlindberg October 11, 2023
This might be two separate bugs.
I am unable to install a specific version of the builder. I always get "dev" which seems to be the default value the version.go file sets.
I suspected the builder version being wrong was the cause of the go.mod being filled with both 0.86.0 and 0.87.0 versions. But now I tried using the binaries of the builder directly, instead of doing Go install. I got the same result when building for the non-latest version, e.g. 0.86.0. Building for the latest version works in both scenarios.
Does anyone have any clue what this might be caused by?
What I have tried:
The text was updated successfully, but these errors were encountered: