Skip to content

[BUG] Error when updating dependencies #41462

@b1gb4by

Description

@b1gb4by

Agent Environment

  • Go: 1.25.1
  • datadog-agent/pkg/trace: v0.70.2
  • Build environment: Docker (golang:1.25.1-alpine)

Describe what happened:

Build fails with type mismatch error between github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes/source and github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/attributes/source.

Error:

0.192 github.com/DataDog/datadog-agent/pkg/trace/transform
0.204 # github.com/DataDog/datadog-agent/pkg/trace/transform
0.204 /go/pkg/mod/github.com/!data!dog/datadog-agent/pkg/[email protected]/transform/transform.go:270:11: cannot use source.Source{…} (value of struct type "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes/source".Source) as "github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/attributes/source".Source value in assignment
0.204 /go/pkg/mod/github.com/!data!dog/datadog-agent/pkg/[email protected]/transform/transform.go:276:9: invalid case source.HostnameKind in switch on src.Kind (mismatched types "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes/source".Kind and "github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/attributes/source".Kind)

I tried the workaround suggested in #41228 (adding the replace directive), but the issue persists.

Describe what you expected:

Build should succeed with the replace directive in go.mod.

Steps to reproduce the issue:

  1. Use the following Datadog dependencies:
require (
    github.com/DataDog/dd-trace-go/v2 v2.2.3
)

// indirect dependencies
github.com/DataDog/datadog-agent/pkg/trace v0.70.2
github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/attributes v0.72.0-devel
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.33.0

replace github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/attributes => github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/attributes v0.70.2
  1. Run go mod tidy
  2. Build with Docker: docker build .

Additional environment details (Operating System, Cloud provider, etc):

Docker build on macOS (arm64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingLabel for issues waiting a Datadog member's response.team/triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions