fix(civisibility): truncate CI Visibility meta values#4853
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 9aefee5 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-06-05 10:46:25 Comparing candidate commit 9aefee5 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 297 metrics, 2 unstable metrics, 1 flaky benchmarks without significant changes.
|
cbb9bda to
e9ad943
Compare
e9ad943 to
2180c65
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
### 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]>
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 changingddtrace/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
metadatavalues such asenvortest_session.name, and it does not changeCODEOWNERS.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 onlycontent.metaduring encoding.Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.Validation:
git diff --checkgo test ./internal/civisibility/integrations -run 'TestCIVisibilityMetaValueTruncation|TestManualAPIMetaStringValuesAreTruncated' -count=1go test ./internal/civisibility/integrations/gotesting/subtests -tags=deadlock -run Test -count=1go test ./internal/civisibility/integrations/gotesting -run 'Test' -count=1go test ./internal/civisibility/integrations -count=1