Skip to content

fix(otel): encode structured trace attributes as MessagePack - #11416

Open
florentinl wants to merge 1 commit into
masterfrom
florentin.labelle/otlp-msgpack-structured-reports
Open

florentinl wants to merge 1 commit into
masterfrom
florentin.labelle/otlp-msgpack-structured-reports

Conversation

@florentinl

@florentinl florentinl commented Nov 24, 2026 •

Copy link
Copy Markdown

What does this PR do?

Preserve the native meta_struct representation when exporting traces over OTLP. Each entry keeps its key and is exported as a MessagePack-encoded bytesValue: HTTP/protobuf carries the bytes directly, and HTTP/JSON base64-encodes the same bytes. Native trace export and ordinary span tags are unchanged.

Motivation

The Node.js native encoder already encodes each meta_struct entry as MessagePack. The old OTLP exporter instead put JSON text inside bytesValue, so a receiver reading those bytes as MessagePack could not reconstruct a RASP stack (_dd.stack). OTLP defines how to carry the bytes; MessagePack is the Datadog payload format, not an OTLP requirement. This change aligns Node.js with the Python (backed by libdatadog), Java and Dotnet tracers.

@dd-octo-sts

dd-octo-sts Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 9.57 MB
Deduped: 10.32 MB
No deduping: 10.32 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.5.3 | 131.25 kB | 531.9 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.16%. Comparing base (1d29d8b) to head (f54710e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11416      +/-   ##
==========================================
- Coverage   99.16%   99.16%   -0.01%     
==========================================
  Files        1136     1136              
  Lines      188620   188616       -4     
  Branches       86       86              
==========================================
- Hits       187036   187032       -4     
  Misses       1584     1584              
Flag Coverage Δ
ai-guard 63.37% <50.00%> (-0.02%) ⬇️
apm-capabilities 55.22% <100.00%> (-0.01%) ⬇️
apm-integrations 81.93% <100.00%> (-0.02%) ⬇️
appsec 59.42% <50.00%> (-0.11%) ⬇️
debugger 70.90% <50.00%> (-0.03%) ⬇️
instrumentation 59.94% <50.00%> (+0.04%) ⬆️
llmobs 82.55% <50.00%> (-0.02%) ⬇️
master-coverage 99.16% <100.00%> (?)
openfeature 68.08% <50.00%> (-0.02%) ⬇️
platform 68.16% <50.00%> (-0.01%) ⬇️
profiling 66.52% <50.00%> (-0.03%) ⬇️
serverless 66.67% <75.00%> (-0.02%) ⬇️
test-optimization 82.02% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@florentinl
florentinl marked this pull request as ready for review November 24, 2026 14:36
@florentinl
florentinl requested review from a team as code owners November 24, 2026 14:36
@florentinl
florentinl requested review from bengl and mabdinur and removed request for a team November 24, 2026 14:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T14:38:03.420864Z f54710e Draft marked ready
🔒 Security Review ✅ Completed 2026-11-24T14:45:32.371321Z f54710e Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pr-commenter

pr-commenter Bot commented Nov 24, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-11-24 14:37:46

Comparing candidate commit f54710e in PR branch florentin.labelle/otlp-msgpack-structured-reports with baseline commit 1d29d8b in branch master.

📊 Benchmarking dashboard

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

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-20

  • unstable max_rss_usage [-42.436MB; +75.664MB] or [-17.722%; +31.598%]

scenario:appsec-appsec-enabled-with-attacks-20

  • unstable max_rss_usage [-23.406MB; +37.284MB] or [-13.246%; +21.099%]

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-20

  • unstable max_rss_usage [-48.576MB; +80.951MB] or [-20.117%; +33.524%]

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-26

  • unstable max_rss_usage [-24.479MB; +34.457MB] or [-8.843%; +12.448%]

scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-20

  • unstable max_rss_usage [-29.895MB; +24.819MB] or [-8.470%; +7.032%]

scenario:encoders-0.4-immediate-flush-20

  • unstable max_rss_usage [-2.151MB; +6.864MB] or [-2.520%; +8.041%]

scenario:openfeature-initialization-configuration-20

  • unstable max_rss_usage [-7.972MB; +3.341MB] or [-9.668%; +4.051%]

scenario:openfeature-initialization-configuration-26

  • unstable cpu_user_time [-127.997ms; +154.202ms] or [-5.563%; +6.702%]
  • unstable execution_time [-131.520ms; +156.955ms] or [-5.565%; +6.642%]
  • unstable throughput [-25956.088op/s; +22317.550op/s] or [-6.050%; +5.202%]

scenario:openfeature-initialization-error-20

  • unstable max_rss_usage [-4017.729KB; +5413.002KB] or [-5.244%; +7.065%]

scenario:openfeature-scale-full-26

  • unstable max_rss_usage [-44.115MB; +24.017MB] or [-19.499%; +10.616%]

@datadog-prod-us1-4

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 98.57% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f54710e | Docs | View more details | Give us feedback!

This branch has not been deployed

No deployments
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.

1 participant