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

Usage in external projects? #45

Closed
tankbusta opened this issue May 27, 2020 · 5 comments
Closed

Usage in external projects? #45

tankbusta opened this issue May 27, 2020 · 5 comments
Assignees

Comments

@tankbusta
Copy link

What's the proper way to leverage this code in external projects? Go seems to be choking up on the contrib/replace syntax used in most of the modules files

Example:

go get -u go.opentelemetry.io/contrib/plugins/labstack/echo 
go: downloading go.opentelemetry.io/contrib v0.0.0-20200526151459-f2c18b305db9
go: downloading go.opentelemetry.io/contrib/plugins/labstack/echo v0.0.0-20200526151459-f2c18b305db9
go: go.opentelemetry.io/contrib/plugins/labstack/echo upgrade => v0.0.0-20200526151459-f2c18b305db9
go get: go.opentelemetry.io/contrib/plugins/labstack/echo@v0.0.0-20200526151459-f2c18b305db9 requires
        go.opentelemetry.io/contrib@v0.0.0-00010101000000-000000000000: invalid version: unknown revision 000000000000

I also tried a simple go get -u go get -u go.opentelemetry.io/contrib but it discovers the go.mod in plugins/labstack/echo and bombs out with the error from above

Any help would be appreciated - thanks!

@Aneurysm9
Copy link
Member

We probably need to start tagging releases here and updating the sub-modules' go.mod files like we do with the pre-release script in the main project.

My understanding is that replace directives are ignored in all but the current module when building using modules, so you may be able to work around this temporarily by putting a replace go.opentelemetry.io/contrib => path/to/repo directive in your own go.mod file.

@tankbusta
Copy link
Author

You are correct! I added a replace in my go.mod for contrib and it's building now.

👍 for releases as the replace syntax isn't ideal for external usage

@MrAlias MrAlias self-assigned this May 27, 2020
@jmacd
Copy link
Contributor

jmacd commented May 27, 2020

After a release is made in the main repository, many of the modules in this package should be updated. I did this for the 0.5 release. If we use a script to update the modules, we will still need to apply manual fixes in case of API breakage.

All .mod files should have a replace for go.opentelemetry.io/contrib to the root of the repo. We cannot use a replace directive for the main library (it will work locally but not on CI).

@evantorrie
Copy link
Contributor

evantorrie commented Jun 26, 2020

@tankbusta The last release v0.6.1 correctly tagged the top-level and all submodules.

You should be able to include in your go.mod file:

   require go.opentelemetry.io/contrib/instrumentation/labstack/echo v0.6.1

and it will pull in the correct version of all associated dependencies, including go.opentelemetry.io/contrib v0.6.1 and go.opentelemetry.io/otel v0.6.0.

Will close this issue as fixed assuming no further comments.

@MrAlias
Copy link
Contributor

MrAlias commented Jun 29, 2020

Please reopen if what @evantorrie said isn't true.

@MrAlias MrAlias closed this as completed Jun 29, 2020
plantfansam referenced this issue in plantfansam/opentelemetry-go-contrib Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants