You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
Launch a clean development environment (new install or clean all the packages already on the disk)
Clone a working repository using go-redis
use go get
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
The text was updated successfully, but these errors were encountered:
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
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
The text was updated successfully, but these errors were encountered: