Closed MBaczun closed 2 years ago
While the modules in this repository are pre-v1.0 it is necessary to ensure all modules use the same version and the appropriate dependency versions. v0.21.0
requires the use of go.opentelemetry.io/otel v1.0.0-RC1
. It seems that Go may not automatically resolve that version, perhaps because it uses a pre-release version suffix.
You can specify pre-release versions by appending a hyphen and dot separated identifiers (for example, v1.0.1-alpha or v2.2.2-beta.2). Normal releases are preferred by the go command over pre-release versions, so users must ask for pre-release versions explicitly (for example, go get example.com/hello@v1.0.1-alpha) if your module has any normal releases.
@Aneurysm9 thank you for the prompt response. In my understanding, if a module does not work in a recent version of Go by default, it must be considered a bug. Am I wrong?
For example, the problem does not exist with v0.20.0. If we have to manually fix versions of the dependencies and their dependencies, which is basically a workaround, I would consider it a bug.
If there is an approach that does not require explicit go.mod manipulations, we would appreciate if the maintainers could describe it in a more detail.
@ustiugov @MBaczun it looks like your code explicitly depends on go.opentelemetry.io/otel/semconv
:
You'll need to update the use of the semconv package to reference the new go.opentelemetry.io/otel/semconv/v1.4.0
package. For more information take a look at the changelog and the linked info on telemetry schemas.
Based on your use, it looks like you should be able to replace the linked line with something like:
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
thank you! we are going to try that.
Looking further into this, it does look like updates to the referenced codebase are needed, but it also looks like the go mod tidy
command will prefer locally existing version of dependencies. Running the above steps to reproduce this code in a clean environment succeeded:
docker run --rm -v "$PWD":/usr/src/github.com/ease-lab/vhive/ -w /usr/src/github.com/ease-lab/vhive/utils/tracing/go golang:1.16 go mod tidy
go: finding module for package go.opentelemetry.io/otel/sdk/resource
go: finding module for package go.opentelemetry.io/otel
go: finding module for package github.com/sirupsen/logrus
go: finding module for package go.opentelemetry.io/otel/propagation
go: finding module for package go.opentelemetry.io/otel/exporters/zipkin
go: finding module for package github.com/containerd/containerd/log
go: finding module for package go.opentelemetry.io/otel/attribute
go: finding module for package go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
go: downloading go.opentelemetry.io/contrib v0.21.0
go: downloading go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.21.0
go: downloading go.opentelemetry.io/otel/exporters/zipkin v1.0.0-RC1
go: downloading go.opentelemetry.io/otel v0.20.0
go: downloading go.opentelemetry.io/otel/sdk v0.20.0
go: downloading go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc v0.11.0
go: downloading go.opentelemetry.io v0.1.0
go: downloading github.com/sirupsen/logrus v1.8.1
go: downloading github.com/containerd/containerd v1.5.2
go: finding module for package go.opentelemetry.io/otel/sdk/trace
go: finding module for package go.opentelemetry.io/otel/semconv/v1.4.0
go: finding module for package go.opentelemetry.io/otel/trace
go: finding module for package google.golang.org/grpc
go: downloading go.opentelemetry.io/otel/trace v0.20.0
go: downloading google.golang.org/grpc v1.39.0
go: found github.com/containerd/containerd/log in github.com/containerd/containerd v1.5.2
go: found github.com/sirupsen/logrus in github.com/sirupsen/logrus v1.8.1
go: found go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc in go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.21.0
go: found go.opentelemetry.io/otel in go.opentelemetry.io/otel v0.20.0
go: found go.opentelemetry.io/otel/attribute in go.opentelemetry.io/otel v0.20.0
go: found go.opentelemetry.io/otel/exporters/zipkin in go.opentelemetry.io/otel/exporters/zipkin v1.0.0-RC1
go: found go.opentelemetry.io/otel/propagation in go.opentelemetry.io/otel v0.20.0
go: found go.opentelemetry.io/otel/sdk/resource in go.opentelemetry.io/otel/sdk v0.20.0
go: found go.opentelemetry.io/otel/sdk/trace in go.opentelemetry.io/otel/sdk v0.20.0
go: found go.opentelemetry.io/otel/trace in go.opentelemetry.io/otel/trace v0.20.0
go: found google.golang.org/grpc in google.golang.org/grpc v1.39.0
go: downloading go.opentelemetry.io/otel v1.0.0-RC1
go: downloading go.opentelemetry.io/otel/sdk v1.0.0-RC1
go: downloading go.opentelemetry.io/otel/trace v1.0.0-RC1
go: downloading gotest.tools v2.2.0+incompatible
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/stretchr/testify v1.7.0
go: downloading go.opentelemetry.io/otel/oteltest v1.0.0-RC1
go: downloading go.uber.org/goleak v1.1.10
go: downloading golang.org/x/sys v0.0.0-20210324051608-47abb6519492
go: downloading github.com/openzipkin/zipkin-go v0.2.5
go: downloading github.com/google/go-cmp v0.5.6
go: downloading gotest.tools/v3 v3.0.3
go: downloading golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
go: downloading google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a
go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: downloading google.golang.org/protobuf v1.26.0
go: downloading golang.org/x/lint v0.0.0-20200302205851-738671d3881b
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
go: downloading cloud.google.com/go v0.54.0
go: downloading google.golang.org/appengine v1.6.5
go: downloading golang.org/x/tools v0.0.0-20210106214847-113979e3529a
go: downloading golang.org/x/text v0.3.4
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading github.com/pkg/errors v0.9.1
$ cat go.mod
module github.com/ease-lab/vhive/utils/tracing/go
go 1.16
require (
github.com/containerd/containerd v1.5.2
github.com/sirupsen/logrus v1.8.1
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.21.0
go.opentelemetry.io/otel v1.0.0-RC1
go.opentelemetry.io/otel/exporters/zipkin v1.0.0-RC1
go.opentelemetry.io/otel/sdk v1.0.0-RC1
go.opentelemetry.io/otel/trace v1.0.0-RC1
google.golang.org/grpc v1.39.0
)
Hopefully that helps.
Hi, the methods shared here have not resolved this problem.
Replacing the import in our code with semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
as suggested here does not help, running go mod tidy after this change still results in the issue.
Running go mod tidy "in a clean environment" as later suggested also does not work. I have tried running go mod tidy in a fresh environment on cloudlab which we often use for testing, but this made no difference. Also, on a fresh cloudlab experiment, I tried using docker run --rm -v "$PWD":/usr/src/github.com/ease-lab/vhive/ -w /usr/src/github.com/ease-lab/vhive/utils/tracing/go golang:1.16 go mod tidy
as shown here, but this results in the same problem as always:
$ docker run --rm -v "$PWD":/usr/src/github.com/ease-lab/vhive/ -w /usr/src/github.com/ease-lab/vhive/utils/tracing/go golang:1.16 go mod tidy
go: finding module for package github.com/containerd/containerd/log
go: finding module for package go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
go: finding module for package go.opentelemetry.io/otel/propagation
go: finding module for package go.opentelemetry.io/otel/sdk/trace
go: finding module for package go.opentelemetry.io/otel/semconv/v1.4.0
go: finding module for package go.opentelemetry.io/otel/attribute
go: finding module for package go.opentelemetry.io/otel/trace
go: finding module for package google.golang.org/grpc
go: finding module for package go.opentelemetry.io/otel/sdk/resource
go: finding module for package go.opentelemetry.io/otel
go: finding module for package github.com/sirupsen/logrus
go: finding module for package go.opentelemetry.io/otel/exporters/trace/zipkin
go: downloading github.com/sirupsen/logrus v1.8.1
go: downloading go.opentelemetry.io/contrib v0.21.0
go: downloading go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.21.0
go: downloading go.opentelemetry.io/otel v0.20.0
go: downloading go.opentelemetry.io/otel/sdk v0.20.0
go: downloading go.opentelemetry.io/otel/trace v0.20.0
go: downloading go.opentelemetry.io v0.1.0
go: downloading go.opentelemetry.io/otel/exporters/trace/zipkin v0.20.0
go: downloading go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc v0.11.0
go: downloading google.golang.org/grpc v1.39.0
go: downloading github.com/containerd/containerd v1.5.2
go: found github.com/containerd/containerd/log in github.com/containerd/containerd v1.5.2
go: found github.com/sirupsen/logrus in github.com/sirupsen/logrus v1.8.1
go: found go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc in go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.21.0
go: found go.opentelemetry.io/otel in go.opentelemetry.io/otel v0.20.0
go: found go.opentelemetry.io/otel/attribute in go.opentelemetry.io/otel v0.20.0
go: found go.opentelemetry.io/otel/exporters/trace/zipkin in go.opentelemetry.io/otel/exporters/trace/zipkin v0.20.0
go: found go.opentelemetry.io/otel/propagation in go.opentelemetry.io/otel v0.20.0
go: found go.opentelemetry.io/otel/sdk/resource in go.opentelemetry.io/otel/sdk v0.20.0
go: found go.opentelemetry.io/otel/sdk/trace in go.opentelemetry.io/otel/sdk v0.20.0
go: found go.opentelemetry.io/otel/trace in go.opentelemetry.io/otel/trace v0.20.0
go: found google.golang.org/grpc in google.golang.org/grpc v1.39.0
go: downloading go.opentelemetry.io/otel v1.0.0-RC1
go: downloading gotest.tools v2.2.0+incompatible
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/stretchr/testify v1.7.0
go: downloading go.uber.org/goleak v1.1.10
go: downloading golang.org/x/sys v0.0.0-20210324051608-47abb6519492
go: downloading google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a
go: downloading gotest.tools/v3 v3.0.3
go: downloading go.opentelemetry.io/otel/trace v1.0.0-RC1
go: downloading github.com/google/go-cmp v0.5.6
go: downloading go.opentelemetry.io/otel/oteltest v1.0.0-RC1
go: downloading golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: downloading google.golang.org/protobuf v1.26.0
go: downloading golang.org/x/lint v0.0.0-20200302205851-738671d3881b
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
go: downloading github.com/openzipkin/zipkin-go v0.2.5
go: downloading cloud.google.com/go v0.54.0
go: downloading google.golang.org/appengine v1.6.5
go: downloading golang.org/x/tools v0.0.0-20210106214847-113979e3529a
go: downloading github.com/pkg/errors v0.9.1
go: downloading golang.org/x/text v0.3.4
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: finding module for package go.opentelemetry.io/otel/semconv
github.com/ease-lab/vhive/utils/tracing/go imports
go.opentelemetry.io/otel/exporters/trace/zipkin imports
go.opentelemetry.io/otel/semconv: package go.opentelemetry.io/otel/semconv provided by go.opentelemetry.io/otel at latest version v0.20.0 but not at required version v1.0.0-RC1
Furthermore I have tired to directly apply the go.mod file shared here by copying and pasting the following:
module github.com/ease-lab/vhive/utils/tracing/go
go 1.16
require (
github.com/containerd/containerd v1.5.2
github.com/sirupsen/logrus v1.8.1
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.21.0
go.opentelemetry.io/otel v1.0.0-RC1
go.opentelemetry.io/otel/exporters/zipkin v1.0.0-RC1
go.opentelemetry.io/otel/sdk v1.0.0-RC1
go.opentelemetry.io/otel/trace v1.0.0-RC1
google.golang.org/grpc v1.39.0
)
Even with this go.mod file, and even after trying all the combinations including importing semconv/v1.4.0 and running via a docker image, still when I run go mod tidy
in order to generate a go.sum file, I get the same issue:
go: finding module for package go.opentelemetry.io/otel/exporters/trace/zipkin
go: found go.opentelemetry.io/otel/exporters/trace/zipkin in go.opentelemetry.io/otel/exporters/trace/zipkin v0.20.0
go: finding module for package go.opentelemetry.io/otel/semconv
github.com/ease-lab/vhive/utils/tracing/go imports
go.opentelemetry.io/otel/exporters/trace/zipkin imports
go.opentelemetry.io/otel/semconv: package go.opentelemetry.io/otel/semconv provided by go.opentelemetry.io/otel at latest version v0.20.0 but not at required version v1.0.0-RC1
# Or in some cases:
go: finding module for package go.opentelemetry.io/otel/semconv
github.com/ease-lab/vhive/utils/tracing/go imports
go.opentelemetry.io/otel/semconv: package go.opentelemetry.io/otel/semconv provided by go.opentelemetry.io/otel at latest version v0.20.0 but not at required version v1.0.0-RC1
The only working fix that we have is still to use v0.20.0 of otelgrpc, and this issue is still unresolved.
Using my for with this fix and the steps outlined in this issues' description I am not able to reproduce the error.
$ rm go.mod go.sum
$ go mod init github.com/ease-lab/vhive/utils/tracing/go
go: creating new go.mod: module github.com/ease-lab/vhive/utils/tracing/go
go: to add module requirements and sums:
go mod tidy
$ docker run --rm -v "$PWD":/usr/src/github.com/ease-lab/vhive/ -w /usr/src/github.com/ease-lab/vhive/utils/tracing/go golang:1.16 go mod tidy
go: finding module for package go.opentelemetry.io/otel/sdk/resource
go: finding module for package github.com/containerd/containerd/log
go: finding module for package go.opentelemetry.io/otel/exporters/zipkin
go: finding module for package go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
go: finding module for package go.opentelemetry.io/otel/attribute
go: finding module for package go.opentelemetry.io/otel/propagation
go: finding module for package github.com/sirupsen/logrus
go: finding module for package go.opentelemetry.io/otel
go: downloading github.com/sirupsen/logrus v1.8.1
go: downloading go.opentelemetry.io/otel v0.20.0
go: downloading go.opentelemetry.io/otel/sdk v0.20.0
go: downloading go.opentelemetry.io/contrib v0.21.0
go: downloading go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.21.0
go: downloading go.opentelemetry.io/otel/exporters/zipkin v1.0.0-RC1
go: finding module for package go.opentelemetry.io/otel/sdk/trace
go: downloading go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc v0.11.0
go: downloading go.opentelemetry.io v0.1.0
go: downloading github.com/containerd/containerd v1.5.2
go: finding module for package go.opentelemetry.io/otel/semconv/v1.4.0
go: finding module for package go.opentelemetry.io/otel/trace
go: finding module for package google.golang.org/grpc
go: downloading go.opentelemetry.io/otel/trace v0.20.0
go: downloading google.golang.org/grpc v1.39.0
go: found github.com/containerd/containerd/log in github.com/containerd/containerd v1.5.2
go: found github.com/sirupsen/logrus in github.com/sirupsen/logrus v1.8.1
go: found go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc in go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.21.0
go: found go.opentelemetry.io/otel in go.opentelemetry.io/otel v0.20.0
go: found go.opentelemetry.io/otel/attribute in go.opentelemetry.io/otel v0.20.0
go: found go.opentelemetry.io/otel/exporters/zipkin in go.opentelemetry.io/otel/exporters/zipkin v1.0.0-RC1
go: found go.opentelemetry.io/otel/propagation in go.opentelemetry.io/otel v0.20.0
go: found go.opentelemetry.io/otel/sdk/resource in go.opentelemetry.io/otel/sdk v0.20.0
go: found go.opentelemetry.io/otel/sdk/trace in go.opentelemetry.io/otel/sdk v0.20.0
go: found go.opentelemetry.io/otel/trace in go.opentelemetry.io/otel/trace v0.20.0
go: found google.golang.org/grpc in google.golang.org/grpc v1.39.0
go: downloading go.opentelemetry.io/otel v1.0.0-RC1
go: downloading go.opentelemetry.io/otel/sdk v1.0.0-RC1
go: downloading go.opentelemetry.io/otel/trace v1.0.0-RC1
go: downloading gotest.tools v2.2.0+incompatible
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/stretchr/testify v1.7.0
go: downloading go.opentelemetry.io/otel/oteltest v1.0.0-RC1
go: downloading go.uber.org/goleak v1.1.10
go: downloading golang.org/x/sys v0.0.0-20210324051608-47abb6519492
go: downloading gotest.tools/v3 v3.0.3
go: downloading github.com/openzipkin/zipkin-go v0.2.5
go: downloading github.com/google/go-cmp v0.5.6
go: downloading golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
go: downloading google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a
go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: downloading google.golang.org/protobuf v1.26.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
go: downloading golang.org/x/lint v0.0.0-20200302205851-738671d3881b
go: downloading cloud.google.com/go v0.54.0
go: downloading google.golang.org/appengine v1.6.5
go: downloading golang.org/x/text v0.3.4
go: downloading golang.org/x/tools v0.0.0-20210106214847-113979e3529a
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading github.com/pkg/errors v0.9.1
$ cat go.mod
module github.com/ease-lab/vhive/utils/tracing/go
go 1.16
require (
github.com/containerd/containerd v1.5.2
github.com/sirupsen/logrus v1.8.1
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.21.0
go.opentelemetry.io/otel v1.0.0-RC1
go.opentelemetry.io/otel/exporters/zipkin v1.0.0-RC1
go.opentelemetry.io/otel/sdk v1.0.0-RC1
go.opentelemetry.io/otel/trace v1.0.0-RC1
google.golang.org/grpc v1.39.0
)
Can you verify a similar fix is being used for your testing @MBaczun and if you are able to reproduce my success?
Closing based on the lack of response. Please reopen if in error.
Description
Using the latest version of otelgrpc (
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.21.0
) causes a package conflict involving the semconv package (go.opentelemetry.io/otel/semconv
). In the example log bellow you can see me runninggo mod tidy
which results in this issue.I have found that forcibly using v0.20.0 of otelgrpc is a workaround for this. For example in the same setup as the log shown bellow, if I add the line
require go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0
to the fresh go.mod file before runninggo mod tidy
then the remaining packages get downloaded without any problems.Example log:
Environment
Steps To Reproduce
My actual code: vHive go tracing utility
go mod init github.com/ease-lab/vhive/utils/tracing/go
go mod tidy
To show that v0.21.0 of otelgrpc causes this issue:
require go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0
to the fresh go.mod filego mod tidy
should work now.Expected behavior
Using v0.21.0 of otelgrpc shouldn't result in a package conflict.