Skip to content

Commit fcb1ad4

Browse files
authored
Merge branch 'main' into dario.castane/reduce-lock-contention-getgitmetadata
2 parents 3d10986 + be3543a commit fcb1ad4

File tree

143 files changed

+17853
-378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+17853
-378
lines changed

.github/workflows/appsec.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ jobs:
258258

259259
test-app-smoke-tests:
260260
name: Smoke Tests
261+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner == 'DataDog'
261262
uses: DataDog/appsec-go-test-app/.github/workflows/smoke-tests.yml@main
262263
with:
263264
dd-trace-go-version: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}

.github/workflows/unit-integration-tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ jobs:
3939
- name: golangci-lint
4040
uses: reviewdog/action-golangci-lint@v2
4141
with:
42+
golangci_lint_flags: "--timeout 10m" # We are hitting timeout when there is no cache
4243
go_version: ${{ inputs.go-version }}
43-
golangci_lint_version: v1.52.2
44+
golangci_lint_version: v1.59.1
4445
fail_on_error: true
4546
reporter: github-pr-review
4647

@@ -81,7 +82,7 @@ jobs:
8182
DD_POOL_TRACE_CHECK_FAILURES: true
8283
DD_DISABLE_ERROR_RESPONSES: true
8384
cassandra:
84-
image: cassandra:3.7
85+
image: cassandra:3.11
8586
env:
8687
JVM_OPTS: "-Xms750m -Xmx750m"
8788
ports:

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ stages:
44
- test-apps
55

66
variables:
7-
# This base image is created here: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/30723596
8-
BASE_CI_IMAGE: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:dd-trace-go-30723596
7+
# This base image is created here: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/38806487
8+
BASE_CI_IMAGE: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:dd-trace-go-38806487
99
INDEX_FILE: index.txt
1010
KUBERNETES_SERVICE_ACCOUNT_OVERWRITE: dd-trace-go
1111
FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: "true"

.gitlab/macrobenchmarks.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ go122-baseline:
4646
ENABLE_PROFILING: "false"
4747
ENABLE_APPSEC: "false"
4848
DD_PROFILING_EXECUTION_TRACE_ENABLED: "false"
49-
GO_VERSION: "1.22.1"
49+
GO_VERSION: "1.22.5"
5050

5151
go122-only-trace:
5252
extends: .benchmarks
@@ -56,7 +56,7 @@ go122-only-trace:
5656
ENABLE_PROFILING: "false"
5757
ENABLE_APPSEC: "false"
5858
DD_PROFILING_EXECUTION_TRACE_ENABLED: "false"
59-
GO_VERSION: "1.22.1"
59+
GO_VERSION: "1.22.5"
6060

6161
go122-only-profile:
6262
extends: .benchmarks
@@ -66,7 +66,7 @@ go122-only-profile:
6666
ENABLE_PROFILING: "true"
6767
ENABLE_APPSEC: "false"
6868
DD_PROFILING_EXECUTION_TRACE_ENABLED: "false"
69-
GO_VERSION: "1.22.1"
69+
GO_VERSION: "1.22.5"
7070

7171
go122-profile-trace:
7272
extends: .benchmarks
@@ -76,7 +76,7 @@ go122-profile-trace:
7676
ENABLE_PROFILING: "true"
7777
ENABLE_APPSEC: "false"
7878
DD_PROFILING_EXECUTION_TRACE_ENABLED: "false"
79-
GO_VERSION: "1.22.1"
79+
GO_VERSION: "1.22.5"
8080

8181
go122-trace-asm:
8282
extends: .benchmarks
@@ -86,7 +86,7 @@ go122-trace-asm:
8686
ENABLE_PROFILING: "false"
8787
ENABLE_APPSEC: "true"
8888
DD_PROFILING_EXECUTION_TRACE_ENABLED: "false"
89-
GO_VERSION: "1.22.1"
89+
GO_VERSION: "1.22.5"
9090

9191
go122-profile-trace-asm:
9292
extends: .benchmarks
@@ -96,64 +96,64 @@ go122-profile-trace-asm:
9696
ENABLE_PROFILING: "true"
9797
ENABLE_APPSEC: "true"
9898
DD_PROFILING_EXECUTION_TRACE_ENABLED: "false"
99-
GO_VERSION: "1.22.1"
99+
GO_VERSION: "1.22.5"
100100

101-
go120-baseline:
101+
go121-baseline:
102102
extends: .benchmarks
103103
variables:
104104
ENABLE_DDPROF: "false"
105105
ENABLE_TRACING: "false"
106106
ENABLE_PROFILING: "false"
107107
ENABLE_APPSEC: "false"
108108
DD_PROFILING_EXECUTION_TRACE_ENABLED: "false"
109-
GO_VERSION: "1.20.14"
109+
GO_VERSION: "1.21.12"
110110

111-
go120-only-trace:
111+
go121-only-trace:
112112
extends: .benchmarks
113113
variables:
114114
ENABLE_DDPROF: "false"
115115
ENABLE_TRACING: "true"
116116
ENABLE_PROFILING: "false"
117117
ENABLE_APPSEC: "false"
118118
DD_PROFILING_EXECUTION_TRACE_ENABLED: "false"
119-
GO_VERSION: "1.20.14"
119+
GO_VERSION: "1.21.12"
120120

121-
go120-only-profile:
121+
go121-only-profile:
122122
extends: .benchmarks
123123
variables:
124124
ENABLE_DDPROF: "false"
125125
ENABLE_TRACING: "false"
126126
ENABLE_PROFILING: "true"
127127
ENABLE_APPSEC: "false"
128128
DD_PROFILING_EXECUTION_TRACE_ENABLED: "false"
129-
GO_VERSION: "1.20.14"
129+
GO_VERSION: "1.21.12"
130130

131-
go120-profile-trace:
131+
go121-profile-trace:
132132
extends: .benchmarks
133133
variables:
134134
ENABLE_DDPROF: "false"
135135
ENABLE_TRACING: "true"
136136
ENABLE_PROFILING: "true"
137137
ENABLE_APPSEC: "false"
138138
DD_PROFILING_EXECUTION_TRACE_ENABLED: "false"
139-
GO_VERSION: "1.20.14"
139+
GO_VERSION: "1.21.12"
140140

141-
go120-trace-asm:
141+
go121-trace-asm:
142142
extends: .benchmarks
143143
variables:
144144
ENABLE_DDPROF: "false"
145145
ENABLE_TRACING: "true"
146146
ENABLE_PROFILING: "false"
147147
ENABLE_APPSEC: "true"
148148
DD_PROFILING_EXECUTION_TRACE_ENABLED: "false"
149-
GO_VERSION: "1.20.14"
149+
GO_VERSION: "1.21.12"
150150

151-
go120-profile-trace-asm:
151+
go121-profile-trace-asm:
152152
extends: .benchmarks
153153
variables:
154154
ENABLE_DDPROF: "false"
155155
ENABLE_TRACING: "true"
156156
ENABLE_PROFILING: "true"
157157
ENABLE_APPSEC: "true"
158158
DD_PROFILING_EXECUTION_TRACE_ENABLED: "false"
159-
GO_VERSION: "1.20.14"
159+
GO_VERSION: "1.21.12"

CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ go.sum
2828
/datastreams @Datadog/data-streams-monitoring
2929
/internal/datastreams @Datadog/data-streams-monitoring
3030

31+
# civisibility
32+
/internal/civisibility @DataDog/ci-app-libraries
33+
3134
# Gitlab configuration
3235
.gitlab-ci.yml @DataDog/dd-trace-go-guild @DataDog/apm-core-reliability-and-performance
3336
/.gitlab-ci @DataDog/dd-trace-go-guild @DataDog/apm-core-reliability-and-performance

contrib/99designs/gqlgen/tracer.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ func (t *gqlTracer) Validate(_ graphql.ExecutableSchema) error {
104104
func (t *gqlTracer) InterceptOperation(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler {
105105
opCtx := graphql.GetOperationContext(ctx)
106106
span, ctx := t.createRootSpan(ctx, opCtx)
107-
ctx, req := graphqlsec.StartRequestOperation(ctx, nil /* root */, span, types.RequestOperationArgs{
107+
ctx, req := graphqlsec.StartRequestOperation(ctx, span, types.RequestOperationArgs{
108108
RawQuery: opCtx.RawQuery,
109109
OperationName: opCtx.OperationName,
110110
Variables: opCtx.Variables,
111111
})
112-
ctx, query := graphqlsec.StartExecutionOperation(ctx, req, span, types.ExecutionOperationArgs{
112+
ctx, query := graphqlsec.StartExecutionOperation(ctx, span, types.ExecutionOperationArgs{
113113
Query: opCtx.RawQuery,
114114
OperationName: opCtx.OperationName,
115115
Variables: opCtx.Variables,
@@ -167,8 +167,7 @@ func (t *gqlTracer) InterceptField(ctx context.Context, next graphql.Resolver) (
167167

168168
span, ctx := tracer.StartSpanFromContext(ctx, fieldOp, opts...)
169169
defer func() { span.Finish(tracer.WithError(err)) }()
170-
171-
ctx, op := graphqlsec.StartResolveOperation(ctx, graphqlsec.FromContext[*types.ExecutionOperation](ctx), span, types.ResolveOperationArgs{
170+
ctx, op := graphqlsec.StartResolveOperation(ctx, span, types.ResolveOperationArgs{
172171
Arguments: fieldCtx.Args,
173172
TypeName: fieldCtx.Object,
174173
FieldName: fieldCtx.Field.Name,

contrib/database/sql/exec_trace_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
// This product includes software developed at Datadog (https://www.datadoghq.com/).
44
// Copyright 2023 Datadog, Inc.
55

6-
// TODO: gotraceui does not currently handle Go 1.21 execution tracer changes,
7-
// so we need to skip this test for that version. We still have coverage for
8-
// older Go versions due to our support policy, and Go 1.21 shouldn't fundamentally
9-
// change the behavior this test is covering. Remove this build constraint
10-
// once gotraceui supports Go 1.21
11-
//
12-
//go:build !go1.21
13-
146
package sql
157

168
import (

contrib/emicklei/go-restful.v3/restful_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ func TestWithHeaderTags(t *testing.T) {
4242
r.Header.Add("[email protected]*r", "val2")
4343
r.Header.Set("2header", "2val")
4444
r.Header.Set("3header", "3val")
45-
r.Header.Set("x-datadog-header", "value")
4645
w := httptest.NewRecorder()
4746

4847
container.ServeHTTP(w, r)
@@ -52,7 +51,7 @@ func TestWithHeaderTags(t *testing.T) {
5251
t.Run("default-off", func(t *testing.T) {
5352
mt := mocktracer.Start()
5453
defer mt.Stop()
55-
htArgs := []string{"[email protected]*r", "2header", "3header", "x-datadog-header"}
54+
htArgs := []string{"[email protected]*r", "2header", "3header"}
5655
setupReq()
5756
spans := mt.FinishedSpans()
5857
assert := assert.New(t)
@@ -79,7 +78,6 @@ func TestWithHeaderTags(t *testing.T) {
7978
header, tag := normalizer.HeaderTag(arg)
8079
assert.Equal(strings.Join(r.Header.Values(header), ","), s.Tags()[tag])
8180
}
82-
assert.NotContains(s.Tags(), "http.headers.x-datadog-header")
8381
})
8482

8583
t.Run("global", func(t *testing.T) {
@@ -97,7 +95,6 @@ func TestWithHeaderTags(t *testing.T) {
9795
s := spans[0]
9896

9997
assert.Equal(strings.Join(r.Header.Values(header), ","), s.Tags()[tag])
100-
assert.NotContains(s.Tags(), "http.headers.x-datadog-header")
10198
})
10299

103100
t.Run("override", func(t *testing.T) {
@@ -118,7 +115,6 @@ func TestWithHeaderTags(t *testing.T) {
118115
header, tag := normalizer.HeaderTag(arg)
119116
assert.Equal(strings.Join(r.Header.Values(header), ","), s.Tags()[tag])
120117
}
121-
assert.NotContains(s.Tags(), "http.headers.x-datadog-header")
122118
assert.NotContains(s.Tags(), globalT)
123119
})
124120
}

contrib/emicklei/go-restful/restful_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ func TestWithHeaderTags(t *testing.T) {
4242
r.Header.Add("[email protected]*r", "val2")
4343
r.Header.Set("2header", "2val")
4444
r.Header.Set("3header", "3val")
45-
r.Header.Set("x-datadog-header", "value")
4645
w := httptest.NewRecorder()
4746

4847
container.ServeHTTP(w, r)
@@ -52,7 +51,7 @@ func TestWithHeaderTags(t *testing.T) {
5251
t.Run("default-off", func(t *testing.T) {
5352
mt := mocktracer.Start()
5453
defer mt.Stop()
55-
htArgs := []string{"[email protected]*r", "2header", "3header", "x-datadog-header"}
54+
htArgs := []string{"[email protected]*r", "2header", "3header"}
5655
setupReq()
5756
spans := mt.FinishedSpans()
5857
assert := assert.New(t)
@@ -79,7 +78,6 @@ func TestWithHeaderTags(t *testing.T) {
7978
header, tag := normalizer.HeaderTag(arg)
8079
assert.Equal(strings.Join(r.Header.Values(header), ","), s.Tags()[tag])
8180
}
82-
assert.NotContains(s.Tags(), "http.headers.x-datadog-header")
8381
})
8482

8583
t.Run("global", func(t *testing.T) {
@@ -97,7 +95,6 @@ func TestWithHeaderTags(t *testing.T) {
9795
s := spans[0]
9896

9997
assert.Equal(strings.Join(r.Header.Values(header), ","), s.Tags()[tag])
100-
assert.NotContains(s.Tags(), "http.headers.x-datadog-header")
10198
})
10299

103100
t.Run("override", func(t *testing.T) {
@@ -118,7 +115,6 @@ func TestWithHeaderTags(t *testing.T) {
118115
header, tag := normalizer.HeaderTag(arg)
119116
assert.Equal(strings.Join(r.Header.Values(header), ","), s.Tags()[tag])
120117
}
121-
assert.NotContains(s.Tags(), "http.headers.x-datadog-header")
122118
assert.NotContains(s.Tags(), globalT)
123119
})
124120
}

contrib/gin-gonic/gin/gintrace_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -452,15 +452,14 @@ func TestWithHeaderTags(t *testing.T) {
452452
r.Header.Add("[email protected]*r", "val2")
453453
r.Header.Set("2header", "2val")
454454
r.Header.Set("3header", "3val")
455-
r.Header.Set("x-datadog-header", "value")
456455
w := httptest.NewRecorder()
457456
router.ServeHTTP(w, r)
458457
return r
459458
}
460459
t.Run("default-off", func(t *testing.T) {
461460
mt := mocktracer.Start()
462461
defer mt.Stop()
463-
htArgs := []string{"[email protected]*r", "2header", "3header", "x-datadog-header"}
462+
htArgs := []string{"[email protected]*r", "2header", "3header"}
464463
setupReq()
465464
spans := mt.FinishedSpans()
466465
assert := assert.New(t)
@@ -484,7 +483,6 @@ func TestWithHeaderTags(t *testing.T) {
484483
header, tag := normalizer.HeaderTag(arg)
485484
assert.Equal(strings.Join(r.Header.Values(header), ","), s.Tags()[tag])
486485
}
487-
assert.NotContains(s.Tags(), "http.headers.x-datadog-header")
488486
})
489487
t.Run("global", func(t *testing.T) {
490488
mt := mocktracer.Start()
@@ -500,7 +498,6 @@ func TestWithHeaderTags(t *testing.T) {
500498
s := spans[0]
501499

502500
assert.Equal(strings.Join(r.Header.Values(header), ","), s.Tags()[tag])
503-
assert.NotContains(s.Tags(), "http.headers.x-datadog-header")
504501
})
505502

506503
t.Run("override", func(t *testing.T) {
@@ -521,7 +518,6 @@ func TestWithHeaderTags(t *testing.T) {
521518
header, tag := normalizer.HeaderTag(arg)
522519
assert.Equal(strings.Join(r.Header.Values(header), ","), s.Tags()[tag])
523520
}
524-
assert.NotContains(s.Tags(), "http.headers.x-datadog-header")
525521
assert.NotContains(s.Tags(), globalT)
526522
})
527523
}

contrib/go-chi/chi.v5/chi_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,6 @@ func TestWithHeaderTags(t *testing.T) {
464464
r.Header.Add("[email protected]*r", "val2")
465465
r.Header.Set("2header", "2val")
466466
r.Header.Set("3header", "3val")
467-
r.Header.Set("x-datadog-header", "value")
468467
w := httptest.NewRecorder()
469468
router.ServeHTTP(w, r)
470469
return r
@@ -473,7 +472,7 @@ func TestWithHeaderTags(t *testing.T) {
473472
t.Run("default-off", func(t *testing.T) {
474473
mt := mocktracer.Start()
475474
defer mt.Stop()
476-
htArgs := []string{"[email protected]*r", "2header", "3header", "x-datadog-header"}
475+
htArgs := []string{"[email protected]*r", "2header", "3header"}
477476
setupReq()
478477
spans := mt.FinishedSpans()
479478
assert := assert.New(t)
@@ -500,7 +499,6 @@ func TestWithHeaderTags(t *testing.T) {
500499
header, tag := normalizer.HeaderTag(arg)
501500
assert.Equal(strings.Join(r.Header.Values(header), ","), s.Tags()[tag])
502501
}
503-
assert.NotContains(s.Tags(), "http.headers.x-datadog-header")
504502
})
505503

506504
t.Run("global", func(t *testing.T) {
@@ -517,7 +515,6 @@ func TestWithHeaderTags(t *testing.T) {
517515
s := spans[0]
518516

519517
assert.Equal(strings.Join(r.Header.Values(header), ","), s.Tags()[tag])
520-
assert.NotContains(s.Tags(), "http.headers.x-datadog-header")
521518
})
522519

523520
t.Run("override", func(t *testing.T) {
@@ -538,7 +535,6 @@ func TestWithHeaderTags(t *testing.T) {
538535
header, tag := normalizer.HeaderTag(arg)
539536
assert.Equal(strings.Join(r.Header.Values(header), ","), s.Tags()[tag])
540537
}
541-
assert.NotContains(s.Tags(), "http.headers.x-datadog-header")
542538
assert.NotContains(s.Tags(), globalT)
543539
})
544540
}

0 commit comments

Comments
 (0)