Skip to content

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

@purple4reina

Description

@purple4reina

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions