Skip to content
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

useless warning about ocb version missmatch #10514

Closed
cforce opened this issue Jul 2, 2024 · 5 comments · Fixed by #10767
Closed

useless warning about ocb version missmatch #10514

cforce opened this issue Jul 2, 2024 · 5 comments · Fixed by #10767
Labels
area:builder bug Something isn't working

Comments

@cforce
Copy link
Contributor

cforce commented Jul 2, 2024

Below warning makes no sense to me

2024-07-02T16:42:35.279Z INFO internal/command.go:125 OpenTelemetry Collector Builder {"version": "0.102.0", "date": "2024-06-04T08:26:04Z"}
2024-07-02T16:42:35.281Z INFO internal/command.go:161 Using config file {"path": "cta/builder-dev.yaml"}
2024-07-02T16:42:35.281Z INFO builder/config.go:132 Using go {"go-executable": "/usr/local/go/bin/go"}
2024-07-02T16:42:35.281Z INFO builder/main.go:77 You're building a distribution with non-aligned version of the builder. Compilation may fail due to API changes. Please upgrade your builder or API {"builder-version": "0.102.0"}

@cforce cforce added the bug Something isn't working label Jul 2, 2024
@cforce cforce changed the title usless warning about ocb version missmatch useless warning about ocb version missmatch Jul 2, 2024
@codeboten
Copy link
Contributor

codeboten commented Jul 2, 2024

This usually means that the version being built by the configuration doesn't match the version of ocb that is building it, this could cause the compilation of the binary to fail.

Maybe the message should include this information to clarify what the end user action should be?

@cforce
Copy link
Contributor Author

cforce commented Jul 2, 2024

Got it . Would help to tell that collector version in XX and ocb YY -> not equal, so potential issues

@codeboten
Copy link
Contributor

Would help to tell that collector version in XX and ocb YY -> not equal, so potential issues

For sure, would you like to open a PR to apply the change?

@cforce
Copy link
Contributor Author

cforce commented Jul 4, 2024

Well, if you point me out where this logic currently lives .and i am sure i would need to go through some approval required general for each committer on this project first, don't i.

@codeboten
Copy link
Contributor

The error message lives here:

cfg.Logger.Info("You're building a distribution with non-aligned version of the builder. Compilation may fail due to API changes. Please upgrade your builder or API", zap.String("builder-version", defaultOtelColVersion))

And right, the PR would need to be reviewed and approved and you'd need to sign the CLA if you haven't already done so https://opentelemetry.io/docs/contributing/requirements/#sign-the-cla.

codeboten added a commit that referenced this issue Aug 8, 2024
)

#### Description

Refine the warning message to make it useful for the end user.

#### Link to tracking issue

Fixes
#10514

#### Testing

Locally tested.
```sh
2024-07-31T22:03:05.984+0900    INFO    internal/command.go:125 OpenTelemetry Collector Builder {"version": "(devel)"}
2024-07-31T22:03:05.984+0900    INFO    internal/command.go:136 Using default build configuration
2024-07-31T22:03:05.985+0900    INFO    builder/config.go:142   Using go        {"go-executable": "/usr/local/bin/go"}
2024-07-31T22:03:05.985+0900    INFO    builder/main.go:77      You're building a distribution with non-aligned version of the builder. The version mismatch may cause the compilation failure. It's recommended to use the same version.       {"collector-version": "0.104.0", "builder-version": "0.106.1"}
2024-07-31T22:03:05.985+0900    INFO    builder/main.go:100     Sources created {"path": "/tmp/otelcol-distribution3869530617"}
2024-07-31T22:03:06.510+0900    INFO    builder/main.go:191     Getting go modules
2024-07-31T22:03:06.552+0900    INFO    builder/main.go:111     Compiling
2024-07-31T22:03:07.080+0900    INFO    builder/main.go:130     Compiled        {"binary": "/tmp/otelcol-distribution3869530617/otelcorecol"}
```

#### Documentation

N/A

#### Note

I did not add a changelog entry because other PRs that only changed
logging messages and behavior did not add it too.
If this is an incorrect understanding, please point it out.

---------

Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:builder bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants