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

Error not enough arguments in call to tr.ResourceToSource #186

Open
purple4reina opened this issue Jan 29, 2025 · 1 comment
Open

Error not enough arguments in call to tr.ResourceToSource #186

purple4reina opened this issue Jan 29, 2025 · 1 comment
Assignees

Comments

@purple4reina
Copy link
Contributor

purple4reina commented Jan 29, 2025

Problem

Recently we have been seeing the following error when building lambda functions which require datadog-lambda-go

# github.com/DataDog/datadog-agent/pkg/trace/traceutil
../../../../../../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)

Cause

The error is due to a package version mismatch between github.com/DataDog/datadog-agent/pkg/trace and github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes. The latest version of the latter package changed the signature of an exported method.

Solution

Downgrade github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes to v0.24.0. This will ensure the correct signature for the exported method is found.

Specifically, if you have this in your go.mod file

    github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.25.0 // indirect

Change it to

    github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.24.0 // indirect

Then run go mod tidy and reattempt to build your package.

@purple4reina
Copy link
Contributor Author

Relevant datadog-agent PR: DataDog/datadog-agent#33370

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

1 participant