Skip to content

Commit a256d2b

Browse files
committed
fix: workaround for otel agent dependency causes orchestrion failure
Moved the blank import of `go.opentelemetry.io/collector/pdata/pprofile`` which was introduced to avoid `go mod tidy` from failing to resolve a coherent dependency closure into a new file guarded by a build tag so that it is not present in builds uder normal circumstances. This removes a dependency cycle caused by the `pprofile` package having a transitive dependency on `net/http`, while the `gopkg.in/DataDog/dd-trace-go.v1/internal` package is imported some code that is injected by orchestrion into `net/http` itself (resulting in a cycle, breaking builds).
1 parent 4f54e4f commit a256d2b

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

internal/agent-otel-workaround.go

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed
2+
// under the Apache License Version 2.0.
3+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
// Copyright 2022 Datadog, Inc.
5+
6+
//go:build otel_workaround
7+
8+
package internal
9+
10+
import (
11+
// OTel did a breaking change to the module go.opentelemetry.io/collector/pdata which is imported by the agent
12+
// and go.opentelemetry.io/collector/pdata/pprofile depends on it and is breaking because of it
13+
// For some reason the dependency closure won't let use upgrade this module past the point where it does not break anymore
14+
// So we are forced to add a blank import of this module to give us back the control over its version
15+
//
16+
// TODO: remove this once github.com/datadog-agent/pkg/trace has upgraded both modules past the breaking change
17+
_ "go.opentelemetry.io/collector/pdata/pprofile"
18+
)

internal/agent.go

-8
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ import (
1111
"os"
1212

1313
"gopkg.in/DataDog/dd-trace-go.v1/internal/log"
14-
15-
// OTel did a breaking change to the module go.opentelemetry.io/collector/pdata which is imported by the agent
16-
// and go.opentelemetry.io/collector/pdata/pprofile depends on it and is breaking because of it
17-
// For some reason the dependency closure won't let use upgrade this module past the point where it does not break anymore
18-
// So we are forced to add a blank import of this module to give us back the control over its version
19-
//
20-
// TODO: remove this once github.com/datadog-agent/pkg/trace has upgraded both modules past the breaking change
21-
_ "go.opentelemetry.io/collector/pdata/pprofile"
2214
)
2315

2416
const (

internal/version/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
// Tag specifies the current release tag. It needs to be manually
1414
// updated. A test checks that the value of Tag never points to a
1515
// git tag that is older than HEAD.
16-
const Tag = "v1.70.2"
16+
const Tag = "v1.70.3"
1717

1818
// Dissected version number. Filled during init()
1919
var (

0 commit comments

Comments
 (0)