Skip to content

Commit 638c3b4

Browse files
authored
Merge pull request #3896 from buildkite/kill-opentracing-take-2
Rip out opentracing tracing backend (take 2)
2 parents 8ff93bf + 893696c commit 638c3b4

20 files changed

Lines changed: 104 additions & 1036 deletions

agent/agent_configuration.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ type AgentConfiguration struct {
7272
TracingBackend string
7373
TracingServiceName string
7474
TracingPropagateTraceparent bool
75-
TraceContextEncoding string
7675
DisableWarningsFor []string
7776
AllowMultipartArtifactUpload bool
7877

agent/job_runner.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ BUILDKITE_HOOKS_SHELL
463463
BUILDKITE_SIGNAL_GRACE_PERIOD_SECONDS
464464
BUILDKITE_SSH_KEYSCAN
465465
BUILDKITE_STRICT_SINGLE_HOOKS
466-
BUILDKITE_TRACE_CONTEXT_ENCODING
467466
BUILDKITE_TRACING_BACKEND
468467
BUILDKITE_TRACING_SERVICE_NAME
469468
BUILDKITE_TRACING_TRACEPARENT
@@ -601,7 +600,6 @@ BUILDKITE_AGENT_JWKS_KEY_ID`
601600
setEnv("BUILDKITE_STRICT_SINGLE_HOOKS", fmt.Sprint(r.conf.AgentConfiguration.StrictSingleHooks))
602601
setEnv("BUILDKITE_CANCEL_SIGNAL_TIMEOUT", r.conf.AgentConfiguration.CancelSignalTimeout.String())
603602
setEnv("BUILDKITE_CANCEL_CLEANUP_TIMEOUT", r.conf.AgentConfiguration.CancelCleanupTimeout.String())
604-
setEnv("BUILDKITE_TRACE_CONTEXT_ENCODING", r.conf.AgentConfiguration.TraceContextEncoding)
605603

606604
if !r.conf.AgentConfiguration.AllowMultipartArtifactUpload {
607605
setEnv("BUILDKITE_NO_MULTIPART_ARTIFACT_UPLOAD", "true")

clicommand/agent_start.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ type AgentStartConfig struct {
201201
StrictSingleHooks bool `cli:"strict-single-hooks"`
202202
KubernetesExec bool `cli:"kubernetes-exec"`
203203
KubernetesContainerStartTimeout time.Duration `cli:"kubernetes-container-start-timeout"`
204-
TraceContextEncoding string `cli:"trace-context-encoding"`
205204
NoMultipartArtifactUpload bool `cli:"no-multipart-artifact-upload"`
206205

207206
// API + agent behaviour
@@ -236,10 +235,6 @@ func (asc AgentStartConfig) Features(ctx context.Context) []string {
236235
features = append(features, "acquire-job")
237236
}
238237

239-
if asc.TracingBackend == tracetools.BackendDatadog {
240-
features = append(features, "datadog-tracing")
241-
}
242-
243238
if asc.TracingBackend == tracetools.BackendOpenTelemetry {
244239
features = append(features, "opentelemetry-tracing")
245240
}
@@ -673,7 +668,7 @@ var AgentStartCommand = cli.Command{
673668
cancelCleanupTimeoutFlag,
674669
cli.StringFlag{
675670
Name: "tracing-backend",
676-
Usage: `Enable tracing for build jobs by specifying a backend, "datadog" or "opentelemetry"`,
671+
Usage: `Enable tracing for build jobs by specifying a backend. Currently only "opentelemetry" (or empty) is supported`,
677672
EnvVar: "BUILDKITE_TRACING_BACKEND",
678673
Value: "",
679674
},
@@ -763,7 +758,6 @@ var AgentStartCommand = cli.Command{
763758
// Other shared flags
764759
RedactedVars,
765760
StrictSingleHooksFlag,
766-
TraceContextEncodingFlag,
767761
NoMultipartArtifactUploadFlag,
768762
),
769763
Action: func(c *cli.Context) error {
@@ -893,10 +887,6 @@ var AgentStartCommand = cli.Command{
893887
}
894888
}
895889

896-
if _, err := tracetools.ParseEncoding(cfg.TraceContextEncoding); err != nil {
897-
return fmt.Errorf("while parsing trace context encoding: %v", err)
898-
}
899-
900890
mc := metrics.NewCollector(l, metrics.CollectorConfig{
901891
Datadog: cfg.MetricsDatadog,
902892
DatadogHost: cfg.MetricsDatadogHost,
@@ -1042,7 +1032,6 @@ var AgentStartCommand = cli.Command{
10421032
TracingBackend: cfg.TracingBackend,
10431033
TracingServiceName: cfg.TracingServiceName,
10441034
TracingPropagateTraceparent: cfg.TracingPropagateTraceparent,
1045-
TraceContextEncoding: cfg.TraceContextEncoding,
10461035
AllowMultipartArtifactUpload: !cfg.NoMultipartArtifactUpload,
10471036
KubernetesExec: cfg.KubernetesExec,
10481037
KubernetesContainerStartTimeout: cfg.KubernetesContainerStartTimeout,

clicommand/bootstrap.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/buildkite/agent/v4/internal/process"
1616
"github.com/buildkite/agent/v4/internal/self"
1717
"github.com/buildkite/agent/v4/logger"
18-
"github.com/buildkite/agent/v4/tracetools"
1918
"github.com/urfave/cli"
2019
)
2120

@@ -109,7 +108,6 @@ type BootstrapConfig struct {
109108
TracingServiceName string `cli:"tracing-service-name"`
110109
TracingTraceParent string `cli:"tracing-traceparent"`
111110
TracingPropagateTraceparent bool `cli:"tracing-propagate-traceparent"`
112-
TraceContextEncoding string `cli:"trace-context-encoding"`
113111
NoJobAPI bool `cli:"no-job-api"`
114112
DisableWarningsFor []string `cli:"disable-warnings-for" normalize:"list"`
115113
CheckoutAttempts int `cli:"checkout-attempts"`
@@ -364,7 +362,6 @@ var BootstrapCommand = cli.Command{
364362
ProfileFlag,
365363
RedactedVars,
366364
StrictSingleHooksFlag,
367-
TraceContextEncodingFlag,
368365
},
369366
Action: func(c *cli.Context) error {
370367
ctx := context.Background()
@@ -407,11 +404,6 @@ var BootstrapCommand = cli.Command{
407404
return fmt.Errorf("failed to parse cancel-signal: %w", err)
408405
}
409406

410-
traceContextCodec, err := tracetools.ParseEncoding(cfg.TraceContextEncoding)
411-
if err != nil {
412-
return fmt.Errorf("while parsing trace context encoding: %v", err)
413-
}
414-
415407
// Configure the bootstraper
416408
bootstrap := job.New(job.ExecutorConfig{
417409
AgentName: cfg.AgentName,
@@ -468,7 +460,6 @@ var BootstrapCommand = cli.Command{
468460
Tag: cfg.Tag,
469461
TracingBackend: cfg.TracingBackend,
470462
TracingServiceName: cfg.TracingServiceName,
471-
TraceContextCodec: traceContextCodec,
472463
TracingTraceParent: cfg.TracingTraceParent,
473464
TracingPropagateTraceparent: cfg.TracingPropagateTraceparent,
474465
JobAPI: !cfg.NoJobAPI,

clicommand/global.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,6 @@ var (
135135
"*_API_KEY",
136136
},
137137
}
138-
139-
TraceContextEncodingFlag = cli.StringFlag{
140-
Name: "trace-context-encoding",
141-
Usage: "Sets the inner encoding for BUILDKITE_TRACE_CONTEXT. Must be either json or gob",
142-
Value: "gob",
143-
EnvVar: "BUILDKITE_TRACE_CONTEXT_ENCODING",
144-
}
145138
)
146139

147140
// File path flags shared between agent start and bootstrap

clicommand/pipeline_upload.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"github.com/buildkite/agent/v4/internal/replacer"
3030
"github.com/buildkite/agent/v4/internal/stdin"
3131
"github.com/buildkite/agent/v4/logger"
32-
"github.com/buildkite/agent/v4/tracetools"
3332
"github.com/buildkite/go-pipeline"
3433
"github.com/buildkite/go-pipeline/jwkutil"
3534
"github.com/buildkite/go-pipeline/ordered"
@@ -621,14 +620,6 @@ func (cfg *PipelineUploadConfig) parseAndInterpolate(ctx context.Context, src st
621620
// yield below
622621

623622
default: // yes, interpolation
624-
// Pass the trace context from our environment to the pipeline.
625-
if tracing, has := environ.Get(tracetools.EnvVarTraceContextKey); has {
626-
if result.Env == nil {
627-
result.Env = ordered.NewMap[string, string](1)
628-
}
629-
result.Env.Set(tracetools.EnvVarTraceContextKey, tracing)
630-
}
631-
632623
// Do the interpolation.
633624
preferRuntimeEnv := experiments.IsEnabled(ctx, experiments.InterpolationPrefersRuntimeEnv)
634625
err = result.Interpolate(environ, preferRuntimeEnv)

go.mod

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ require (
4646
github.com/klauspost/compress v1.18.5
4747
github.com/lestrrat-go/jwx/v2 v2.1.6
4848
github.com/oleiade/reflections v1.1.0
49-
github.com/opentracing/opentracing-go v1.2.0
5049
github.com/pborman/uuid v1.2.1
5150
github.com/prometheus/client_golang v1.23.2
5251
github.com/puzpuzpuz/xsync/v2 v2.5.1
@@ -69,7 +68,6 @@ require (
6968
golang.org/x/term v0.42.0
7069
google.golang.org/api v0.275.0
7170
google.golang.org/protobuf v1.36.11
72-
gopkg.in/DataDog/dd-trace-go.v1 v1.74.8
7371
gopkg.in/yaml.v3 v3.0.1
7472
)
7573

@@ -83,26 +81,6 @@ require (
8381
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 // indirect
8482
github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 // indirect
8583
github.com/AzureAD/microsoft-authentication-library-for-go v1.7.1 // indirect
86-
github.com/DataDog/datadog-agent/comp/core/tagger/origindetection v0.77.2 // indirect
87-
github.com/DataDog/datadog-agent/pkg/obfuscate v0.77.2 // indirect
88-
github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/attributes v0.77.2 // indirect
89-
github.com/DataDog/datadog-agent/pkg/proto v0.77.2 // indirect
90-
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.77.2 // indirect
91-
github.com/DataDog/datadog-agent/pkg/template v0.77.2 // indirect
92-
github.com/DataDog/datadog-agent/pkg/trace v0.77.2 // indirect
93-
github.com/DataDog/datadog-agent/pkg/trace/log v0.77.2 // indirect
94-
github.com/DataDog/datadog-agent/pkg/trace/otel v0.77.2 // indirect
95-
github.com/DataDog/datadog-agent/pkg/trace/stats v0.77.2 // indirect
96-
github.com/DataDog/datadog-agent/pkg/trace/traceutil v0.77.2 // indirect
97-
github.com/DataDog/datadog-agent/pkg/util/log v0.77.2 // indirect
98-
github.com/DataDog/datadog-agent/pkg/util/scrubber v0.77.2 // indirect
99-
github.com/DataDog/datadog-agent/pkg/version v0.77.2 // indirect
100-
github.com/DataDog/dd-trace-go/v2 v2.7.1 // indirect
101-
github.com/DataDog/go-libddwaf/v4 v4.9.0 // indirect
102-
github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20260217080614-b0f4edc38a6d // indirect
103-
github.com/DataDog/go-sqllexer v0.2.1 // indirect
104-
github.com/DataDog/go-tuf v1.1.1-0.5.2 // indirect
105-
github.com/DataDog/sketches-go v1.4.8 // indirect
10684
github.com/Microsoft/go-winio v0.6.2 // indirect
10785
github.com/agnivade/levenshtein v1.2.1 // indirect
10886
github.com/alexflint/go-arg v1.5.1 // indirect
@@ -127,18 +105,14 @@ require (
127105
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
128106
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
129107
github.com/cespare/xxhash/v2 v2.3.0 // indirect
130-
github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect
131108
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
132-
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
133109
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 // indirect
134110
github.com/dnephin/pflag v1.0.7 // indirect
135-
github.com/ebitengine/purego v0.10.0 // indirect
136111
github.com/fatih/color v1.18.0 // indirect
137112
github.com/felixge/httpsnoop v1.0.4 // indirect
138113
github.com/fsnotify/fsnotify v1.9.0 // indirect
139114
github.com/go-logr/logr v1.4.3 // indirect
140115
github.com/go-logr/stdr v1.2.2 // indirect
141-
github.com/go-ole/go-ole v1.3.0 // indirect
142116
github.com/goccy/go-json v0.10.6 // indirect
143117
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
144118
github.com/google/s2a-go v0.1.9 // indirect
@@ -147,78 +121,47 @@ require (
147121
github.com/googleapis/gax-go/v2 v2.21.0 // indirect
148122
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
149123
github.com/hashicorp/go-version v1.9.0 // indirect
150-
github.com/json-iterator/go v1.1.12 // indirect
151124
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
152-
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
153125
github.com/kylelemons/godebug v1.1.0 // indirect
154126
github.com/lestrrat-go/blackmagic v1.0.4 // indirect
155127
github.com/lestrrat-go/httpcc v1.0.1 // indirect
156128
github.com/lestrrat-go/httprc v1.0.6 // indirect
157129
github.com/lestrrat-go/iter v1.0.2 // indirect
158130
github.com/lestrrat-go/option v1.0.1 // indirect
159-
github.com/linkdata/deadlock v0.5.5 // indirect
160-
github.com/lufia/plan9stats v0.0.0-20260330125221-c963978e514e // indirect
161131
github.com/mattn/go-colorable v0.1.14 // indirect
162132
github.com/mattn/go-isatty v0.0.20 // indirect
163133
github.com/mattn/go-runewidth v0.0.16 // indirect
164-
github.com/minio/simdjson-go v0.4.5 // indirect
165-
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
166-
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
167134
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
168135
github.com/olekukonko/tablewriter v0.0.5 // indirect
169-
github.com/outcaste-io/ristretto v0.2.3 // indirect
170-
github.com/petermattis/goid v0.0.0-20260330135022-df67b199bc81 // indirect
171-
github.com/philhofer/fwd v1.2.0 // indirect
172136
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
173-
github.com/pkg/errors v0.9.1 // indirect
174-
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
175-
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
176-
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
177137
github.com/prometheus/client_model v0.6.2 // indirect
178138
github.com/prometheus/common v0.67.5 // indirect
179139
github.com/prometheus/procfs v0.20.1 // indirect
180-
github.com/puzpuzpuz/xsync/v3 v3.5.1 // indirect
181140
github.com/qri-io/jsonpointer v0.1.1 // indirect
182141
github.com/rivo/uniseg v0.4.7 // indirect
183142
github.com/russross/blackfriday/v2 v2.1.0 // indirect
184143
github.com/saracen/zipextra v0.0.0-20250129175152-f1aa42d25216 // indirect
185-
github.com/secure-systems-lab/go-securesystemslib v0.10.0 // indirect
186144
github.com/segmentio/asm v1.2.1 // indirect
187-
github.com/shirou/gopsutil/v4 v4.26.3 // indirect
188-
github.com/stretchr/testify v1.11.1 // indirect
189-
github.com/tinylib/msgp v1.6.3 // indirect
190-
github.com/tklauser/go-sysconf v0.3.16 // indirect
191-
github.com/tklauser/numcpus v0.11.0 // indirect
192-
github.com/trailofbits/go-mutexasserts v0.0.0-20250514102930-c1f3d2e37561 // indirect
145+
github.com/spf13/cobra v1.10.2 // indirect
146+
github.com/spf13/pflag v1.0.10 // indirect
193147
github.com/vektah/gqlparser/v2 v2.5.32 // indirect
194148
github.com/wolfeidau/quickzip v1.0.2 // indirect
195-
github.com/yusufpapurcu/wmi v1.2.4 // indirect
196149
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
197-
go.opentelemetry.io/collector/component v1.55.0 // indirect
198-
go.opentelemetry.io/collector/featuregate v1.55.0 // indirect
199-
go.opentelemetry.io/collector/pdata v1.55.0 // indirect
200-
go.opentelemetry.io/collector/pdata/pprofile v0.149.0 // indirect
201150
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.68.0 // indirect
202151
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0 // indirect
203152
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 // indirect
204153
go.opentelemetry.io/otel/metric v1.43.0 // indirect
205154
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
206-
go.uber.org/atomic v1.11.0 // indirect
207155
go.uber.org/multierr v1.11.0 // indirect
208-
go.uber.org/zap v1.27.1 // indirect
209156
go.yaml.in/yaml/v2 v2.4.4 // indirect
210-
go.yaml.in/yaml/v3 v3.0.4 // indirect
211-
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect
212157
golang.org/x/mod v0.35.0 // indirect
213158
golang.org/x/text v0.36.0 // indirect
214159
golang.org/x/time v0.15.0 // indirect
215160
golang.org/x/tools v0.44.0 // indirect
216-
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
217161
google.golang.org/genproto v0.0.0-20260406210006-6f92a3bedf2d // indirect
218162
google.golang.org/genproto/googleapis/api v0.0.0-20260406210006-6f92a3bedf2d // indirect
219163
google.golang.org/genproto/googleapis/rpc v0.0.0-20260406210006-6f92a3bedf2d // indirect
220164
google.golang.org/grpc v1.80.0 // indirect
221-
gopkg.in/ini.v1 v1.67.1 // indirect
222165
gopkg.in/yaml.v2 v2.4.0 // indirect
223166
gotest.tools/gotestsum v1.13.0 // indirect
224167
mvdan.cc/gofumpt v0.9.2 // indirect

0 commit comments

Comments
 (0)