-
Notifications
You must be signed in to change notification settings - Fork 564
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
otelhttp: Bazel fails to build due to io_opentelemetry_go_otel_internal_metric #872
Comments
Please include a minimal set of steps to reproduce the error here. Have you tried building with Go 1.15+? |
Yeah. In order to give more context, I use Bazel These are the steps I follow:
Also, I haven't tried building with Go 1.15+ due to problems with the version of other dependencies, so that's not an option in this case. |
Thanks for the added info. I do not have a setup to test this immediately, but my first guess is going to be that the Go version is blocking this. The |
I spent many hours today writing patches for Gazelle to apply to fix this problem and several others like it. The patches work, to a point, but the real solution turned out to be this: bazel clean --expunge I don't know why, but either Gazelle or Bazel was consulting some stale files, and failing to generate BUILD.bazel files that capture the true needs of these Go packages and their containing modules. Please try running that, and then building without any patches in place. Let us know if that did the trick. |
* Make metric test helpers public * Move everything metric test related to api/metric/metrictest * Unify metric measurement assertions Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
I am getting a similar error
When I look into the
When I change those lines to be (note the change in the location of the
This allows everything to work. I have tried All of my My Go version is 1.18.1
|
@michaelrios same issue here. I think opentelemetry may need to publish new go.opentelemetry.io/otel/exporters/otlp module which contains this package: issue opened: |
FWIW the go_repository(
name = "io_opentelemetry_go_otel",
build_file_proto_mode = "disable",
build_directives = [
"gazelle:go_visibility @io_opentelemetry_go_otel_metric//:__subpackages__",
], # keep
importpath = "go.opentelemetry.io/otel",
sum = "h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw=",
version = "v1.9.0",
)
go_repository(
name = "io_opentelemetry_go_otel_exporters_otlp_otlptrace",
build_file_proto_mode = "disable",
build_directives = [
"gazelle:resolve go go.opentelemetry.io/otel/exporters/otlp/internal @io_opentelemetry_go_otel//exporters/otlp/internal",
"gazelle:resolve go go.opentelemetry.io/otel/exporters/otlp/internal/envconfig @io_opentelemetry_go_otel//exporters/otlp/internal/envconfig",
],
importpath = "go.opentelemetry.io/otel/exporters/otlp/otlptrace",
sum = "h1:LrHL1A3KqIgAgi6mK7Q0aczmzU414AONAGT5xtnp+uo=",
version = "v1.8.0",
) |
@uhthomas Thanks a lot! This worked for me too. I've also bumped the second one to go_repository(
name = "io_opentelemetry_go_otel_exporters_otlp_otlptrace",
build_directives = [
"gazelle:resolve go go.opentelemetry.io/otel/exporters/otlp/internal @io_opentelemetry_go_otel//exporters/otlp/internal",
"gazelle:resolve go go.opentelemetry.io/otel/exporters/otlp/internal/envconfig @io_opentelemetry_go_otel//exporters/otlp/internal/envconfig",
],
build_file_proto_mode = "disable",
importpath = "go.opentelemetry.io/otel/exporters/otlp/otlptrace",
sum = "h1:NN90Cuna0CnBg8YNu1Q0V35i2E8LDByFOwHRCq/ZP9I=",
version = "v1.9.0",
) |
Fix for
|
I found that in addition to your changes, the go_repository(
name = "io_opentelemetry_go_otel_exporters_otlp_otlptrace_otlptracegrpc",
build_directives = [
"gazelle:resolve go go.opentelemetry.io/otel/exporters/otlp/internal @io_opentelemetry_go_otel//exporters/otlp/internal",
],
build_file_proto_mode = "disable",
importpath = "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc",
sum = "h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4=",
version = "v1.10.0",
) |
Thanks all! For |
Just ran into this issue myself and was able to work around it with the build directives described but I found a slightly nicer solution that I think further points the finger at something being incorrect in gazelle. The issue is caused by the inclusion of this
I don't know the provenance of this repo but I suspect there was a I can't figure out how to stop gazelle from generating this
|
I'm using Bazel in my project and trying to implement
otelhttp
in Go.This is the actual library I'm importing:
When I try to build the package without
otelhttp
it build successfully, but whenever I try to use it, I got this error:Mac mini M1
OS: [MacOS]
Go Version: [1.14]
opentelemetry-go version: [0.21.0]
The text was updated successfully, but these errors were encountered: