Skip to content

feat: add v1 isolated bricks for trace exporter - #2280

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits into
mainfrom
anais/v1-canonical-interpretation
Aug 12, 2026
Merged

feat: add v1 isolated bricks for trace exporter#2280
gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits into
mainfrom
anais/v1-canonical-interpretation

Conversation

@anais-raison

@anais-raison anais-raison commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds v1-native equivalents of existing v0.4 pipeline helpers, as groundwork for making v1::Span/v1::TraceChunk the exporter's canonical internal type:

  • trace_utils_v1::drop_chunks and TraceFilterer::filter_traces_v1 (libdd-trace-utils)
  • stats::add_spans_to_stats_v1 / stats::process_traces_for_stats_v1 (libdd-data-pipeline)

Nothing is wired into the live pipeline yet.

Motivation

Part of APMSP-2812 : migration of the exporter from v0.4 to v1 with isolated bricks first before one final breaking PR that will handle the actual swap.

Additional Notes

Pure addition, no behavior change — these functions aren't called anywhere yet, so there's no regression risk.

State of the ticket

Done so far (in this PR)

  • StatSpan implemented for v1::Span
  • trace_filter::Span implemented for v1::Span
  • get_root_span_index, compute_top_level_span (v1)
  • drop_chunks v1 + filter_traces_v1
  • add_spans_to_stats_v1 / process_traces_for_stats_v1

Remaining (in a follow up PR)

  • otlp_encoder::map_traces_to_otlp v1
  • LogSpan/log_writer.rs v1
  • agentless_encoder::encode_payload v1

Swap PR (with breaking changes)

  • Retype send_trace_chunks/send_trace_chunks_async to Vec<v1::TraceChunk>
  • Remove send/send_async and all msgpack decoding from TraceExporter
  • Update TraceChunks (tracer_payload.rs) and trace_serializer.rs
  • Actually wire process_traces_for_stats_v1/add_spans_to_stats_v1/filter_traces_v1 into the live pipeline (drop the #[allow(dead_code)] markers)
  • Remove the v04::Span model and dead v0.4 code (might do this in a separate cleanup PR)

@anais-raison
anais-raison marked this pull request as ready for review July 27, 2026 14:44
@anais-raison
anais-raison requested review from a team as code owners July 27, 2026 14:44
@datadog-official

datadog-official Bot commented Jul 27, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 94.19%
Overall Coverage: 75.97% (+0.16%)

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

@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: 16f08876b2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread libdd-trace-stats/src/span_concentrator/stat_span.rs
Comment thread libdd-trace-utils/src/trace_filter.rs
Comment thread libdd-trace-utils/src/trace_filter.rs Outdated
Comment thread libdd-trace-utils/src/span/trace_utils_v1.rs Outdated
Comment thread libdd-data-pipeline/src/trace_exporter/stats.rs Outdated
@pr-commenter

pr-commenter Bot commented Jul 27, 2026

Copy link
Copy Markdown

Benchmarks

Comparison

Benchmark execution time: 2026-08-12 13:02:15

Comparing candidate commit 209a336 in PR branch anais/v1-canonical-interpretation with baseline commit c5b96c3 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 139 metrics, 0 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 ----------------------------------'

Benchmark execution time: 2026-08-12 13:00:59

Comparing candidate commit 209a336 in PR branch anais/v1-canonical-interpretation with baseline commit c5b96c3 in branch main.

Found 3 performance improvements and 3 performance regressions! Performance is the same for 69 metrics, 10 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:datadog_sample_span/multiple_rules_first_match/wall_time

  • 🟥 execution_time [+6.958ns; +7.081ns] or [+4.329%; +4.405%]

scenario:datadog_sample_span/multiple_rules_last_match/wall_time

  • 🟥 execution_time [+8.535ns; +8.647ns] or [+4.369%; +4.426%]

scenario:glob_matcher/ascii_pattern_unicode_subject/wall_time

  • 🟥 execution_time [+6.795ns; +6.886ns] or [+4.830%; +4.895%]

scenario:glob_matcher/ascii_wildcard_question_match/wall_time

  • 🟩 execution_time [-1.707ns; -1.636ns] or [-4.411%; -4.227%]

scenario:trace_buffer/4_senders/no_delay

  • 🟩 execution_time [-157.973µs; -126.913µs] or [-6.582%; -5.288%]
  • 🟩 throughput [+85566.715op/s; +106736.263op/s] or [+5.700%; +7.110%]

Candidate

Omitted due to size.

Baseline

Omitted due to size.

@dd-octo-sts

dd-octo-sts Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.20 MB 8.20 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 89.18 MB 89.18 MB +0% (+48 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 100.36 MB 100.36 MB +0% (+56 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.06 MB 11.06 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 26.63 MB 26.63 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 94.56 KB 94.56 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 191.41 MB 191.41 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 1000.65 MB 1000.66 MB +0% (+11.38 KB) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.71 MB 8.71 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 94.56 KB 94.56 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 25.62 MB 25.62 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 51.01 MB 51.01 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 23.20 MB 23.20 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 96.04 KB 96.04 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 196.25 MB 196.26 MB +0% (+8.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 990.10 MB 990.13 MB +0% (+23.85 KB) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.73 MB 6.73 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 96.04 KB 96.04 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 27.55 MB 27.55 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 48.56 MB 48.56 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 79.46 MB 79.46 MB +0% (+48 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.12 MB 9.12 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 95.11 MB 95.11 MB +0% (+40 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.14 MB 11.14 MB 0% (0 B) 👌

Comment thread libdd-data-pipeline/src/trace_exporter/stats.rs
Comment thread libdd-data-pipeline/src/trace_exporter/stats.rs Outdated
Comment thread libdd-trace-stats/src/span_concentrator/stat_span.rs
Comment thread libdd-trace-utils/src/span/trace_utils_v1.rs Outdated
Comment thread libdd-trace-utils/src/span/trace_utils_v1.rs Outdated
Comment thread libdd-trace-utils/src/span/trace_utils_v1.rs Outdated
Comment thread libdd-trace-utils/src/span/trace_utils_v1.rs
Comment thread libdd-trace-utils/src/span/trace_utils_v1.rs Outdated
Comment thread libdd-data-pipeline/src/trace_exporter/stats.rs Outdated
Comment thread libdd-data-pipeline/src/trace_exporter/stats.rs
Comment thread libdd-trace-stats/src/span_concentrator/stat_span.rs Outdated
Comment thread libdd-trace-stats/src/span_concentrator/stat_span.rs
Comment thread libdd-trace-utils/src/span/trace_utils_v1.rs
Comment thread libdd-trace-utils/src/span/trace_utils_v1.rs Outdated
…terpretation

# Conflicts:
#	libdd-trace-stats/src/span_concentrator/mod.rs

@ajgajg1134 ajgajg1134 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like all my V1 related feedback was addressed :)

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 7ba36d7 into main Aug 12, 2026
143 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the anais/v1-canonical-interpretation branch August 12, 2026 14:00
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.

4 participants