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

[BUG]: go vet is failing since v1.70.0 #3163

Closed
kalosisz opened this issue Feb 7, 2025 · 12 comments
Closed

[BUG]: go vet is failing since v1.70.0 #3163

kalosisz opened this issue Feb 7, 2025 · 12 comments
Assignees
Labels
bug unintended behavior that has to be fixed

Comments

@kalosisz
Copy link

kalosisz commented Feb 7, 2025

Tracer Version(s)

1.71.1

Go Version(s)

go version go1.23.5 linux/amd64

Bug Report

I have a go vet check in my CI process and it started failing and producing this logic

... git:(dependabot/go_modules/production-dependencies-f003f5ebd9) ✗ go vet ./...      
# github.com/DataDog/datadog-agent/pkg/trace/traceutil
../../go/pkg/mod/github.com/!data!dog/datadog-agent/pkg/[email protected]/traceutil/otel_util.go:413:46: not enough arguments in call to tr.ResourceToSource
        have (context.Context, pcommon.Resource, "go.opentelemetry.io/otel/attribute".Set)
        want (context.Context, pcommon.Resource, "go.opentelemetry.io/otel/attribute".Set, "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes".HostFromAttributesHandler)

Please check the dependencies of dd-trace-go.

Reproduction Code

Running go vet using v1.71.1 as a dependency.

Error Logs

No response

Go Env Output

GO111MODULE='on'
GOARCH='amd64'
GOBIN=''
GOCACHE='...'
GOENV='...'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='...'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='...'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='....'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='....'
GOVCS=''
GOVERSION='go1.23.5'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='...'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='....'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2872493264=/tmp/go-build -gno-record-gcc-switches'
@kalosisz kalosisz added the bug unintended behavior that has to be fixed label Feb 7, 2025
@github-actions github-actions bot added the needs-triage New issues that have not yet been triaged label Feb 7, 2025
@darccio
Copy link
Member

darccio commented Feb 7, 2025

Thanks @kalosisz for getting in touch. Please, can you provide your go env output?

@darccio darccio removed the needs-triage New issues that have not yet been triaged label Feb 7, 2025
@kalosisz
Copy link
Author

kalosisz commented Feb 7, 2025

Hey, here is the output

GO111MODULE='on'
GOARCH='amd64'
GOBIN=''
GOCACHE='...'
GOENV='...'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='...'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='...'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='....'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='....'
GOVCS=''
GOVERSION='go1.23.5'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='...'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='....'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2872493264=/tmp/go-build -gno-record-gcc-switches'

@darccio
Copy link
Member

darccio commented Feb 7, 2025

Thanks again. We'll check this during today.

@darccio darccio self-assigned this Feb 7, 2025
@darccio
Copy link
Member

darccio commented Feb 7, 2025

Right now we aren't able to reproduce it. We tried on a clean module cache and GOPROXY=https://proxy.golang.org,direct. We'll keep investigating.

@LamineKouissi
Copy link

Hello @kalosisz, Could you please share your go.mod file? I might be able to help

@kalosisz
Copy link
Author

Do you need all the files, I can easily share Datadog related direct and indirect dependencies

// direct
gopkg.in/DataDog/dd-trace-go.v1 v1.71.1

// indirect
github.com/DataDog/appsec-internal-go v1.10.0 // indirect
github.com/DataDog/datadog-agent/comp/core/tagger/origindetection v0.62.1 // indirect
github.com/DataDog/datadog-agent/pkg/obfuscate v0.62.1 // indirect
github.com/DataDog/datadog-agent/pkg/proto v0.62.1 // indirect
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.62.1 // indirect
github.com/DataDog/datadog-agent/pkg/trace v0.62.1 // indirect
github.com/DataDog/datadog-agent/pkg/util/log v0.62.1 // indirect
github.com/DataDog/datadog-agent/pkg/util/scrubber v0.62.1 // indirect
github.com/DataDog/datadog-agent/pkg/version v0.62.1 // indirect
github.com/DataDog/datadog-go/v5 v5.6.0 // indirect
github.com/DataDog/go-libddwaf/v3 v3.5.1 // indirect
github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20241206090539-a14610dc22b6 // indirect
github.com/DataDog/go-sqllexer v0.0.20 // indirect
github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.25.0 // indirect
github.com/DataDog/sketches-go v1.4.6 // indirect

@LamineKouissi let me know if this helps

@kalosisz
Copy link
Author

Hey @LamineKouissi and @darccio , I've reproduced the error and published it in https://github.com/kalosisz/datadog-error

After running go get gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer it needed an update go get -u -t ./....

Let me know if this helps.

@darccio
Copy link
Member

darccio commented Feb 10, 2025

Thanks @kalosisz. It makes sense that a go get may lead to this kind of issues. Sometimes it's an OpenTelemetry packaging problem, but I'm going to double check that.

@kalosisz
Copy link
Author

@darccio I was incomplete. After running go get it go vet was working. After updating the indirect dependencies, it started failing.

@darccio
Copy link
Member

darccio commented Feb 10, 2025

The workaround for this is to add a replace directive:

replace github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes => github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.24.0

As this dependency comes from our datadog-agent, we'll submit a PR for pinning the library to this version.

@kalosisz
Copy link
Author

@darccio thanks! Dependabot is managing the updates, I'll pin it to that version.

@darccio
Copy link
Member

darccio commented Feb 10, 2025

Update: the agent is alredy updated DataDog/datadog-agent#33370, the fix will be released in their next release.

The replace directive needs to be added in projects depending on dd-trace-go. dd-trace-go already pins against a specific version of github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes, but the Go toolchain doesn't apply replace directives from your project's dependencies.

@darccio darccio closed this as completed Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unintended behavior that has to be fixed
Projects
None yet
Development

No branches or pull requests

3 participants