Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft; don't merge] v2.0.0-rc #2427

Draft
wants to merge 750 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
750 commits
Select commit Hold shift + click to select a range
9562112
internal/apps/setup-smoke-test: revert using go work vendor instead o…
darccio Mar 25, 2024
e062db3
internal/apps/setup-smoke-test: use go work vendor ONLY IN 1.22 inste…
darccio Mar 25, 2024
6f9f98f
internal/apps/setup-smoke-test: add $go argument in corresponding bui…
darccio Mar 25, 2024
42807ee
.github/workflows: disable reviewdog
darccio Mar 25, 2024
a36ab4e
Merge remote-tracking branch 'origin/main' into v2-dev
darccio Mar 27, 2024
21c31dc
v2/contrib/database/sql: set WithDBStats to return OptionFn
darccio Mar 27, 2024
efa4ba6
v1internal: remove statsd carrier stuff
darccio Mar 27, 2024
be6407b
ddtrace/tracer: use localhost instead of my-host in TestTracerOptions…
darccio Mar 27, 2024
8d1ea11
Merge remote-tracking branch 'origin/main' into v2-dev
darccio Apr 8, 2024
c8ff8d7
ddtrace/tracer: remove Span.Tag function (reverts #2523)
darccio Apr 8, 2024
75c8781
v2/contrib/segmentio/kafka-go: fix WithDataStreams option signature
darccio Apr 8, 2024
f0eee6a
[v2] ddtrace/tracer: tidy up Tracer interface (#2633)
darccio May 8, 2024
1422d9c
tools/v2check: implement migration tool with all the required changes…
darccio May 16, 2024
ddac629
Merge branch main into v2-dev
darccio May 16, 2024
8d6fa2b
Merge remote-tracking branch 'origin' into v2-dev
darccio May 16, 2024
1bc2693
go.mod: upgrade to Go 1.20 & latest dd-trace-go/v2*
darccio May 17, 2024
532a55a
go.mod: add missing dependency to github.com/DataDog/dd-trace-go/v2/c…
darccio May 17, 2024
13caae9
chore: preparing for releasing submodules as v2
darccio May 21, 2024
5c87628
v2/contrib: remove v2 directory, move contrib to root
darccio May 21, 2024
13d2706
internal/appsec: remove contrib/net/http dependency
darccio May 21, 2024
32c9fe4
chore: fix contribs go.mod
darccio May 21, 2024
0d5f5a7
go.mod: remove google.golang.org/grpc
darccio May 22, 2024
916fe91
go.mod: go mod tidy
darccio Jul 2, 2024
602736a
contrib/**/**/go.mod: use replace directives to allow access to inter…
darccio Jul 10, 2024
b479415
contrib/**/**/go.mod: use v2.0.0 prefix everywhere
darccio Jul 10, 2024
3f7f527
v2: contrib/README: add versioning and deprecation policies for contr…
darccio Jul 12, 2024
e10036e
Contrib API proposal (#2768)
darccio Aug 28, 2024
c74f122
Merge remote-tracking branch 'origin' into v2-dev
darccio Aug 30, 2024
be74232
fix(test.sh): use "docker compose" instead of "docker-compose"
darccio Sep 2, 2024
7a32e40
fix(internal/civisibility): ensure mocktracer doesn't reset on stop
darccio Sep 2, 2024
5f4149c
fix(internal/civisibility): align gotesting to main
darccio Sep 2, 2024
47c2b19
chore: sync go.mod from main
darccio Sep 2, 2024
15f200b
Merge branch 'main' into v2-dev
darccio Sep 2, 2024
9879839
chore(CONTRIBUTING.md): fix contrib URL
darccio Sep 2, 2024
2a85f26
chore: update dd-trace-go and contribs
darccio Sep 2, 2024
6e92fdc
Merge branch 'v2-dev' of github.com:DataDog/dd-trace-go into v2-dev
darccio Sep 2, 2024
eea74d2
chore(mocktracer): remove fmt.Printf call
darccio Sep 2, 2024
8c646bb
fix(contrib/uptrace/bun): use DDServiceV0
darccio Sep 2, 2024
bb94c3e
fix(contrib/net/http): avoid race condition on request value
darccio Sep 2, 2024
4d3fad6
fix(contrib/labstack/echo.v4): sync with main
darccio Sep 2, 2024
72a0c0d
fix(ddtrace/tracer): don't use unknown hostnames for DD_AGENT_HOST in…
darccio Sep 2, 2024
6c152b2
fix(contrib/IBM/sarama): sync with main
darccio Sep 3, 2024
7cb6a69
fix(ddtrace/tracer): don't use unknown hostnames for DD_AGENT_HOST in…
darccio Sep 3, 2024
423fc6b
Merge remote-tracking branch 'origin' into v2-dev
darccio Sep 3, 2024
770a2e5
fix(contrib/{log/slog,net/http}): use testutils.DiscardLogger
darccio Sep 3, 2024
fb987a0
fix(contrib): replace ext.Error with ext.ErrorMsg on errors related a…
darccio Sep 3, 2024
35cbab0
fix(contrib/labstack/echo.v4): use DDServiceV0
darccio Sep 3, 2024
7c5699a
fix(contrib/gocql/gocql): fix expected value's type for ext.Cassandra…
darccio Sep 3, 2024
8746ff7
fix(internal/exectracetest): add to go.work and refactor internal/htt…
darccio Sep 3, 2024
be674c4
fix(contrib/labstack/echo.v4): set instrumentation package value to l…
darccio Sep 4, 2024
d606adb
fix(workflows/apps): set +e to avoid aborting contrib tests if any of…
darccio Sep 4, 2024
fd670e0
fix(internal/appsec): move httptracemock into instrumentation and Tes…
darccio Sep 5, 2024
db54771
copyright job needs go installed
ajgajg1134 Sep 4, 2024
695c69d
chore: go mod tidy
darccio Sep 5, 2024
f0d7a1d
Merge branch 'main' into v2-dev
darccio Sep 5, 2024
f49348a
feat(workflows/apps): report failure of any test in test-contrib-subm…
darccio Sep 5, 2024
4749ec8
chore: go generate ./...
darccio Sep 5, 2024
e519264
fix(ddtrace/tracer): update flushed bytes in writer tests
darccio Sep 6, 2024
a690433
fix(benchmarks): add canary file so benchmark platform can run
darccio Sep 6, 2024
95b77a5
fix(contrib/IBM/sarama): adapt tests to handle smoke tests
darccio Sep 6, 2024
c0d1af6
chore(benchmarks): use dario.castane/remove-v2-prefix-paths as benchm…
darccio Sep 6, 2024
0bc07d4
Merge remote-tracking branch 'origin' into v2-dev
darccio Sep 6, 2024
ac25f73
fix(civisibility): change dd-trace-go import URLs
darccio Sep 6, 2024
84db89c
chore: skip Orchestrion tests
darccio Sep 6, 2024
fcbd7f9
fix: skip UDS test in Windows
darccio Sep 6, 2024
9114f56
fix(workflows): fix checkout step for parametric tests
darccio Sep 6, 2024
644cdb0
fix(workflows): try to avoid ref overriding
darccio Sep 6, 2024
9c112db
fix(workflows): remove branch_ref from parametric tests
darccio Sep 6, 2024
37a04b0
fix(workflows): report any failing contrib test in appsec tests
darccio Sep 6, 2024
d23f879
refactor(.github/workflows): skip gin tests when GOEXPERIMENT=cgocheck2
darccio Sep 6, 2024
d66cefc
fix(.github/workflows): fix conditional for skipping gin tests
darccio Sep 6, 2024
d1f31b7
fix(contrib/database/sql): replace glebarez/go-sqlite by modernc/sqli…
darccio Sep 9, 2024
4d4e39d
chore: update dd-trace-go in contribs
darccio Sep 9, 2024
c452671
Merge remote-tracking branch 'origin' into v2-dev
darccio Sep 9, 2024
648c291
chore: update dd-trace-go in contribs (again)
darccio Sep 9, 2024
5b4715c
fix: remove unneeded SQL driver
darccio Sep 9, 2024
41aa615
chore: go mod tidy
darccio Sep 9, 2024
b075389
fix(mocktracer): add missing assertions in TestTracerStatSpan tests
darccio Sep 13, 2024
f251ab8
feat(v1internal): temporary exposal for {,Set}DogstatsdAddr
darccio Sep 17, 2024
8a0def8
feat(v1internal): temporary exposal for {,Set}StatsTags
darccio Sep 17, 2024
28e8581
feat: support for _dd.stack meta struct value set by v1 shim
darccio Sep 18, 2024
132386d
fix: avoid panic on nil casted propagator due to v1 wrapper
darccio Sep 18, 2024
7d4b68c
chore(profiler): sync upload code with main
darccio Sep 18, 2024
ecbf69a
feat: support for v1 shim's contribs
darccio Oct 3, 2024
b42729d
feat: add another batch of v1 shim's contribs
darccio Oct 3, 2024
1843e7b
v2: fix divergent changes (#2879)
hannahkm Oct 7, 2024
4bdbe4c
v2: remove sampling priority (#2906)
hannahkm Oct 9, 2024
433fb7a
fix: improve v1 deprecated contribs' support
darccio Oct 9, 2024
6a6d3c0
refactor(v1internal): drop globalconfig & normalizer code
darccio Oct 9, 2024
4b68ec8
Merge branch 'v2-dev' of github.com:DataDog/dd-trace-go into v2-dev
darccio Oct 9, 2024
c89ace4
refactor(contrib/google.golang.org/grpc): remove applyStream
darccio Oct 9, 2024
7c95d5c
feat(instrumentation/testutils): SetPropagatingTags implemented for v…
darccio Oct 10, 2024
3f96da4
refactor(v1internal): reduce exposed APIs
darccio Oct 10, 2024
fc7865f
fix(kafka.v2) wrong import line
hannahkm Oct 11, 2024
aae338a
merge main into v2 (#2930)
hannahkm Oct 21, 2024
f2acfa7
mark branch as merged
hannahkm Oct 21, 2024
4a17681
update go mod
hannahkm Oct 24, 2024
69a858e
v2: merge main into v2 again (#2937)
hannahkm Oct 31, 2024
72188bb
marking v2 as merged
hannahkm Oct 31, 2024
d24bdec
v2: finalize migration tool for v2 (#2914)
hannahkm Oct 31, 2024
d38ce54
update migration md
hannahkm Oct 31, 2024
0dbfdf7
feat: use dd tracing libraries in all examples in contrib
hannahkm Oct 31, 2024
e5bf967
add example for globalsign mgo
hannahkm Oct 31, 2024
350ef22
fix(docker-compose): remove Git merging tags
darccio Nov 4, 2024
e35eba2
fix import url migration tests
hannahkm Nov 4, 2024
d12310b
fix: remove internal pubsub pkg
hannahkm Nov 4, 2024
5abf2a5
fix(v2check): resolve incorrect urls
hannahkm Nov 4, 2024
25601cd
chore: go mod tidy
darccio Nov 5, 2024
3808637
chore(internal/version): bump to v2.0.0-beta.6
darccio Nov 5, 2024
65abd19
chore: bump dd-trace-go to v2.0.0-beta.6
darccio Nov 5, 2024
19d6441
chore: bump dd-trace-go to v2.0.0-beta.6 for dependent nested modules…
darccio Nov 5, 2024
cd6d42a
fix(aws): consistent trace usage in test
hannahkm Nov 5, 2024
43534f2
Merge branch 'v2-dev' of github.com:DataDog/dd-trace-go into v2-dev
darccio Nov 6, 2024
d6f504b
fix: support deprecated ext.SamplingPriority for v1 shim
darccio Nov 6, 2024
c6460d5
chore: tag v2.0.0-beta.7
darccio Nov 6, 2024
92e8b92
fix(ddtrace/tracer): allow beta versions in logging tests
darccio Nov 8, 2024
bff750d
chore: sync go.mod with main
darccio Nov 8, 2024
98e19d4
chore: sync go.mod with main for contribs
darccio Nov 8, 2024
b7c3238
chore: upgrade dd-trace-go in contribs up to v2.0.0-beta.8
darccio Nov 8, 2024
75a4de4
chore: upgrade dd-trace-go/v2/contribs in dependent contribs up to v2…
darccio Nov 8, 2024
f2fc7cb
chore: sync go.mod with v1.69.1
darccio Nov 8, 2024
3e841d6
chore: update version.go to v2.0.0-beta.9
darccio Nov 8, 2024
ff422b3
chore: sync contrib/net/[email protected] go.mod with v1.69.1
darccio Nov 8, 2024
3334e0e
chore: sync contrib/database/[email protected] go.mod with v1.69.1
darccio Nov 8, 2024
8fa4f45
chore: sync instrumentation/testutils/[email protected] go.mod with …
darccio Nov 8, 2024
11f0c09
chore: sync {contrib,internal,tools}/*@v2.0.0-beta.9 go.mod with v1.69.1
darccio Nov 8, 2024
85762c5
chore: sync internal apps go.mod with v1.69.1
darccio Nov 8, 2024
d22e2e2
chore(contrib/aws/aws-sdk-go-v2): go mod tidy
darccio Nov 9, 2024
5be7c3a
fix(ddtrace/tracer): lock span to prevent race with error stack
hannahkm Nov 11, 2024
61e1e80
fix(instrumentation/internal/namingschema): add lock to prevent races…
hannahkm Nov 12, 2024
adfc580
chore: upgrade version to v2.0.0-beta.10
hannahkm Nov 13, 2024
8389af3
chore: upgrade net/http and database/sql to v2.0.0-beta.10
hannahkm Nov 13, 2024
890a6eb
chore({contrib/internal/tools): upgrade contribs to v2.0.0-beta.10
hannahkm Nov 13, 2024
6ddb175
chore(instrumentation/internal): update go mod to v2.0.0-beta.10
hannahkm Nov 13, 2024
711daec
fix(ddtrace/tracer): ignore gen_endpoints in TestIntegrationsEnabled
hannahkm Nov 13, 2024
d382244
fix(ddtrace/tracer): fix flakiness when running TestIntegrationEnable…
hannahkm Nov 14, 2024
cadcc44
chore: upgrade to v2.0.0-beta.11
hannahkm Nov 19, 2024
5ef1c6a
chore({contrib/instrumentation}): upgrade net/http, database/sql, and…
hannahkm Nov 19, 2024
bb12d5c
chore({contrib/instrumentation/internal/tools}): upgrade all contribs…
hannahkm Nov 19, 2024
573868d
refactor(ddtrace/tracer): rename WithDogstatsAddress as WithDogstatsAddr
darccio Nov 26, 2024
c31b1de
fix(instrumentation/internal/namingschematest): upgrade google.golang…
darccio Nov 26, 2024
9a75896
fix(contrib/google.golang.org/grpc): remove extra call to testutils.S…
darccio Nov 26, 2024
88f84f0
Merge tag 'v1.70.1' into v2-dev
hannahkm Nov 26, 2024
f6d022a
Merge remote-tracking branch 'origin' into v2-dev
hannahkm Nov 26, 2024
5196e30
fix(tools/v2check): fix wrong import paths and go mod tidy
hannahkm Nov 26, 2024
12cf41d
fix(internal/osinfo): bring in missing files from main
hannahkm Nov 26, 2024
d13ea72
fix(internal/osinfo): replace gopkg.in import with v2 equivalent
darccio Nov 26, 2024
6622ffe
go.mod: go mod tidy
darccio Nov 26, 2024
80020e4
fix(ddtrace/tracer): remove stop() call in TestLogSamplingRules
darccio Nov 26, 2024
7863b4c
fix(contrib/{go-chi,urfave/negroni}): use proper syntax for getting E…
hannahkm Nov 26, 2024
f07a859
fix(ddtrace/tracer): flip incorrect assertions
hannahkm Nov 26, 2024
92f5e33
fix(contrib/go-chi): remove checks for ext.Error, stop setting isServ…
hannahkm Nov 26, 2024
eea2087
fix(ddtrace/tracer): fix another flipped assertion
hannahkm Nov 26, 2024
b503062
fix(contrib/aws/sfn): add missing sfn folder
hannahkm Nov 26, 2024
a180892
fix(contrib/aws): downgrade aws modules to match main branch
hannahkm Nov 26, 2024
91231ab
fix(internal/civisibility/integrations/gotesting): remove unused func…
hannahkm Nov 26, 2024
7e48a76
fix(go.mod): keep AWS dependencies aligned
darccio Nov 27, 2024
c96705e
fix(go.mod): go mod tidy
darccio Nov 27, 2024
4561946
fix(internal/osinfo): align Windows implementation
darccio Nov 27, 2024
25e81df
fix(go.mod): downgrading all direct and indirect aws-sdk-go-v2 depend…
darccio Nov 27, 2024
6ff8851
fix(contrib/aws/aws-sdk-go-v2): downgrading all direct and indirect …
darccio Nov 27, 2024
e070942
refactor(tag_all_contrib.sh): prepare for release
darccio Nov 27, 2024
013b2d3
chore(instrumentation/internal/namingschematest): go mod tidy
darccio Nov 27, 2024
6131b2f
fix(tag_all_contrib.sh): tag main contribs
darccio Nov 27, 2024
b1945d5
fix(contrib/aws/aws-sdk-go-v2): downgrading smithy-go
darccio Nov 27, 2024
0ccf4f8
chore(instrumentation/internal/namingschematest): align aws-sdk-go-v2…
darccio Nov 27, 2024
c2ac84a
feat(contrib/{database/sql,net/http}): upgrade to dd-trace-go v2.0.0-…
darccio Nov 27, 2024
fb44d6b
feat({contrib,internal}/*): upgrade to dd-trace-go/contrib/{database/…
darccio Nov 27, 2024
fe886dd
feat({contrib,internal}/*): upgrade to dd-trace-go v2.0.0-rc.1
darccio Nov 27, 2024
53971d2
fix(tag_all_contrib.sh): phase 2 must use the version variable, don't…
darccio Nov 27, 2024
310137d
fix(tag_all_contrib.sh): guard rails and warnings
darccio Nov 27, 2024
2605b0a
feat({instrumentation,internal}/*): upgrade to dd-trace-go/contrib/* …
darccio Nov 27, 2024
08a1289
feat(tag_all_contrib.sh): add previous phase
darccio Nov 27, 2024
f89888d
refactor(tools): use a more appropriate name for our release script
darccio Nov 27, 2024
cb07b73
appsec: never start a new WAF Context when one is in context (#2998)
eliottness Nov 27, 2024
52576bf
Merge remote-tracking branch 'origin' into v2-dev
darccio Nov 27, 2024
2a0723a
feat(ddtrace/tracer): remove SpanContextWithLinks in favor of using S…
hannahkm Nov 27, 2024
1d02649
fix(instrumentation/internal/namingschematest): align AWS deps
darccio Nov 27, 2024
fc0c3af
Merge branch 'v2-dev' of github.com:DataDog/dd-trace-go into v2-dev
darccio Nov 27, 2024
1e2b0ac
Merge branch 'main' into v2-dev
darccio Nov 28, 2024
d0864f9
fix(ddtrace/tracer): update TestTracerOptionsDefaults and improve mer…
darccio Nov 28, 2024
54d2756
fix(.github/workflows): align orchestrion.yml with main
darccio Nov 28, 2024
3b0a239
fix(.github/workflows): disable orchestrion.yml
darccio Nov 28, 2024
d478039
fix(ddtrace/tracer): don't use my-host as hostname in tests
darccio Nov 28, 2024
a9ffcdf
fix(.github/workflows): reactivate smoke tests
darccio Nov 28, 2024
0443318
fix(ddtrace/tracer): remove misleading health_metrics_enabled from st…
hannahkm Dec 2, 2024
f799a44
propagate statsd client to stats concentrator (#3009)
ajgajg1134 Dec 4, 2024
793e435
refactor(ddtrace/tracer): rename WithDogstatsdAddress as WithDogstats…
darccio Dec 5, 2024
2696801
[v2] contrib/net/http: Make DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING fal…
mtoffl01 Dec 10, 2024
e6a87da
internal: add workflow to check for outdated integrations (#3008)
quinna-h Dec 10, 2024
b5a98c3
[v2] fix(ddtrace/tracer): Disable agent features and remote configura…
tonyredondo Dec 12, 2024
9e02ac3
[v2] internal/civisibility: Add auto test retries telemetry metric (#…
tonyredondo Dec 12, 2024
5ff2197
v2: merging main into v2-dev (#3039)
darccio Dec 17, 2024
0de6bdb
Merge branch 'main' into v2-dev
darccio Dec 17, 2024
c074735
fix(ddtracer/tracer): remove duplicated lines
darccio Dec 17, 2024
f68f3ff
fix(ddtrace/tracer): update flush_bytes' magic number in TestTraceWri…
darccio Dec 17, 2024
1d06fe6
go.mod: module go.opentelemetry.io/collector/pdata@latest found (v1.2…
eliottness Dec 17, 2024
82073c0
chore: go mod tidy
darccio Dec 18, 2024
1e947d6
fix(ddtrace/tracer): use statsd.NoOpClientDirect in WithTestDefaults
darccio Dec 18, 2024
f0a48e3
release: upgrade main contribs
darccio Dec 19, 2024
975f333
fix: add instrumentation and contrib/google.golang.org/grpc support f…
darccio Dec 19, 2024
6a0a0c9
release: upgrade contribs and almost all internal nested modules
darccio Dec 19, 2024
d43163f
fix: add autogenerated messages to tags
darccio Dec 19, 2024
d6664e0
chore: update internal apps and tools
darccio Dec 19, 2024
dccc349
fix: improving test logic for TestStreamSendsErrorCode to avoid flaki…
darccio Dec 19, 2024
cec8baa
fix(contrib/google.golang.org/grpc): fix type mismatch
hannahkm Dec 19, 2024
a36a57f
internal/contrib: fix TestTelemetryEnabled flakiness on Windows (#3051)
hannahkm Dec 19, 2024
d1e90d7
contrib/miekg/dns: resolve flaky test in TestExchange* (#3045)
hannahkm Dec 19, 2024
bc23448
vuln: upgrade golang.org/x/{crypto,net} to non-vulnerable versions (#…
darccio Dec 19, 2024
1691ef6
appsec: stop storing span tags, directly call span.SetTag (#3044)
eliottness Dec 18, 2024
235763a
fix: ensure all go.mod files use the same Go version
darccio Dec 20, 2024
2a35ed2
[v2] ddtrace/tracer: report datadog.tracer.api.errors health metric (…
mtoffl01 Dec 20, 2024
b87a853
Merge branch 'v2-dev' of github.com:DataDog/dd-trace-go into v2-dev
darccio Dec 20, 2024
5d9fa48
Merge remote-tracking branch 'origin' into v2-dev
darccio Dec 20, 2024
bf84d28
fix(ddtrace/tracer): avoid panic on nil spancontext on Extract
darccio Dec 20, 2024
27ca67c
fix(ddtrace/tracer): update expected datadog.tracer.flush_bytes in Te…
darccio Dec 20, 2024
0b8d13e
chore: go mod tidy
darccio Dec 20, 2024
be5c295
ddtrace/tracer: Report datadog.tracer.queue.enqueued.traces as health…
mtoffl01 Jan 2, 2025
2629185
[v2] Report datadog.tracer.abandoned_spans health metric (#3032)
mtoffl01 Dec 23, 2024
5f5b7a1
chore: rename reportHealthMetrics function (#3040)
mtoffl01 Dec 23, 2024
c90908e
Merge branch 'main' into v2-dev
hannahkm Jan 2, 2025
eb4f0d7
ddtrace/tracer: Tracing as transport-only mode (APPSEC_STANDALONE) (#…
eliottness Dec 19, 2024
bbf1468
ddtrace/tracer: check for nil trace to prevent panic
hannahkm Jan 2, 2025
568c2fe
ddtrace/tracer: check for nil ctx to prevent panic
hannahkm Jan 2, 2025
b056608
ddtrace/tracer: double check if trace is nil
hannahkm Jan 2, 2025
50298b9
ddtrace/tracer: fix nil check
hannahkm Jan 3, 2025
2031791
(v2) fix: workaround for otel agent dependency causes orchestrion fai…
eliottness Jan 6, 2025
89bfc59
contrib/envoyproxy: fix resource name (#3047)
e-n-0 Jan 6, 2025
a574a83
[v2] contrib/IBM/sarama: support for consumer groups (#3072)
rarguelloF Jan 10, 2025
0e34da9
(fix) internal/civisibility/utils: improve environment tags mutabilit…
tonyredondo Jan 13, 2025
0880b0d
[v2] fix(ddtrace/tracer): avoid tests to fail with error "non-constan…
darccio Jan 13, 2025
a00388d
[v2] contrib/http/net: adding integration-level option to configure e…
rachelyangdog Jan 13, 2025
d4ca755
fix(internal/telemetry): replace gopkg.in/DataDog/dd-trace-go.v1 import
darccio Jan 15, 2025
d9887a7
(fix) internal/civisibility: add some checks before performing the ht…
tonyredondo Jan 15, 2025
639bf43
feat: add Benchfile to compare benchmarks between main and v2-dev
darccio Jan 16, 2025
5f5d66d
Merge branch 'v2-dev' of github.com:DataDog/dd-trace-go into v2-dev
darccio Jan 16, 2025
bb4979d
[v2] contrib/IBM/sarama.v1: skip integration test if env variable is …
rarguelloF Jan 16, 2025
d8fe1d5
[v2] tools: fix fixmodules script (#3090)
rarguelloF Jan 17, 2025
5d42e4d
(feat) internal/civisibility: add support for testify Suites (v2) (#3…
tonyredondo Jan 17, 2025
519c69e
fix: clean up to remove dependency on deleted or unmaintained reposit…
darccio Jan 17, 2025
8958ac9
go.work.sum: go mod tidy
darccio Jan 20, 2025
03b35de
chore(contrib/confluentinc/confluent-kafka-go/kafka.v2): go mod tidy
darccio Jan 20, 2025
6dd1f10
[v2] fix(contrib/Shopify/sarama): pin Shopify/sarama to v1.38.1 (#3105)
darccio Jan 20, 2025
0f89925
[v2] contrib/IBM/sarama: stop using mockbroker for tests (#3108)
rarguelloF Jan 21, 2025
4ce65f3
[v2] fix(contrib/hashicorp/{consul,vault}): pin armon/go-metrics to v…
darccio Jan 21, 2025
6d919e8
internal: add supported versions for v2 (#3070)
quinna-h Jan 21, 2025
ee9fb69
contrib/log/slog: avoid logging 0 value trace/span IDs (#2994)
rliebz Jan 22, 2025
7d516f3
Baggage API v2 (#3109)
rachelyangdog Jan 23, 2025
4cfded8
fix(v2): update Benchfile after extensive testing
darccio Jan 24, 2025
c31e444
[v2] fix: improved performance on multiple benchmarks (#3114)
darccio Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
347 changes: 347 additions & 0 deletions .github/workflows/apps/gen_supported_versions_doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,347 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2024 Datadog, Inc.

package main

import (
"context"
"encoding/json"
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
"regexp"
"sort"
"strings"
"sync"
"time"

"github.com/DataDog/dd-trace-go/v2/instrumentation"
"golang.org/x/mod/modfile"
)

const outputPath = "./contrib/supported_versions.md"

// TODO: currently this is taken from the https://github.com/DataDog/orchestrion README, it will be fetched dynamically
// when Orchestrion aspects are moved to dd-trace-go.
var autoInstrumentedLibs = map[string]struct{}{
"database/sql": {},
"github.com/gin-gonic/gin": {},
"github.com/go-chi/chi/v5": {},
"github.com/go-chi/chi": {},
"github.com/go-redis/redis/v7": {},
"github.com/go-redis/redis/v8": {},
"github.com/gofiber/fiber/v2": {},
"github.com/gomodule/redigo/redis": {},
"github.com/gorilla/mux": {},
"github.com/jinzhu/gorm": {},
"github.com/labstack/echo/v4": {},
"google.golang.org/grpc": {},
"gorm.io/gorm": {},
"net/http": {},
"go.mongodb.org/mongo-driver/mongo": {},
"github.com/aws/aws-sdk-go": {},
"github.com/hashicorp/vault": {},
"github.com/IBM/sarama": {},
"github.com/Shopify/sarama": {},
"k8s.io/client-go": {},
"log/slog": {},
"os": {},
"github.com/aws/aws-sdk-go-v2": {},
"github.com/redis/go-redis/v9": {},
"github.com/gocql/gocql": {},
"cloud.google.com/go/pubsub": {},
"github.com/99designs/gqlgen": {},
"github.com/redis/go-redis": {},
"github.com/graph-gophers/graphql-go": {},
"github.com/graphql-go/graphql": {},
"github.com/jackc/pgx": {},
"github.com/elastic/go-elasticsearch": {},
"github.com/twitchtv/twirp": {},
"github.com/segmentio/kafka-go": {},
"github.com/confluentinc/confluent-kafka-go/kafka": {},
"github.com/confluentinc/confluent-kafka-go/kafka/v2": {},
"github.com/julienschmidt/httprouter": {},
"github.com/sirupsen/logrus": {},
}

// stdlibPackages are used to skip in version checking.
var stdlibPackages = map[string]struct{}{
"log/slog": {},
"os": {},
"net/http": {},
"database/sql": {},
}

type ModuleVersion struct {
Name string
MinVersion string
MaxVersion string
Repository string
isInstrumented bool
}

// modUpdate is the type returned by 'go list -m -u -json <module>'
type modUpdate struct {
Path string
Version string
Update struct {
Path string
Version string
}
}

func main() {
modules, err := processPackages()
if err != nil {
log.Fatalf("Error processing packages: %v\n", err)
}

// update with instrumented status
for i := range modules {
modules[i].isInstrumented = isModuleAutoInstrumented(modules[i].Repository)
}

modulesWithLatest := fetchAllLatestVersions(modules)

if err := writeMarkdownFile(modulesWithLatest, outputPath); err != nil {
fmt.Println(err)
}

fmt.Println("Version information written to", outputPath)
}

func fetchLatestVersion(module string) (string, error) {
if _, ok := stdlibPackages[module]; ok {
return "N/A", nil
}

ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()

// Run `go list -m -u -json <module>` to retrieve latest available upgrade
out, err := runCommand(ctx, "", "go", "list", "-m", "-u", "-json", module)
if err != nil {
return "", err
}

var m modUpdate
if err := json.Unmarshal(out, &m); err != nil {
return "", fmt.Errorf("unexpected 'go list -m -u -json' output: %v", err)
}

latest := m.Version
if m.Update.Version != "" {
latest = m.Update.Version
}
return latest, nil
}

// isModuleAutoInstrumented returns whether the module has automatic tracing supported (by Orchestrion)
func isModuleAutoInstrumented(moduleName string) bool {
for key := range autoInstrumentedLibs {
if isSubdirectory(moduleName, key) {
return true
}
}
return false
}

func isSubdirectory(url, pattern string) bool {
if strings.HasPrefix(url, pattern) {
// match is either exact or followed by a "/"
return len(url) == len(pattern) || url[len(pattern)] == '/'
}
return false
}

// getCurrentVersion parses the go.mod file for a package and extracts the version of a given repository.
func getCurrentVersion(integrationName, modName string) (ModuleVersion, error) {
if _, ok := stdlibPackages[integrationName]; ok {
return ModuleVersion{
Name: integrationName,
MinVersion: "N/A",
MaxVersion: "N/A",
Repository: modName,
isInstrumented: false,
}, nil
}

// Path to contrib/{packageName}
contribPath := filepath.Join("contrib", integrationName)
goModPath := filepath.Join(contribPath, "go.mod")

// Check if go.mod exists in directory
if _, err := os.Stat(goModPath); os.IsNotExist(err) {
return ModuleVersion{}, fmt.Errorf("go.mod not found in %s", contribPath)
}

// Read the go.mod
data, err := os.ReadFile(goModPath)
if err != nil {
return ModuleVersion{}, fmt.Errorf("failed to read go.mod: %w", err)
}

// Parse the go.mod
f, err := modfile.Parse(goModPath, data, nil)
if err != nil {
return ModuleVersion{}, fmt.Errorf("failed to parse go.mod: %w", err)
}

// match the repository name
repoPattern := fmt.Sprintf(`\b%s\b`, strings.ReplaceAll(modName, "/", `/`))
repoRegex, err := regexp.Compile(repoPattern)
if err != nil {
return ModuleVersion{}, fmt.Errorf("invalid repository regex pattern: %w", err)
}

// Iterate through require dependencies
for _, req := range f.Require {
if repoRegex.MatchString(req.Mod.Path) {
return ModuleVersion{
Name: integrationName,
MinVersion: req.Mod.Version,
MaxVersion: "",
Repository: req.Mod.Path,
isInstrumented: false,
}, nil
}
}
return ModuleVersion{}, fmt.Errorf("repository %s not found in go.mod", modName)
}

// fetchAllLatestVersions concurrently fetches the latest version of each module.
func fetchAllLatestVersions(modules []ModuleVersion) []ModuleVersion {
var wg sync.WaitGroup

updatedModules := make([]ModuleVersion, len(modules))

wg.Add(len(modules))
for i, mod := range modules {
go func(i int, mod ModuleVersion) {
defer wg.Done()
latestVersion, err := fetchLatestVersion(mod.Repository)
if err != nil {
fmt.Printf("Error fetching latest version for %s: %v\n", mod.Repository, err)
updatedModules[i] = ModuleVersion{mod.Name, mod.MinVersion, "Error", mod.Repository, mod.isInstrumented}
return
}

updatedModules[i] = ModuleVersion{
Name: mod.Name,
MinVersion: mod.MinVersion,
MaxVersion: latestVersion,
Repository: mod.Repository,
isInstrumented: mod.isInstrumented,
}
}(i, mod)
}

wg.Wait()
return updatedModules
}

func writeMarkdownFile(modules []ModuleVersion, filePath string) error {
// Sort modules by name
sort.Slice(modules, func(i, j int) bool {
return modules[i].Name < modules[j].Name
})

maxColumnLength := []int{0, 0, 0, 0, 0}

rows := [][]string{
{"Module", "Datadog Integration", "Minimum Tested Version", "Maximum Tested Version", "Auto-Instrumented"},
{"-", "-", "-", "-", "-"},
}
for _, mod := range modules {
rows = append(rows, []string{
modWithPkgDevURL(mod.Repository, mod.Repository),
integrationWithPackageURL(mod.Name),
fmt.Sprintf("`%s`", mod.MinVersion),
fmt.Sprintf("`%s`", mod.MaxVersion),
boolToMarkdown(mod.isInstrumented),
})
}
for _, row := range rows {
for i, col := range row {
if len(col) > maxColumnLength[i] {
maxColumnLength[i] = len(col)
}
}
}
for _, row := range rows {
for i, col := range row {
char := " "
if col == "-" {
char = "-"
}
if len(col) < maxColumnLength[i] {
row[i] = row[i] + strings.Repeat(char, maxColumnLength[i]-len(col))
}
row[i] = char + row[i] + char
}
}

file, err := os.Create(filePath)
if err != nil {
return fmt.Errorf("error creating file: %w", err)
}
defer func() {
if err := file.Close(); err != nil {
log.Printf("failed to closed file: %v\n", err)
}
}()

for _, row := range rows {
if _, err := fmt.Fprintln(file, "|"+strings.Join(row, "|")+"|"); err != nil {
return fmt.Errorf("failed to write line: %w", err)
}
}
return nil
}

func processPackages() ([]ModuleVersion, error) {
var modules []ModuleVersion
for integrationName, mod := range instrumentation.GetPackages() {
module, err := getCurrentVersion(string(integrationName), mod)
if err != nil {
return nil, err
}
modules = append(modules, module)
}
return modules, nil

}

func runCommand(ctx context.Context, dir string, commandAndArgs ...string) ([]byte, error) {
log.Printf("running command: %q\n", strings.Join(commandAndArgs, " "))

cmd := exec.CommandContext(ctx, commandAndArgs[0], commandAndArgs[1:]...)
cmd.Stderr = os.Stderr
cmd.Dir = dir

b, err := cmd.Output()
if err != nil {
return nil, fmt.Errorf("failed to run command %q: %v", strings.Join(commandAndArgs, " "), err)
}
return b, nil
}

func integrationWithPackageURL(integrationName string) string {
modURL := fmt.Sprintf("github.com/DataDog/dd-trace-go/contrib/%s/v2", integrationName)
return modWithPkgDevURL("contrib/"+integrationName, modURL)
}

func modWithPkgDevURL(name, modURL string) string {
return fmt.Sprintf("[%s](https://pkg.go.dev/%s)", name, modURL)
}

func boolToMarkdown(val bool) string {
if val {
return ":white_check_mark:"
}
return " "
}
Loading
Loading