Skip to content

fix(civisibility): truncate CI Visibility meta values#4853

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
feat/civisibility-tslv-meta-truncation
Jun 5, 2026
Merged

fix(civisibility): truncate CI Visibility meta values#4853
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
feat/civisibility-tslv-meta-truncation

Conversation

@tonyredondo

@tonyredondo tonyredondo commented Jun 4, 2026

Copy link
Copy Markdown
Member

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

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • 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.

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

@tonyredondo
tonyredondo requested a review from a team as a code owner June 4, 2026 16:47
@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Jun 4, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 94.12%
Overall Coverage: 62.99% (+4.38%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9aefee5 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jun 4, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-05 10:46:25

Comparing candidate commit 9aefee5 in PR branch feat/civisibility-tslv-meta-truncation with baseline commit eaa4140 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 297 metrics, 2 unstable metrics, 1 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

Known flaky benchmarks without significant changes:

  • scenario:BenchmarkOTLPTraceWriterFlush

@tonyredondo
tonyredondo force-pushed the feat/civisibility-tslv-meta-truncation branch from cbb9bda to e9ad943 Compare June 4, 2026 17:28
@tonyredondo
tonyredondo force-pushed the feat/civisibility-tslv-meta-truncation branch from e9ad943 to 2180c65 Compare June 4, 2026 18:43
@tonyredondo
tonyredondo requested a review from a team as a code owner June 4, 2026 18:43
@tonyredondo tonyredondo changed the title fix(civisibility): truncate TSLV meta values fix(civisibility): truncate CI Visibility meta values Jun 4, 2026
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.69%. Comparing base (eaa4140) to head (9aefee5).

Files with missing lines Patch % Lines
...nal/civisibility/integrations/manual_api_ddtest.go 70.00% 3 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...nal/civisibility/integrations/manual_api_common.go 96.55% <100.00%> (ø)
...visibility/integrations/manual_api_ddtestmodule.go 86.84% <100.00%> (ø)
...isibility/integrations/manual_api_ddtestsession.go 80.37% <100.00%> (ø)
...ivisibility/integrations/manual_api_ddtestsuite.go 84.74% <100.00%> (ø)
internal/civisibility/integrations/meta.go 100.00% <100.00%> (ø)
...nal/civisibility/integrations/manual_api_ddtest.go 59.70% <70.00%> (ø)

... and 443 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gh-worker-ownership-write-b05516
gh-worker-ownership-write-b05516 Bot removed the request for review from a team June 5, 2026 10:22
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 45174a2 into main Jun 5, 2026
164 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the feat/civisibility-tslv-meta-truncation branch June 5, 2026 11:02
darccio pushed a commit that referenced this pull request Jun 25, 2026
### 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants