Skip to content

Comments

v5.88.0 proposal#7586

Draft
dd-octo-sts[bot] wants to merge 23 commits intov5.xfrom
v5.88.0-proposal
Draft

v5.88.0 proposal#7586
dd-octo-sts[bot] wants to merge 23 commits intov5.xfrom
v5.88.0-proposal

Conversation

@dd-octo-sts
Copy link

@dd-octo-sts dd-octo-sts bot commented Feb 20, 2026

  • [f370fb3068] - (SEMVER-PATCH) [test optimization] Improve cypress - RUM integration (Juan Antonio Fernández de Alba) #7600
  • [c639f33b81] - (SEMVER-PATCH) fix(dsm): move dsm plugin init to start from bindStart (robcarlan-datadog) #7395
  • [d7e644c8ee] - (SEMVER-MINOR) Update libdatadog-nodejs to 0.8.1 (Attila Szegedi) #7525
  • [3f3c150820] - (SEMVER-PATCH) chore(test): Fix cmd injection telemetry flaky tests (Ugaitz Urien) #7599
  • [5e3de4ed38] - (SEMVER-PATCH) add integration skill (William Conti) #7568
  • [7ce79440d8] - (SEMVER-PATCH) docs(debugger): correct captureTimeoutMs default to 15 (Thomas Watson) #7592
  • [120e1f5d80] - (SEMVER-PATCH) docs: remove redirect creation script (Thomas Hunter II) #7593
  • [5d8737d85b] - (SEMVER-PATCH) chore: align editor config and simplify (Thomas Watson) #7551
  • [afa3606270] - (SEMVER-PATCH) chore(ci): enable workflows for merge queue (Thomas Watson) #7588
  • [c9f017ff79] - (SEMVER-MINOR) jest: wrap outer hooks too (Juan Antonio Fernández de Alba) #7587
  • [adf6379ede] - (SEMVER-PATCH) chore(test): Fix downstream request flaky test (Ugaitz Urien) #7578
  • [631fb6a7cd] - (SEMVER-MINOR) feat(dsm,dbm): add process tags support for enhanced trace correlation (Thomas Hunter II) #7212
  • [495b56a62c] - (SEMVER-PATCH) docs(cursor): clarify pr-body command instructions (Thomas Watson) #7552
  • [42fbf0655f] - (SEMVER-PATCH) chore: clean up redundant co-owner entries in CODEOWNERS (Thomas Watson) #7574
  • [378da782d9] - (SEMVER-PATCH) test: enable --allow-uncaught in mocha runs (Thomas Watson) #7575
  • [ae859a9216] - (SEMVER-PATCH) add packaging reminder to eslint conf (simon-id) #7565
  • [aa8ca98897] - (SEMVER-PATCH) bump native appsec to 11.0.1 (simon-id) #7566
  • [909261eddc] - (SEMVER-PATCH) chore: add add-new-instrumentation agent skill (Thomas Watson) #7564
  • [4ae024c527] - (SEMVER-PATCH) chore(cursor): add worktrees.json for worktree setup (Thomas Watson) #7563
  • [5660164347] - (SEMVER-PATCH) ci: fix Datadog merge queue config filename (chore: configure Datadog merge queue #7561) (Thomas Watson)
  • [416a1d92e8] - (SEMVER-PATCH) chore: configure Datadog merge queue (Thomas Watson) #7561
  • [f75659a0fb] - (SEMVER-PATCH) chore(deps): bump the gh-actions-packages group across 2 directories with 3 updates (dependabot[bot]) #7560

dependabot bot and others added 11 commits February 20, 2026 05:28
…with 3 updates (#7560)

Bumps the gh-actions-packages group with 3 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [DataDog/junit-upload-github-action](https://github.com/datadog/junit-upload-github-action) and [actions/stale](https://github.com/actions/stale).
Bumps the gh-actions-packages group with 3 updates in the /.github/workflows directory: [actions/checkout](https://github.com/actions/checkout), [DataDog/junit-upload-github-action](https://github.com/datadog/junit-upload-github-action) and [actions/stale](https://github.com/actions/stale).


Updates `actions/checkout` from 6.0.1 to 6.0.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v6.0.1...de0fac2)

Updates `DataDog/junit-upload-github-action` from 2.0.0 to 2.1.1
- [Release notes](https://github.com/datadog/junit-upload-github-action/releases)
- [Commits](DataDog/junit-upload-github-action@v2...055560f)

Updates `actions/stale` from 10.1.1 to 10.2.0
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@9971854...b5d41d4)

Updates `actions/checkout` from 6.0.1 to 6.0.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v6.0.1...de0fac2)

Updates `DataDog/junit-upload-github-action` from 2.0.0 to 2.1.1
- [Release notes](https://github.com/datadog/junit-upload-github-action/releases)
- [Commits](DataDog/junit-upload-github-action@v2...055560f)

Updates `actions/stale` from 10.1.1 to 10.2.0
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@9971854...b5d41d4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gh-actions-packages
- dependency-name: DataDog/junit-upload-github-action
  dependency-version: 2.1.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: gh-actions-packages
- dependency-name: actions/stale
  dependency-version: 10.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: gh-actions-packages
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gh-actions-packages
- dependency-name: DataDog/junit-upload-github-action
  dependency-version: 2.1.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: gh-actions-packages
- dependency-name: actions/stale
  dependency-version: 10.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: gh-actions-packages
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add `repository.datadog.yaml` configuration to enable the Datadog
merge queue with speculative workflow. This allows PRs to be
validated against the latest base branch before merging,
preventing conflicts and broken builds in high-velocity merges.

The queue is restricted to `master` to avoid running on other
branches.

Configuration details:
- Speculative workflow with fallback enabled
- Up to 5 PRs validated in parallel
- GitLab checks enabled with retry support
- Fail-fast disabled to wait for full pipeline completion
- Labels skipped to avoid triggering required status checks
Move merge queue settings into `repository.datadog.yml` and
remove `repository.datadog.yaml`.

PR #7561 added the config under the wrong extension even though
the `.yml` file already existed.
chore(cursor): add worktrees.json for worktree setup

Run `yarn install` when Cursor creates a worktree so parallel agent
worktrees have dependencies installed.

Merge branch 'master' into watson/cursor-worktrees

Co-authored-by: thomas.watson <thomas.watson@datadoghq.com>
chore: add add-new-instrumentation agent skill

Adds a shared skill guide for creating new dd-trace instrumentations
and plugins. The skill lives under `.agents/skills/` and is symlinked
into both `.claude/skills/` and `.cursor/skills/` so it's available
to all AI agents. Updates `.gitignore` to track the skill files while
continuing to exclude other Claude/Cursor settings.

Address review comments

Co-authored-by: thomas.watson <thomas.watson@datadoghq.com>
test: enable --allow-uncaught in mocha runs

Add --allow-uncaught to mocha-based test scripts in package.json so
uncaught errors are treated as fatal instead of being absorbed by mocha.

Update the direct mocha invocation in platform.yml to match script behavior
for CI jobs that do not go through npm/yarn test scripts.

refactor(test): centralize mocha allow-uncaught flag

Configure allowUncaught in .mocharc.js and remove duplicated
--allow-uncaught flags from test scripts and workflow invocation.
This keeps mocha behavior consistent while reducing script noise.

Co-authored-by: Cursor <cursoragent@cursor.com>

Merge branch 'master' into watson/mocha-abort-on-uncaught

Co-authored-by: thomas.watson <thomas.watson@datadoghq.com>
chore: clean up redundant co-owner entries in CODEOWNERS

@DataDog/dd-trace-js already has a catch-all rule at the top
of the file, so explicit co-ownership on individual paths is
redundant. Remove the duplicate entries.

Merge branch 'master' into watson/cleanup-codeowners

Co-authored-by: thomas.watson <thomas.watson@datadoghq.com>
docs(cursor): clarify pr-body command instructions

- Reframe template rules and fix "references" typo.
- Add rule: blank line after each markdown headline.
- Call out removing template comments and optional "Additional Notes".

Co-authored-by: thomas.watson <thomas.watson@datadoghq.com>
#7212)

Add propagation hash support to Data Streams Monitoring (DSM) and Database
Monitoring (DBM) to enable correlation between traces, database operations,
and data stream pathways using process and container metadata.

The propagation hash is an FNV-1a 64-bit hash combining process tags
(entrypoint info, package.json name) with container tags received from the
Datadog agent. This hash is included in DSM pathway computations and DBM
SQL comments to enable enhanced observability and trace correlation.

Key changes:
- Create propagation-hash module for FNV-1a hash computation with caching
- Update DSM pathway hash computation to include propagation hash
- Add ProcessTags field to DSM payloads sent to agent
- Add ddsh parameter to DBM SQL comments containing propagation hash
- Capture container tags from agent response headers
- Feature is opt-in via DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED

This aligns with similar implementations in dd-trace-py (#15356),
dd-trace-java (#9282), and dd-trace-rb (#5208, #5209).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@dd-octo-sts dd-octo-sts bot mentioned this pull request Feb 20, 2026
@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 79.57746% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.21%. Comparing base (6b35e7d) to head (f42eb7d).
⚠️ Report is 612 commits behind head on v5.x.

Files with missing lines Patch % Lines
packages/datadog-plugin-kafkajs/src/consumer.js 9.09% 10 Missing ⚠️
packages/datadog-plugin-kafkajs/src/producer.js 28.57% 10 Missing ⚠️
packages/dd-trace/src/propagation-hash/index.js 84.90% 8 Missing ⚠️
packages/dd-trace/src/exporters/agent/writer.js 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             v5.x    #7586      +/-   ##
==========================================
- Coverage   83.19%   80.21%   -2.98%     
==========================================
  Files         476      733     +257     
  Lines       20153    31561   +11408     
==========================================
+ Hits        16766    25318    +8552     
- Misses       3387     6243    +2856     
Flag Coverage Δ
aiguard-macos 39.01% <31.32%> (?)
aiguard-ubuntu 39.13% <31.32%> (?)
aiguard-windows 38.86% <30.12%> (?)
apm-capabilities-tracing-macos 48.61% <58.45%> (?)
apm-capabilities-tracing-ubuntu 48.64% <58.45%> (?)
apm-capabilities-tracing-windows 48.34% <57.74%> (?)
apm-integrations-child-process 38.58% <32.53%> (?)
apm-integrations-couchbase-18 37.34% <32.53%> (?)
apm-integrations-couchbase-eol 37.83% <32.53%> (?)
apm-integrations-oracledb 37.80% <30.43%> (?)
appsec-express 55.58% <32.53%> (?)
appsec-fastify 51.89% <30.43%> (?)
appsec-graphql 52.08% <32.53%> (?)
appsec-kafka 44.57% <29.62%> (?)
appsec-ldapjs 44.15% <32.53%> (?)
appsec-lodash 43.83% <32.53%> (?)
appsec-macos 58.65% <32.53%> (?)
appsec-mongodb-core 48.90% <30.43%> (?)
appsec-mongoose 49.69% <30.43%> (?)
appsec-mysql 51.06% <30.43%> (?)
appsec-node-serialize 43.35% <32.53%> (?)
appsec-passport 47.84% <32.53%> (?)
appsec-postgres 50.80% <30.43%> (?)
appsec-sourcing 42.70% <32.53%> (?)
appsec-template 43.52% <32.53%> (?)
appsec-ubuntu 58.73% <32.53%> (?)
appsec-windows 58.50% <31.32%> (?)
instrumentations-instrumentation-bluebird 32.28% <21.68%> (?)
instrumentations-instrumentation-body-parser 40.58% <32.53%> (?)
instrumentations-instrumentation-child_process 37.89% <32.53%> (?)
instrumentations-instrumentation-cookie-parser 34.31% <21.68%> (?)
instrumentations-instrumentation-express 34.65% <21.68%> (?)
instrumentations-instrumentation-express-mongo-sanitize 34.44% <21.68%> (?)
instrumentations-instrumentation-express-session 40.20% <32.53%> (?)
instrumentations-instrumentation-fs 31.88% <20.48%> (?)
instrumentations-instrumentation-generic-pool 29.73% <0.00%> (?)
instrumentations-instrumentation-http 39.93% <32.53%> (?)
instrumentations-instrumentation-knex 32.28% <21.68%> (?)
instrumentations-instrumentation-mongoose 33.44% <20.65%> (?)
instrumentations-instrumentation-multer 40.32% <32.53%> (?)
instrumentations-instrumentation-mysql2 38.37% <30.43%> (?)
instrumentations-instrumentation-passport 44.15% <32.53%> (?)
instrumentations-instrumentation-passport-http 43.82% <32.53%> (?)
instrumentations-instrumentation-passport-local 44.37% <32.53%> (?)
instrumentations-instrumentation-pg 37.79% <30.43%> (?)
instrumentations-instrumentation-promise 32.20% <21.68%> (?)
instrumentations-instrumentation-promise-js 32.21% <21.68%> (?)
instrumentations-instrumentation-q 32.26% <21.68%> (?)
instrumentations-instrumentation-url 32.18% <21.68%> (?)
instrumentations-instrumentation-when 32.23% <21.68%> (?)
llmobs-ai 41.40% <32.53%> (?)
llmobs-anthropic 40.39% <32.53%> (?)
llmobs-bedrock 39.32% <32.53%> (?)
llmobs-google-genai 39.91% <32.53%> (?)
llmobs-langchain 39.49% <32.53%> (?)
llmobs-openai 44.20% <32.53%> (?)
llmobs-vertex-ai 40.18% <32.53%> (?)
platform-core 29.71% <ø> (?)
platform-esbuild 32.89% <ø> (?)
platform-instrumentations-misc 40.53% <ø> (?)
platform-shimmer 36.14% <ø> (?)
platform-unit-guardrails 22.12% <ø> (?)
plugins-azure-event-hubs 24.02% <ø> (?)
plugins-azure-service-bus 23.42% <ø> (?)
plugins-bullmq 43.68% <47.77%> (?)
plugins-cassandra 37.84% <30.43%> (?)
plugins-cookie 25.08% <ø> (?)
plugins-cookie-parser 24.87% <ø> (?)
plugins-crypto 24.72% <ø> (?)
plugins-dd-trace-api 38.45% <32.53%> (?)
plugins-express-mongo-sanitize 25.04% <ø> (?)
plugins-express-session 24.83% <ø> (?)
plugins-fastify 42.37% <32.53%> (?)
plugins-fetch 38.39% <32.53%> (?)
plugins-fs 38.69% <32.53%> (?)
plugins-generic-pool 24.06% <ø> (?)
plugins-google-cloud-pubsub 45.52% <43.37%> (?)
plugins-grpc 41.04% <32.53%> (?)
plugins-handlebars 25.08% <ø> (?)
plugins-hapi 40.22% <32.53%> (?)
plugins-hono 40.48% <32.53%> (?)
plugins-ioredis 38.49% <32.53%> (?)
plugins-knex 24.80% <ø> (?)
plugins-ldapjs 22.61% <ø> (?)
plugins-light-my-request 24.48% <ø> (?)
plugins-limitd-client 32.57% <21.68%> (?)
plugins-lodash 24.13% <ø> (?)
plugins-mariadb 39.57% <30.43%> (?)
plugins-memcached 38.22% <32.53%> (?)
plugins-microgateway-core 39.24% <32.53%> (?)
plugins-moleculer 40.60% <32.53%> (?)
plugins-mongodb 39.27% <35.86%> (?)
plugins-mongodb-core 39.10% <35.86%> (?)
plugins-mongoose 38.92% <30.43%> (?)
plugins-multer 24.83% <ø> (?)
plugins-mysql 39.24% <35.86%> (?)
plugins-mysql2 39.34% <35.86%> (?)
plugins-node-serialize 25.12% <ø> (?)
plugins-opensearch 37.67% <30.43%> (?)
plugins-passport-http 24.91% <ø> (?)
plugins-postgres 35.76% <35.86%> (?)
plugins-process 24.72% <ø> (?)
plugins-pug 25.08% <ø> (?)
plugins-redis 38.96% <32.53%> (?)
plugins-router 43.10% <32.53%> (?)
plugins-sequelize 23.66% <ø> (?)
plugins-test-and-upstream-amqp10 38.56% <32.53%> (?)
plugins-test-and-upstream-amqplib 43.97% <53.46%> (?)
plugins-test-and-upstream-apollo 39.09% <32.53%> (?)
plugins-test-and-upstream-avsc 38.78% <20.48%> (?)
plugins-test-and-upstream-bunyan 33.87% <20.48%> (?)
plugins-test-and-upstream-connect 40.89% <32.53%> (?)
plugins-test-and-upstream-graphql 40.22% <32.53%> (?)
plugins-test-and-upstream-koa 40.46% <32.53%> (?)
plugins-test-and-upstream-protobufjs 39.01% <20.48%> (?)
plugins-test-and-upstream-rhea 44.17% <43.37%> (?)
plugins-undici 39.18% <32.53%> (?)
plugins-url 24.72% <ø> (?)
plugins-valkey 38.14% <32.53%> (?)
plugins-vm 24.72% <ø> (?)
plugins-winston 34.07% <20.48%> (?)
plugins-ws 41.98% <32.53%> (?)
profiling-macos 39.96% <20.83%> (?)
profiling-ubuntu 40.08% <20.83%> (?)
profiling-windows 41.30% <19.44%> (?)
serverless-azure-functions-client 23.75% <ø> (?)
serverless-azure-functions-eventhubs 23.75% <ø> (?)
serverless-azure-functions-servicebus 23.75% <ø> (?)

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

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2026

Overall package size

Self size: 4.78 MB
Deduped: 5.63 MB
No deduping: 5.63 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 816.75 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

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

@pr-commenter
Copy link

pr-commenter bot commented Feb 20, 2026

Benchmarks

Benchmark execution time: 2026-02-24 05:43:27

Comparing candidate commit f42eb7d in PR branch v5.88.0-proposal with baseline commit 620a8fb in branch v5.x.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 232 metrics, 28 unstable metrics.

uurien and others added 3 commits February 21, 2026 05:22
* When the telemetry was separated in more messages than expected, we were unsubscribing before the latests messages
* As we were waiting to the test request to be finished to subscribe to the telemetry, sometimes, some telemetry was arriving before our subscription, and we were losing telemetry.
Run CI workflows on `mq-working-branch-master-*` push events in
addition to `master` so GitHub Actions also execute in the Datadog
merge queue.
watson and others added 3 commits February 23, 2026 05:34
Simplifies and aligns the editor configuration so formatting rules are
consistent and editor-agnostic where possible.

- Moved spell-check dictionary from .vscode/settings.json to a standalone
  .cspell.json so it works across all editors, not just VSCode.
- Added .vscode/extensions.json recommending the EditorConfig and Code
  Spell Checker extensions to new contributors.
- Simplified .vscode/settings.json by removing contentious per-language
  formatter overrides and ESLint-as-default-formatter config.
- Removed the markdown exception in .editorconfig that disabled
  trim_trailing_whitespace for *.md files, making the rules uniform across
  all file types.

Motivation

- Align VSCode editor config with .editorconfig file (VSCode users don't
  automatically load this file without a custom plugin)
- Remove contentious entries from VSCode config
The types incorrectly showed 100; the actual default is 15. Also
expand redaction config docs with built-in defaults, source link,
and redactionExcludedIdentifiers cross-reference.
wconti27 and others added 6 commits February 24, 2026 05:31
* add APM integration skill, which covers instrumentation, plugins, a new integration guide, and reference integrations.
* Update libdatadog-nodejs to 0.8.1

* Update config

* Remove tests that start the CT more than once (not supported anymore)

* On advice from crashtracking team, completing this TODO.

* CT tests: stub instead of spy

* Restore removed tests

---------

Co-authored-by: Gyuheon Oh <gyuheon.oh@datadoghq.com>
Co-authored-by: Gyuheon Oh <102937919+gyuheon0h@users.noreply.github.com>
* fix(kafkajs): sync DSM context to currentStore to prevent context leaking

When processing concurrent Kafka messages, the DSM context was being set
via enterWith() on AsyncLocalStorage but not synced to ctx.currentStore.
Since ctx.currentStore is what gets returned from bindStart and bound to
async continuations via runStores, this caused DSM context to leak between
concurrent message handlers.

The fix syncs the DSM context to ctx.currentStore after DSM operations
complete, ensuring each handler's async continuations maintain the correct
DSM context.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(dsm): add regression test for context propagation race condition

Add tests that verify DSM context is properly scoped to each handler's
async continuations when using diagnostic channels with runStores.

The tests verify that:
1. ctx.currentStore has dataStreamsContext after setDataStreamsContext
2. Concurrent handlers maintain isolated DSM contexts
3. DSM context persists through multiple async boundaries

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(dsm): sync DSM context to currentStore to prevent context leaking

Add syncToStore helper in DSM context module that syncs DSM context
from AsyncLocalStorage to ctx.currentStore after DSM operations.

This fixes a race condition where DSM context was being set via
enterWith() but not synced to ctx.currentStore, which is what gets
bound to async continuations via store.run(). Without syncing, DSM
context would leak between concurrent message handlers.

Updated plugins:
- kafkajs (consumer, producer)
- amqplib (consumer, producer)
- bullmq (consumer, producer)
- rhea (consumer)
- google-cloud-pubsub (consumer, producer)
- aws-sdk (sqs, kinesis)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* remove comment

* chore: remove contrived regression test

The unit test was useful for validating the fix during development
but is contrived and doesn't add value as a permanent test.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(dsm): add unit tests for syncToStore and integration spy tests

Add comprehensive tests for the new syncToStore helper:
- Unit tests for syncToStore in context.spec.js covering normal
  operation, edge cases, and integration with setDataStreamsContext
- Spy tests in 6 integration test files to verify syncToStore is
  called after produce and consume operations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(dsm): call syncToStore via module object for testability

Change all plugins to call DataStreamsContext.syncToStore(ctx)
instead of destructuring syncToStore at import time. This allows
sinon spies to intercept calls during testing.

When functions are destructured at require-time, they bind to the
original function reference. Spies set up later on the module
object don't affect these bindings. Calling via the module object
ensures spies work correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(dsm): remove invalid producer-side syncToStore tests for AWS SDK

The syncToStore fix only applies to the consumer path where bindStart
is used. AWS SDK plugins (SQS, Kinesis) use requestInject for producers,
which doesn't need context synchronization since:

1. requestInject is called before the request is sent
2. DSM context is encoded directly into the message
3. There's no async continuation where context leaking would occur

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: remove unnecessary comments from test files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(dsm): move DSM logic from bindStart to start for correct context binding

By moving DSM checkpoint/encoding logic into start() (which runs after
the child context is bound), the DSM context naturally lands in the
correct async store — eliminating the need for the syncToStore workaround
in kafkajs, amqplib, bullmq, and rhea consumer plugins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(dsm): remove syncToStore functionality

The actual fix for the context propagation race condition is moving DSM
logic from bindStart to start. The syncToStore workaround is unnecessary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(dsm): move DSM logic from bindStart to start for google-cloud-pubsub

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: remove extra blank lines in google-cloud-pubsub

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: fix comma placement in amqplib producer setCheckpoint call

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(kafkajs): add regression test for DSM context leak between concurrent consumers

When two KafkaJS consumers process messages concurrently and each
produces to a different topic, the DSM (Data Streams Monitoring) context
leaks between them. The first consumer to process loses its DSM context
entirely (null parent), while the second consumer picks up the first's
context instead of its own.

This test forces the interleaving by using promise gates to ensure both
eachMessage handlers have fired before either produces, reliably
reproducing the bug.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(kafkajs): remove redundant comments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(dsm): add regression tests for DSM context leak in amqplib, bullmq, rhea, google-cloud-pubsub

Same root cause as the kafkajs test: ctx.currentStore is set by
startSpan before decodeDataStreamsContext/setCheckpoint call enterWith,
so the DSM context is never included in the bound store for async
continuations.

Verified deterministic: 10/10 failures across all plugins and versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(dsm): fix lint and remove redundant comments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(rhea): use const for senderAOut

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(rhea): remove rhea DSM regression test

Rhea's producer DSM checkpoint happens in a separate encode hook, not
in bindStart/start, so the current fix doesn't cover it. Will be
addressed in a separate PR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(rhea): remove rhea consumer changes, tracked separately in #7581

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(dsm): move google-cloud-pubsub changes to separate PR

Moved DSM context fix and regression test for google-cloud-pubsub
to #7582 to fix independently.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@datadog-official
Copy link

datadog-official bot commented Feb 24, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 1 Test failed

esbuild support for IAST cjs "before all" hook in "cjs" from cjs (Datadog) (Fix with Cursor)
Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/runner/work/dd-trace-js/dd-trace-js/integration-tests/appsec/iast-esbuild.spec.js)

Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/runner/work/dd-trace-js/dd-trace-js/integration-tests/appsec/iast-esbuild.spec.js)
    at listOnTimeout (node:internal/timers:581:17)
    at process.processTimers (node:internal/timers:519:7)

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f42eb7d | Docs | Datadog PR Page | Was this helpful? Give us feedback!

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.

9 participants