Skip to content

chore: improvements to ETP#4586

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 25 commits into
mainfrom
hannahkm/v1-followups
Apr 14, 2026
Merged

chore: improvements to ETP#4586
gh-worker-dd-mergequeue-cf854d[bot] merged 25 commits into
mainfrom
hannahkm/v1-followups

Conversation

@hannahkm

@hannahkm hannahkm commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  1. Set dummy values for when serialization fails to prevent failures during decoding
  2. Removes duplicated serialization for span links
  3. Adds warning logs for failed serialization (inlined to prevent increased allocations)
  4. Updates string table to use string keys instead of stringValue in the indices map to reduce map lookup times
  5. Further reduces lookups by getting common values during preexisting map iteration

Motivation

Align with RFC and Java implementation. Improvements to performance.

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.

Unsure? Have a question? Request a review!

@codecov

codecov Bot commented Mar 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.70588% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.75%. Comparing base (43ac765) to head (e4cd6de).

Files with missing lines Patch % Lines
ddtrace/tracer/payload_v1.go 64.70% 19 Missing and 5 partials ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
ddtrace/tracer/payload_v1.go 68.58% <64.70%> (ø)

... and 439 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.

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Mar 23, 2026

Copy link
Copy Markdown

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 64.18%
Overall Coverage: 60.09%

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e4cd6de | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@pr-commenter

pr-commenter Bot commented Mar 23, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-04-14 09:00:07

Comparing candidate commit e4cd6de in PR branch hannahkm/v1-followups with baseline commit 43ac765 in branch main.

Found 15 performance improvements and 0 performance regressions! Performance is the same for 203 metrics, 6 unstable metrics.

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 ----------------------------------'

scenario:BenchmarkPayloadVersions/detailed_1000spans/v1_0-25

  • 🟩 allocated_mem [-7 bytes; -7 bytes] or [-6.422%; -6.422%]
  • 🟩 execution_time [-54.997µs; -53.677µs] or [-9.246%; -9.024%]

scenario:BenchmarkPayloadVersions/detailed_100spans/v1_0-25

  • 🟩 allocated_mem [-1 bytes; -1 bytes] or [-3.030%; -3.030%]
  • 🟩 execution_time [-6.020µs; -5.591µs] or [-9.863%; -9.161%]

scenario:BenchmarkPayloadVersions/detailed_10spans/v1_0-25

  • 🟩 execution_time [-728.679ns; -692.121ns] or [-9.897%; -9.400%]

scenario:BenchmarkPayloadVersions/detailed_1spans/v1_0-25

  • 🟩 execution_time [-83.402ns; -74.398ns] or [-5.503%; -4.909%]

scenario:BenchmarkPayloadVersions/metastruct_1000spans/v1_0-25

  • 🟩 execution_time [-55.679µs; -53.993µs] or [-16.710%; -16.204%]

scenario:BenchmarkPayloadVersions/metastruct_100spans/v1_0-25

  • 🟩 execution_time [-5.602µs; -5.443µs] or [-14.708%; -14.290%]

scenario:BenchmarkPayloadVersions/metastruct_10spans/v1_0-25

  • 🟩 execution_time [-717.407ns; -666.793ns] or [-10.325%; -9.597%]

scenario:BenchmarkPayloadVersions/metastruct_1spans/v1_0-25

  • 🟩 execution_time [-133.741ns; -86.259ns] or [-3.522%; -2.272%]

scenario:BenchmarkPayloadVersions/simple_1000spans/v1_0-25

  • 🟩 allocated_mem [-6 bytes; -6 bytes] or [-11.321%; -11.321%]
  • 🟩 execution_time [-55.054µs; -54.246µs] or [-19.200%; -18.919%]

scenario:BenchmarkPayloadVersions/simple_100spans/v1_0-25

  • 🟩 execution_time [-5.773µs; -5.539µs] or [-19.360%; -18.575%]

scenario:BenchmarkPayloadVersions/simple_10spans/v1_0-25

  • 🟩 execution_time [-708.636ns; -683.364ns] or [-17.866%; -17.229%]

scenario:BenchmarkPayloadVersions/simple_1spans/v1_0-25

  • 🟩 execution_time [-132.981ns; -119.879ns] or [-11.829%; -10.663%]

@hannahkm
hannahkm marked this pull request as ready for review March 25, 2026 21:32
@hannahkm
hannahkm requested a review from a team as a code owner March 25, 2026 21:32
@darccio

darccio commented Mar 26, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@darccio darccio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general it's fine, but the regressions must be addressed.

I'm curious why we need to set _dd.span_links when we could just postpone the serialization until the very moment we really need to.

Comment thread ddtrace/tracer/payload_v1.go Outdated
Comment thread ddtrace/tracer/payload_v1.go Outdated
@hannahkm
hannahkm requested a review from a team as a code owner April 1, 2026 18:07

@kakkoyun kakkoyun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tedious work.

@kakkoyun
kakkoyun requested review from darccio and removed request for darccio April 9, 2026 09:51
@darccio

darccio commented Apr 13, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c65531fd5d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ddtrace/tracer/payload_v1.go
@hannahkm

Copy link
Copy Markdown
Contributor Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@darccio darccio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with just a smol nit.

Comment on lines +1633 to +1636
//go:noinline
func warnUnsupportedValue(t uint32) {
log.Warn("failed to serialize unsupported type: %d", t)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it need the go:inline directive?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:hmmnod: It's not strictly necessary here, I think, since the callers are already pretty complex, so there's no chance of inlining unless we simplify the them. But that might be difficult...

ddtrace/tracer/payload_v1.go:941:6: cannot inline anyValue.encode: function too complex: cost 1059 exceeds budget 80

ddtrace/tracer/payload_v1.go:713:6: cannot inline (*payloadV1).encodeSpanEvents: function too complex: cost 1517 exceeds budget 80

So, tl;dr, probably doesn't need go:noinline

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.

3 participants