-
Notifications
You must be signed in to change notification settings - Fork 535
Comparing changes
Open a pull request
base repository: DataDog/dd-trace-go
base: v2.9.0
head repository: DataDog/dd-trace-go
compare: v2.9.1
- 10 commits
- 114 files changed
- 5 contributors
Commits on Jun 25, 2026
-
Revert "fix(ddtrace/tracer): cache trace ID hex encoding (#4481)"
This reverts commit 2693902.
Configuration menu - View commit details
-
Copy full SHA for 92b8d24 - Browse repository at this point
Copy the full SHA 92b8d24View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5362000 - Browse repository at this point
Copy the full SHA 5362000View commit details -
fix(internal/civisibility): fix agent UDS requests (#4852)
### What does this PR do? Fixes the CI Visibility helper client when DD_TRACE_AGENT_URL is configured with a Unix domain socket. The helper client now captures the raw socket path before rewriting the base URL to the synthetic UDS host and reuses the shared internal.UDSClient and internal.UnixDataSocketURL helpers. Adds agent-mode UDS coverage for the CI Visibility helper endpoints: settings, known tests, search commits, skippable tests, test management, packfile upload, coverage upload, and logs upload. ### Motivation The previous UDS branch built a custom dialer that closed over agentURL.Path, then reassigned agentURL to the synthetic HTTP URL. By request time agentURL.Path was empty, causing agent-mode requests to fail with dial unix: missing address. ### Testing - go test ./internal/civisibility/utils/net -run 'TestClientAgentModeUDS' -count=1 - go test ./internal/civisibility/utils/net -count=1 - go test -race ./internal/civisibility/utils/net -count=1 - go test ./internal -run 'TestUnixDataSocketURL|TestUDSClientTransportConfig|TestUDSConcurrentConnectionReuse|TestUDSServerCloseRecovery' -count=1 - go test ./ddtrace/tracer -run 'TestCiVisibilityTransport|TestCIVisibilityTransportSecureLogging' -count=1 - go test ./internal/civisibility/... -count=1 - go test -race ./internal/civisibility/... -count=1 - git diff --check Co-authored-by: tony.redondo <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9fd40ab - Browse repository at this point
Copy the full SHA 9fd40abView commit details -
fix(civisibility): truncate CI Visibility meta values (#4853)
### What does this PR do? Truncates CI Visibility string tag values to 5000 characters before they are stored on CI Visibility spans. The implementation is intentionally kept under `internal/civisibility/integrations`, which is owned by `@DataDog/ci-app-libraries`. This avoids changing `ddtrace/tracer` / TSLV encoder code owned by `@DataDog/apm-go`. This still keeps the payload-envelope metadata path unchanged. It does not truncate payload-level envelope `metadata` values such as `env` or `test_session.name`, and it does not change `CODEOWNERS`. ### Motivation The CI Visibility backend limits tag values to 5000 characters. Applying the limit at the CI Visibility integration tag boundary keeps event metadata within that limit while keeping the change in CI Visibility-owned code. ### Scope note The strict TSLV-only serialization boundary lives in `ddtrace/tracer/civisibility_tslv.go`, which is owned by `@DataDog/apm-go`. To avoid involving that owner, this PR truncates CI Visibility span string tag values before TSLV serialization rather than mutating only `content.meta` during encoding. ### Reviewer's Checklist - [x] Changed code has unit tests for its functionality at or near 100% coverage. - [ ] [System-Tests](https://github.com/DataDog/system-tests/) covering this feature have been added and enabled with the va.b.c-dev version tag. - [ ] There is a benchmark for any new code, or changes to existing code. - [ ] If this interacts with the agent in a new way, a system test has been added. - [ ] New code is free of linting errors. You can check this by running `make lint` locally. - [x] New code doesn't break existing tests. You can check this by running `make test` locally. - [x] Add an appropriate team label so this PR gets put in the right place for the release notes. - [ ] All generated files are up to date. You can check this by running `make generate` locally. - [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally. Validation: - `git diff --check` - `go test ./internal/civisibility/integrations -run 'TestCIVisibilityMetaValueTruncation|TestManualAPIMetaStringValuesAreTruncated' -count=1` - `go test ./internal/civisibility/integrations/gotesting/subtests -tags=deadlock -run Test -count=1` - `go test ./internal/civisibility/integrations/gotesting -run 'Test' -count=1` - `go test ./internal/civisibility/integrations -count=1` Co-authored-by: tony.redondo <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e5f3e17 - Browse repository at this point
Copy the full SHA e5f3e17View commit details -
fix(internal/civisibility): fix known-tests API pagination (#4824)
### What does this PR do? Moves known-tests pagination metadata into the JSON API attributes payload for both requests and responses. The known-tests client now sends `data.attributes.page_info` on the initial request and uses `data.attributes.page_info.page_state` for follow-up requests. It also reads `cursor` and `has_next` from `data.attributes.page_info` in backend responses, so it continues paginating after page 1. The regression test now asserts that `page_info` is not emitted at the top level, verifies the attributes-level request shape, and exercises cursor-based follow-up requests without sending a page size. ### Motivation DataDog/shepherd#46 Go was modeling `page_info` as a sibling of `data`, while the known-tests API contract used by the backend and other tracers places pagination under `data.attributes`. With a contract-correct backend response, Go could parse the first page of tests but missed `has_next` and stopped without requesting subsequent pages. ### Testing - [x] `go test ./internal/civisibility/utils/net` - [x] `go test ./internal/civisibility/...` - [x] `git diff --check -- internal/civisibility/utils/net/known_tests_api.go internal/civisibility/utils/net/known_tests_api_test.go` Co-authored-by: tonyredondo <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f10e26f - Browse repository at this point
Copy the full SHA f10e26fView commit details -
feat(ci-visibility): cache Go read requests and add git upload kill s…
…witch (#4786) ### What does this PR do? Adds a best-effort, short-lived read cache for Go CI Visibility bootstrap requests. The cache covers successful decoded responses from: - settings - known tests - skippable tests - test-management tests The goal is to avoid repeating the same CI Visibility read/bootstrap network requests once per Go package test process in large `go test ./...` runs. The cache is scoped by repository/test context, endpoint, semantic request body, and either a local parent-process identity or an already-resolved CI identity. The implementation is fail-open: cache path, filesystem, lock, decode, validation, or staleness problems fall back to the existing live request path. Cache hits preserve decoded feature/test data and content-derived telemetry, while avoiding HTTP request telemetry because no network request happened. This PR also adds unit coverage for cache keying, TTL selection, storage validation, locking, endpoint behavior, and stale-owner protection. It adds integration coverage for preserving additional-feature initialization across cached reads, plus an E2E-style subprocess test that creates a temporary multi-package Go module and verifies `go test ./...` across multiple package test processes only hits the mock backend once per cacheable endpoint. This PR also adds `DD_CIVISIBILITY_GIT_UPLOAD_ENABLED` as a CI Visibility git upload kill switch. It defaults to `true`; setting it to `false` skips repository upload work while keeping CI Visibility enabled. Supported-configuration metadata is updated for this new environment variable. `CODEOWNERS`, module files, and non-CI Visibility packages are not changed. ### Motivation Large Go repositories can execute many package test binaries during `go test ./...`. Each package process currently pays the same CI Visibility bootstrap read cost even when the repository, commit, branch, service, environment, test configuration, and CI identity are identical. This optimization lets package test processes share those read responses for a short TTL through a local file cache, reducing repeated startup network work without changing feature behavior, span behavior, or returned backend data. ### Testing - [x] `go test ./internal/civisibility/integrations -run TestReadCacheSharesBootstrapAcrossGoTestPackages -count=1 -v` - [x] `go test ./internal/civisibility/utils/net ./internal/civisibility/integrations` - [x] `go test -race ./internal/civisibility/utils/net` - [x] `golangci-lint run ./internal/civisibility/utils/net ./internal/civisibility/integrations` - [x] `git diff --check` - [x] Verified touched files do not add direct `os.Getenv` / `os.LookupEnv` usage, raw `sync.Mutex` / `sync.RWMutex` usage, or new CI Visibility cache environment variables. ### Reviewer's Checklist <!-- * Authors can use this list as a reference to ensure that there are no problems during the review but the signing off is to be done by the reviewer(s). --> - [ ] Changed code has unit tests for its functionality at or near 100% coverage. - [ ] [System-Tests](https://github.com/DataDog/system-tests/) covering this feature have been added and enabled with the va.b.c-dev version tag. - [ ] There is a benchmark for any new code, or changes to existing code. - [ ] If this interacts with the agent in a new way, a system test has been added. - [ ] New code is free of linting errors. You can check this by running `make lint` locally. - [ ] New code doesn't break existing tests. You can check this by running `make test` locally. - [ ] Add an appropriate team label so this PR gets put in the right place for the release notes. - [ ] All generated files are up to date. You can check this by running `make generate` locally. - [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally. Co-authored-by: tony.redondo <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 87ac04a - Browse repository at this point
Copy the full SHA 87ac04aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 57b4d0b - Browse repository at this point
Copy the full SHA 57b4d0bView commit details -
perf(appsec): make rate limiter synchronous to remove idle goroutine …
…cost (#4956) ### What does this PR do? Replaces the AppSec rate limiter's background-goroutine token bucket with a synchronous implementation backed by `golang.org/x/time/rate.Limiter`. - Removes the per-instance background goroutine and hard-coded 500µs `time.Ticker` that woke ~2000×/sec on **every** pod, even idle ones. - `Allow()` now refills the bucket lazily on call via `rate.Limiter`, so idle pods incur **zero** limiter CPU cost. - Deletes the `TokenTicker` struct and its `Start()`/`Stop()` lifecycle. The `NewTokenTicker` / `NewTokenTickerWithInterval` constructors now return the `limiter.Limiter` interface backed directly by `*rate.Limiter` (which already satisfies `Allow() bool`). - Drops the now-unused `Start()`/`Stop()` calls in the WAF listener and the apisec proxy sampler. As a side effect, the proxy sampler's previously-leaked goroutine (the `Sampler` interface had no `Stop`) is eliminated. - Migrates the limiter unit tests from an injected fake clock to the standard `testing/synctest` package (deterministic virtual time); concurrency and benchmark tests remain on real time. Also fixes `BenchmarkLimiter`, which no longer built on modern Go (`B.Loop called with timer stopped`). No change to rate-limit values, defaults, env vars, or the `Limiter` interface contract; behavior is preserved. ### Motivation The limiter's background goroutine consumed roughly 0.3% of a CPU core per instance **continuously** — even on idle pods with no traffic — which adds up meaningfully across the fleet. `golang.org/x/time/rate` is already a direct dependency and is fully synchronous (no goroutine, no ticker), so it gives zero idle cost while preserving the existing token-bucket behavior. Per-call cost (~50ns uncontended) is irrelevant given `Allow()` is invoked at most ~100/s. ### Performance notes Rough local microbenchmarks (single machine, quick comparison — directional only, not a rigorous A/B) informed the choice of `rate.Limiter`: - **Idle cost (what we actually care about):** the old background ticker burned on the order of ~0.3% of a CPU core *per limiter instance, continuously*, even with zero traffic (it woke ~2000×/s regardless of load). The synchronous `rate.Limiter` does no background work, so idle cost drops to ~zero. - **Per-call `Allow()`:** the old lock-free atomic path was a few ns uncontended; `rate.Limiter` is in the tens of ns uncontended, and the two are roughly comparable under contention. Both are allocation-free. At our call frequency (`Allow()` fires at most ~100/s) the difference is noise. - **Why `rate.Limiter` vs a bespoke lazy bucket:** it's already a direct dependency, fully synchronous, and well-tested upstream — not worth hand-rolling and maintaining an equivalent for a sub-microsecond, low-frequency path. Net trade: a negligible per-call overhead in exchange for eliminating a continuous, fleet-wide idle CPU cost. ### Reviewer's Checklist - [x] Changed code has unit tests for its functionality at or near 100% coverage. - [ ] [System-Tests](https://github.com/DataDog/system-tests/) covering this feature have been added and enabled with the va.b.c-dev version tag. - [x] There is a benchmark for any new code, or changes to existing code. - [ ] If this interacts with the agent in a new way, a system test has been added. - [x] New code is free of linting errors. You can check this by running `make lint` locally. - [x] New code doesn't break existing tests. You can check this by running `make test` locally. - [ ] Add an appropriate team label so this PR gets put in the right place for the release notes. - [x] All generated files are up to date. You can check this by running `make generate` locally. - [x] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally. Co-authored-by: eliott.bouhana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 96ec35c - Browse repository at this point
Copy the full SHA 96ec35cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c10cea5 - Browse repository at this point
Copy the full SHA c10cea5View commit details
Commits on Jun 26, 2026
-
Configuration menu - View commit details
-
Copy full SHA for f5f7068 - Browse repository at this point
Copy the full SHA f5f7068View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v2.9.0...v2.9.1