Skip to content

v5.54.0 proposal #5777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 36 commits into
base: v5.x
Choose a base branch
from
Draft

v5.54.0 proposal #5777

wants to merge 36 commits into from

Conversation

dd-trace-js[bot]
Copy link

@dd-trace-js dd-trace-js bot commented May 27, 2025

  • [36f4669c7a] - (SEMVER-PATCH) Fix missing returns (Ruben Bridgewater) #5799
  • [d0de1c38ac] - (SEMVER-PATCH) Activate more complicated unicorn eslint rules (Ruben Bridgewater) #5790
  • [8b95a5fea0] - (SEMVER-PATCH) Update dependencies (Ruben Bridgewater) #5791
  • [ea7e2ca526] - (SEMVER-PATCH) ci(aws-sdk): fix bedrock runtime tests failing (Sam Brenner) #5795
  • [c504dc6244] - (SEMVER-PATCH) Pin openai tests to below v5 in plugin test (Ruben Bridgewater) #5793
  • [5e0f54e6fd] - (SEMVER-PATCH) Activate more unicorn eslint rules (Ruben Bridgewater) #5789
  • [5320f381d8] - (SEMVER-PATCH) Activate multiple eslint rules (Ruben Bridgewater) #5786
  • [153a813e63] - (SEMVER-PATCH) add release status checks (Roch Devost) #5674
  • [db66b0a2fb] - (SEMVER-PATCH) [test-optimization] [SDTEST-1923] Fix Playwright tests in v5 (Mario Vidal Domínguez) #5788
  • [b9cb0ba524] - (SEMVER-PATCH) [test optimization] Update automatic log submission tests to include playwright (Juan Antonio Fernández de Alba) #5783
  • [108a847fdb] - (SEMVER-MINOR) add baggage to span tags (Ida Liu) #5767
  • [fe11a427e8] - (SEMVER-MINOR) feat: add deterministic sampling with knuth based on TraceId (Benjamin De Bernardi) #5712
  • [1639cf7f58] - (SEMVER-PATCH) bump dc-polyfill to 0.1.9 (Roch Devost) #5784
  • [c946c71223] - (SEMVER-PATCH) test: clean up Mocha setup code withVersions and withExports (Thomas Watson) #5785
  • [6bfd2dd891] - (SEMVER-MINOR) [Code Origin for Spans] Add support for Express entry spans (Thomas Watson) #5423
  • [d863bc420e] - (SEMVER-PATCH) test: clean up yarn services script (Thomas Watson) #5781
  • [676146afe4] - (SEMVER-PATCH) test: remove manual promise handling from test (Thomas Hunter II) #5759
  • [f7287a1329] - (SEMVER-PATCH) Make the ddBasePath variable a static string (Thomas Watson) #5775
  • [019b06661e] - (SEMVER-PATCH) Docs on adding new APIs to dd-trace-api (Bryan English) #5749
  • [b5dfaab5a9] - (SEMVER-PATCH) test: clean up algorithm to create versions/* folders (Thomas Watson) #5778
  • [4c99cbfd0f] - (SEMVER-PATCH) test: clean up invalid code in yarn services script (Thomas Watson) #5779
  • [68d5534d11] - (SEMVER-PATCH) Bump ESLint dependencies (Thomas Watson) #5776
  • [c970eb5dbb] - (SEMVER-MINOR) Configurable NativeSpaceProfiler samplingInterval (Attila Szegedi) #5766
  • [c9918c0fcc] - (SEMVER-MINOR) New vulnerability sampling algorithm (Ugaitz Urien) #5697
  • [5ba58ae920] - (SEMVER-PATCH) Fix unicorn linter errors to activate more rules (Ruben Bridgewater) #5501
  • [62593f201f] - (SEMVER-PATCH) [test-optimization] [SDTEST-2034] Send tag when there is no branch (Mario Vidal Domínguez) #5770
  • [3ed46b7a4a] - (SEMVER-MINOR) Extended Request Data Collection (Carles Capell) #5709
  • [632908899f] - (SEMVER-PATCH) [DI] Fix race condition if breakpoint is hit while being removed (Thomas Watson) #5769
  • [f58c6a3f9e] - (SEMVER-MINOR) Add support for profiler upload compression methods and levels (Attila Szegedi) #5765
  • [1d71591f2e] - (SEMVER-PATCH) Fix amqplib not always passing through the correct method names (Ruben Bridgewater) #5676
  • [ef7552b465] - (SEMVER-PATCH) Remove code targeting unsupported Node.js versions (Ruben Bridgewater) #5672
  • [32dd20e0cc] - (SEMVER-PATCH) [DI] Refactor mutex code guarding race condition (Thomas Watson) #5728
  • [91ecb745a5] - (SEMVER-PATCH) [test-optimization] New default value for test session name (breaking change) (Juan Antonio Fernández de Alba) #5409
  • [dc92b29025] - (SEMVER-PATCH) [test-optimization] [SDTEST-1884] Increase minimum supported version of playwright (breaking change) (Mario Vidal Domínguez) #5596
  • [1f3b634ab9] - (SEMVER-PATCH) [test-optimization] Increase minimum supported version of cypress (breaking change) (Juan Antonio Fernández de Alba) #5397

juan-fernandez and others added 11 commits May 27, 2025 05:06
When adding, removing or modifying a breakpoint there can be a race
condtion if two Remove Config configs are received in quick succession.
We already have a mutex to guard against this, but the code was in need
of a refactor because:

1. We had duplicate mutex code in two different files, where only one
   was needed
2. We couldn't easily test the main mutex code in a unit test as it was
   added in the calling file and therefore not isolated to the function
   containing the race condition.
Methods with more than two words would not be renamed properly.
That way they would not be picked up anymore.
* Add support for upload compression methods and levels
* Allows "off" and "zstd" in addition to previously only used gzip as compression methods.
The internal state kept by the DI code of which probes are active, might
not be 100% in sync with the actual breakpoints configured via the
Chrome DevTools Protocol (CDP).

This could happen if the probe is in the process of either being updated
or removed while at the same time being hit in the instrumented
application.
* Headers collection config

* Revamp headers collection + extended collection

* Fix condition for extended collection

* Body collection config

* Check for RASP events

* Testing extend header collection

* RASP body collection tests

* Minor reformats

* Lint

* Clearer condition

* Truncate body on body collection

* Complete config test

* Fix lint

* Reporter init w/ appsec config

* Remove TODO

* Clarify collection comments

* Update test.ts with new configuration

* Fix linting

* Integration test for RASP request body collection

* Set tag when reported request body is truncated

* Integration test for data collection

* Fix linting

* Check for header names in integration test

* Set the correct value for request body exceeded size tag

* Add support for toJSON in request body truncation

* Invert condition for early return

* Avoid slicing on request body truncation and implement it in a for loop

* Rename reporter config

* Simplify condition logic

* Create block scope in switch case to limit the scope of declared vars

* Initialize Array with a fixed size

Co-authored-by: simon-id <[email protected]>

* Switch to for loop

Co-authored-by: simon-id <[email protected]>

* Set env var as strings

Co-authored-by: simon-id <[email protected]>

* Set env var as string

Co-authored-by: simon-id <[email protected]>

* Refactor headers group declaration + using set instead of arrays

* Cache res.getHeaders()

* Fix config and its test

* Fix config test for defaults values

* Check reported request body truncation on integration test

* Add a comment to clarify the test case

* Add a test case to check no request body is collected when feat is disabled

* Manage custom toJSON function in arrays

---------

Co-authored-by: simon-id <[email protected]>
* Fix unicorn linter errors to activate more rules

* Address uncertain unicorn linter errors

These rules might have to stay deactivated.

* Fix unicorn lint issues

* Activate lots of unicorn eslint rules

* Fix auto fixable unicorn linter errors

This also improves the performance for lookups by using sets instead
of arrays.

* Fix linter issues

This refactors code for readability by addressing linter issues.

* Fixup manual things that were auto fixed

Simplify code where possible.

* Fix auto fixable eslint issues

* fixup!

* fixup!

* fixup! Address comments and very small findings
@dd-trace-js dd-trace-js bot mentioned this pull request May 27, 2025
Copy link

github-actions bot commented May 27, 2025

Overall package size

Self size: 9.48 MB
Deduped: 103.7 MB
No deduping: 104.21 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | @datadog/libdatadog | 0.5.1 | 29.73 MB | 29.73 MB | | @datadog/native-appsec | 8.5.2 | 19.33 MB | 19.34 MB | | @datadog/pprof | 5.8.0 | 12.55 MB | 12.92 MB | | @datadog/native-iast-taint-tracking | 4.0.0 | 11.72 MB | 11.73 MB | | @opentelemetry/core | 1.30.1 | 908.66 kB | 7.16 MB | | protobufjs | 7.5.3 | 2.95 MB | 5.6 MB | | @datadog/wasm-js-rewriter | 4.0.1 | 2.85 MB | 3.58 MB | | @datadog/native-metrics | 3.1.1 | 1.02 MB | 1.43 MB | | @opentelemetry/api | 1.8.0 | 1.21 MB | 1.21 MB | | import-in-the-middle | 1.14.0 | 120.58 kB | 842.2 kB | | source-map | 0.7.4 | 226 kB | 226 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | lru-cache | 7.18.3 | 133.92 kB | 133.92 kB | | pprof-format | 2.1.0 | 111.69 kB | 111.69 kB | | @datadog/sketches-js | 2.1.1 | 109.9 kB | 109.9 kB | | lodash.sortby | 4.7.0 | 75.76 kB | 75.76 kB | | ignore | 5.3.2 | 53.63 kB | 53.63 kB | | istanbul-lib-coverage | 3.2.2 | 34.37 kB | 34.37 kB | | rfdc | 1.4.1 | 27.15 kB | 27.15 kB | | @isaacs/ttlcache | 1.4.1 | 25.2 kB | 25.2 kB | | dc-polyfill | 0.1.9 | 25.11 kB | 25.11 kB | | tlhunter-sorted-set | 0.1.0 | 24.94 kB | 24.94 kB | | shell-quote | 1.8.2 | 23.54 kB | 23.54 kB | | limiter | 1.1.5 | 23.17 kB | 23.17 kB | | retry | 0.13.1 | 18.85 kB | 18.85 kB | | semifies | 1.0.0 | 15.84 kB | 15.84 kB | | jest-docblock | 29.7.0 | 8.99 kB | 12.76 kB | | crypto-randomuuid | 1.0.0 | 11.18 kB | 11.18 kB | | ttl-set | 1.0.0 | 4.61 kB | 9.69 kB | | mutexify | 1.4.0 | 5.71 kB | 8.74 kB | | path-to-regexp | 0.1.12 | 6.6 kB | 6.6 kB | | koalas | 1.0.2 | 6.47 kB | 6.47 kB | | module-details-from-path | 1.0.4 | 3.96 kB | 3.96 kB |

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

Copy link

codecov bot commented May 27, 2025

Codecov Report

Attention: Patch coverage is 84.34343% with 124 lines in your changes missing coverage. Please review.

Please upload report for BASE (v5.x@59da1f2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
packages/dd-trace/src/llmobs/tagger.js 71.95% 23 Missing ⚠️
packages/datadog-instrumentations/src/cucumber.js 0.00% 17 Missing ⚠️
...ackages/datadog-instrumentations/src/mocha/main.js 0.00% 16 Missing ⚠️
packages/dd-trace/src/msgpack/encoder.js 53.57% 13 Missing ⚠️
packages/dd-trace/src/appsec/rasp/index.js 0.00% 10 Missing ⚠️
...ckages/datadog-instrumentations/src/mocha/utils.js 0.00% 8 Missing ⚠️
packages/dd-trace/src/llmobs/util.js 0.00% 5 Missing ⚠️
...ckages/datadog-instrumentations/src/http/client.js 0.00% 3 Missing ⚠️
packages/datadog-instrumentations/src/kafkajs.js 81.81% 2 Missing ⚠️
packages/datadog-instrumentations/src/openai.js 81.81% 2 Missing ⚠️
... and 23 more
Additional details and impacted files
@@           Coverage Diff           @@
##             v5.x    #5777   +/-   ##
=======================================
  Coverage        ?   79.37%           
=======================================
  Files           ?      523           
  Lines           ?    23781           
  Branches        ?        0           
=======================================
  Hits            ?    18877           
  Misses          ?     4904           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 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.

@pr-commenter
Copy link

pr-commenter bot commented May 27, 2025

Benchmarks

Benchmark execution time: 2025-05-31 05:18:40

Comparing candidate commit d7c4b5b in PR branch v5.54.0-proposal with baseline commit 59da1f2 in branch v5.x.

Found 21 performance improvements and 12 performance regressions! Performance is the same for 1236 metrics, 54 unstable metrics.

scenario:plugin-graphql-control-18

  • 🟩 cpu_user_time [-35.587ms; -29.711ms] or [-11.935%; -9.965%]
  • 🟩 execution_time [-36.559ms; -33.979ms] or [-10.542%; -9.798%]

scenario:plugin-graphql-control-20

  • 🟩 cpu_user_time [-28.523ms; -20.935ms] or [-9.509%; -6.979%]
  • 🟩 execution_time [-32.888ms; -26.492ms] or [-9.422%; -7.590%]
  • 🟩 instructions [-59.7M instructions; -42.0M instructions] or [-8.854%; -6.225%]

scenario:plugin-graphql-control-22

  • 🟩 cpu_user_time [-22.561ms; -15.595ms] or [-8.167%; -5.645%]
  • 🟩 execution_time [-26.049ms; -22.959ms] or [-7.787%; -6.863%]
  • 🟩 instructions [-59.4M instructions; -46.2M instructions] or [-8.420%; -6.547%]

scenario:plugin-graphql-with-async-hooks-18

  • 🟩 cpu_user_time [-29.946ms; -22.248ms] or [-8.055%; -5.985%]
  • 🟩 execution_time [-34.443ms; -27.922ms] or [-8.031%; -6.511%]
  • 🟩 instructions [-59.5M instructions; -46.7M instructions] or [-6.850%; -5.383%]

scenario:plugin-graphql-with-async-hooks-20

  • 🟩 instructions [-61.0M instructions; -48.3M instructions] or [-7.687%; -6.088%]

scenario:plugin-graphql-with-async-hooks-22

  • 🟩 execution_time [-26.855ms; -22.976ms] or [-6.734%; -5.761%]
  • 🟩 instructions [-60.2M instructions; -43.1M instructions] or [-7.407%; -5.300%]

scenario:plugin-graphql-with-depth-and-collapse-off-18

  • 🟩 max_rss_usage [-11.036MB; -9.628MB] or [-6.793%; -5.927%]

scenario:plugin-graphql-with-depth-and-collapse-on-18

  • 🟩 cpu_user_time [-86.990ms; -72.362ms] or [-7.735%; -6.434%]
  • 🟩 execution_time [-89.447ms; -75.792ms] or [-7.230%; -6.126%]

scenario:plugin-graphql-with-depth-off-18

  • 🟩 cpu_user_time [-94.534ms; -77.083ms] or [-8.271%; -6.744%]
  • 🟩 execution_time [-97.179ms; -82.489ms] or [-7.743%; -6.573%]

scenario:plugin-graphql-with-depth-on-max-18

  • 🟩 cpu_user_time [-85.224ms; -66.172ms] or [-7.631%; -5.925%]
  • 🟩 execution_time [-91.306ms; -73.882ms] or [-7.408%; -5.994%]

scenario:startup-control-everything-20

  • 🟥 cpu_user_time [+175.227ms; +201.717ms] or [+10.353%; +11.918%]
  • 🟥 execution_time [+198.423ms; +227.475ms] or [+10.020%; +11.487%]
  • 🟥 instructions [+498.2M instructions; +518.9M instructions] or [+11.095%; +11.555%]

scenario:startup-control-everything-22

  • 🟥 cpu_user_time [+161.297ms; +197.594ms] or [+9.024%; +11.055%]
  • 🟥 execution_time [+202.592ms; +239.890ms] or [+9.199%; +10.893%]
  • 🟥 instructions [+578.9M instructions; +600.6M instructions] or [+11.586%; +12.021%]

scenario:startup-with-tracer-everything-20

  • 🟥 cpu_user_time [+201.824ms; +228.945ms] or [+9.961%; +11.299%]
  • 🟥 execution_time [+223.930ms; +249.628ms] or [+9.445%; +10.529%]
  • 🟥 instructions [+511.3M instructions; +530.7M instructions] or [+9.363%; +9.719%]

scenario:startup-with-tracer-everything-22

  • 🟥 cpu_user_time [+143.513ms; +171.230ms] or [+6.586%; +7.858%]
  • 🟥 execution_time [+194.146ms; +226.259ms] or [+7.006%; +8.165%]
  • 🟥 instructions [+551.8M instructions; +572.7M instructions] or [+8.364%; +8.681%]

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented May 27, 2025

Datadog Report

Branch report: v5.54.0-proposal
Commit report: 9849684
Test service: dd-trace-js-integration-tests

✅ 0 Failed, 984 Passed, 0 Skipped, 19m 14.71s Total Time

uurien and others added 3 commits May 28, 2025 05:06
Allow users of ddtrace to configure samplingIntervals for the
NativeSpaceProfiler. Prior to this Wall, Events, and Space Profilers were all
referencing the same option: samplingInterval, however, they had different
units. NativeWallProfiler and EventsProfiler expected samplingInterval to be in
hertz, and NativeSpaceProfiler expected samplingInterval to be in number of
bytes between samples. This and the lack of environment variable support made
it impossible for users to configure the NativeSpaceProfiler samplingInterval.

Heap sampling rate needs to be configurable for JS applications that have very
high allocation rates. In services, with high allocation rates, the default
sampling interval can cause unacceptable slow downs. This change allows users
to find a more appropriate heap sampling rate that is tuned to their
application's allocation rate.

Co-authored-by: Dylan Visher <[email protected]>
@dd-trace-js dd-trace-js bot force-pushed the v5.54.0-proposal branch from f49046d to 1007e57 Compare May 28, 2025 05:06
watson and others added 10 commits May 29, 2025 05:06
The removed code was basically a noop. It has never had any effect as
you can't use the `delete` symbol to remove elements from a `Set`.
When running `yarn services`, a number of folders are created in the
project, if they do not already exist. The algorithm to ensure these
folders were present had a few bugs (which luckily didn't affect the
outcome), and were overly complicated. This cleans all that up.
There's no reason to expose a function to re-calculate the `ddBasePath`
as it will be the same throughout the run-time of the process.
To enable, set `DD_CODE_ORIGIN_FOR_SPANS_ENABLED=true`.

This is a follow up to PR #4449, which added support for Fastify entry
spans.
* add threshold computation

* add traceId BigInt func

* add span context to sampler

* add jsdoc and backport old Sampler as RandomSampler

* accept both Span and SpanContext in isSampled func

* update calls to isSampled with span

* move langchain plugin to deterministic sampler
* add baggage to span tags

* update config option naming

* update test
@dd-trace-js dd-trace-js bot force-pushed the v5.54.0-proposal branch from 1007e57 to 23c5837 Compare May 29, 2025 05:07
juan-fernandez and others added 5 commits May 30, 2025 05:06
* Activate unicorn/no-useless-undefined eslint rule

* Activate unicorn/number-literal-case eslint rule

* Activate unicorn/prefer-includes eslint rule

* Activate unicorn/prefer-set-has eslint rule

* Activate unicorn/prefer-native-coercion-functions eslint rule

* Activate unicorn/no-lonely-if eslint rule

* Activate unicorn/prefer-logical-operator-over-ternary eslint rule
* Activate unicorn/no-unreadable-array-destructuring eslint rule

* Activate unicorn/numeric-separators-style eslint rule

* Activate unicorn/prefer-string-raw eslint rule

* Partially fix unicorn/prefer-spread eslint errors

* Activate unicorn/prefer-optional-catch-binding eslint rule

* Activate unicorn/prefer-string-slice eslint rule

* Activate unicorn/prefer-number-properties eslint rule

* Activate unicorn/prefer-object-from-entries eslint rule

* Manually address two small issues

* Activate unicorn/no-unreadable-iife eslint rule

* Activate unicorn/no-object-as-default-parameter eslint rule

* Activate unicorn/no-negated-condition eslint rule

* Fix .slice issues and deactivate lint rule for old guardrails

* Remove obsolete brackets

* As drive-by mark a couple of rules as explicitly not to be
activated.
@dd-trace-js dd-trace-js bot force-pushed the v5.54.0-proposal branch from 23c5837 to 61a497f Compare May 30, 2025 05:06
BridgeAR and others added 6 commits May 31, 2025 05:06
* fix tests

* fix aws require path for llmobs
This updates most dependencies in their minor/patch range, if an
update is available.

As devDependency the Node.js types are updated to v18 to reflect
the latest changes that we support.
Multer is updated to v2 and sinon is updated to v18.
* Activate unicorn/no-anonymous-default-export eslint rule

* Minor improvements while working on the code

* Activate unicorn/consistent-function-scoping eslint rule

* Activate unicorn/prefer-ternary eslint rule

* Partially fix unicorn/prefer-spread eslint errors

* Partially address unicorn/no-for-loop errors

The rule is not yet active as long as it changes to use
Object.entries() in case the iteration count is needed.

* Manually refactor things for future eslint rules

* Fix faulty tests and improve readability of the refactoring
@dd-trace-js dd-trace-js bot force-pushed the v5.54.0-proposal branch from 61a497f to d7c4b5b Compare May 31, 2025 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.