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

redis calls a non existing otel/api/trace package in the go.opentelemetry.io latest version - happens in clean development environments without the old code #1544

Closed
gonzalochief opened this issue Oct 19, 2020 · 2 comments

Comments

@gonzalochief
Copy link

I've been using the go-redis package for a year now, and two weeks ago i started working in a clean development environment (linux OS) and when i tried to build the code (which runs well in the old machine), the build command sends an error that says that it cannot find the "go.opentelemetry.io/otel/api/trace" package, which is imported in many files of the go-redis package.

Expected Behavior

When building an existing working code usung go-redis in a new development environment (clean linux install), the build command should complete as it does on old development environments, as no changes in code have been made.

Current Behavior

The build command fails due to the fact that it tries to get the "go.opentelemetry.io/otel/api/trace" package that has been moved by the opentelemetry team to the otel package, so in the latest version, the "go.opentelemetry.io/otel/api/trace" does not exist.

Possible Solution

I've fixed the code locally by doing the following changes in the code:
File: internal/pool/conn.go
-change span trace.Span to span otel.Span in line 69 and 83, pointing the Span type to the new trace location inside the otel package.
-delete "go.opentelemetry.io/otel/api/trace" import
-add the "go.opentelemetry.io/otel" import

File: internal/util.go
-change span trace.Span to span otel.Span in line 14, and 65, pointing the Span type to the new trace location inside the otel package.
-change trace.SpanFromContext to otel.SpanFromContext in line 66 and 78, pointing the Span type to the new trace location inside the otel package.
-delete "go.opentelemetry.io/otel/api/trace" import
-add the "go.opentelemetry.io/otel" import

File: options.go
-change span trace.Span to span otel.Span in line 296, pointing the Span type to the new trace location inside the otel package.
-delete "go.opentelemetry.io/otel/api/trace" import
-add the "go.opentelemetry.io/otel" import

File: redis.go
-change span trace.Span to span otel.Span in line 228, 302, and 329, pointing the Span type to the new trace location inside the otel package.
-delete "go.opentelemetry.io/otel/api/trace" import
-add the "go.opentelemetry.io/otel" import

Steps to Reproduce

  1. Launch a clean development environment (new install or clean all the packages already on the disk)
  2. Clone a working repository using go-redis
  3. use go get
  4. use go build

Context (Environment)

I have been usin the go-redis package without issues for a year now. I make a clean install of linux and the code stopped building,, because the go-redis package keeps redirecting the trace package to the old location. The team in opentelemetry moved the code of the trace package to the otel package and delete the old trace package.
The code keeps building in the old environment as the original (now non-existing trace package is still on my disk). I got the same error on the old machine when i cleaned the packages, and also when i do docker build (which is pulling teh code fromm the public repo)

Detailed Description

The error gets solved just by updating the package name from trace to otel, and refreshing the imports and mods.

Possible Implementation

Privided above (all changes to original code are above). I submitted a pull request from the repository that i cloned and in whick i fixed the error localy .
Pull request 1542

@IceTeaz
Copy link

IceTeaz commented Oct 20, 2020

same issue

@vmihailenco
Copy link
Collaborator

Duplicate of #1534. I also replied at the PR.

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

No branches or pull requests

3 participants