-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Ambiguous import error with opentelemetry collector builder #10476
Comments
I am unable to reproduce with OCB v0.106.0 and the following manifest: name: otelcol-deb
description: otel collector distribution for tenable
output_path: ./otelcol-dev
otelcol_version: 0.106.0
exporters:
- gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.106.0
- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.106.0
processors:
- gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.106.0
receivers:
- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.106.0 I get the following logs:
|
You got same module but different versions, try force the version in go.mod. Something like:
If you want to avoid // This is necessary to avoid ambiguous import error
// see https://github.com/open-telemetry/opentelemetry-collector/issues/10476
import _ "google.golang.org/genproto/googleapis/type/date" |
I encountered the same issue, and found that the following fixed it:
|
I tried: go get google.golang.org/genproto/googleapis/api
go mod tidy I get: go: upgraded google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 => v0.0.0-20250313205543-e70fdf4c4cb4
go: dql-events/internal/web_data/exports imports
cloud.google.com/go/storage imports
google.golang.org/grpc/stats/opentelemetry: ambiguous import: found package google.golang.org/grpc/stats/opentelemetry in multiple modules:
google.golang.org/grpc v1.71.0 (/Users/work/source/go/pkg/mod/google.golang.org/[email protected]/stats/opentelemetry)
google.golang.org/grpc/stats/opentelemetry v0.0.0-20241028142157-ada6787961b3 (/Users/work/source/go/pkg/mod/google.golang.org/grpc/stats/[email protected]) I also tried and failed with: go get -u cloud.google.com/go/storage
go: downloading cloud.google.com/go/iam v1.4.1
go: downloading google.golang.org/api v0.224.0
go: cloud.google.com/go/storage imports
google.golang.org/grpc/stats/opentelemetry: ambiguous import: found package google.golang.org/grpc/stats/opentelemetry in multiple modules:
google.golang.org/grpc v1.71.0 (/Users/work/source/go/pkg/mod/google.golang.org/[email protected]/stats/opentelemetry)
google.golang.org/grpc/stats/opentelemetry v0.0.0-20241028142157-ada6787961b3 (/Users/work/source/go/pkg/mod/google.golang.org/grpc/stats/[email protected])
go: downloading cloud.google.com/go/longrunning v0.6.5 |
We need to see your manifest and have more details on whether you are using custom components to provide further help. If you are also facing this issue, could you please post the full Collector builder manifest you are using? |
Thanks. In the meantime Gemini provided a working fix: "Historically, sub-packages of Complete Reset and Rebuild:Remove go.mod and go.sum: Clean the Module Cache: Reinitialize Modules: Add the Required Dependency: Tidy Dependencies: Build/Run Your Code: |
i face same issue.
i think, this issue happening cause is later google.golang.org/[email protected]. i add below code to go.mod then, resolve this issue
but this solution is temporary. |
Describe the bug
cross posting from here: open-telemetry/opentelemetry.io#4738
After following the instructions up to Running and debugging the receiver
I get unexpected output
Steps to reproduce
Builder conf:
The text was updated successfully, but these errors were encountered: