v5.102.1 proposal - #8381
Closed
dd-octo-sts[bot] wants to merge 27 commits into
Closed
Conversation
…#8335) * fix(config): disable OTLP only when protocolVersion is explicitly set The OTLP-disable rule fires on `protocolVersion !== '0.4'`, which proxies "user typed something" as a value comparison because '0.4' is both the default and the universally-deployed value. That proxy breaks the moment the default changes: any user enabling OTLP would have it silently disabled even though they never touched the protocol version. Observable behavior change: explicitly setting `DD_TRACE_AGENT_PROTOCOL_VERSION=0.4` while OTLP is enabled now disables OTLP. Previously the value-equal-to-default special case slipped through. --------- Co-authored-by: Brian Marks <bm1549@users.noreply.github.com>
…ule (#8303) The plugin imported the whole `constants` module as `CLIENT_PORT_KEY`, so `[CLIENT_PORT_KEY]: ctx.conf.port` coerced the module to its string form and tagged every mysql / mysql2 span with a literal `[object Object]: <port>` metric instead of `network.destination.port`. Peer-service computation, downstream filters, and any product feature keyed off `network.destination.port` had no port to read on this plugin since v0.
The database plugin tests had three coverage gaps: 1. mongodb-core, mysql, and pg only exercised dbmPropagationMode through plugin config, so the tracer-level wiring through plugin_manager._getSharedConfig was never pinned. One case per plugin now sets the option through the tracer-config slot (third agent.load arg). 2. Prisma's adapter-aware client routing in read-replica setups was not covered. The new prisma case spins up two clients on different hosts and asserts each db_query span carries the active adapter's host/port metadata. 3. Prisma v7 over OTel had no integration-tests entrypoint. server-ts-v7-otel.mjs exercises that wiring end-to-end. Drive-by fix: * Extract createEngineDbQuerySpan() in the prisma spec to avoid re-rolling the same span literal per case.
Couchbase Node.js SDK 2.6.x supports Node 6/8/10 only (`couchnode`
predates N-API), but the tracer's `engines` requires Node >=18, so
the `^2.6.12` hook cannot be reached on any supported runtime. The
CI matrix entry was already commented out and the `<3.0.0` unit-test
block already `describe.skip`ped, both pointing at the same bug.
The plugin's `apm:couchbase:{bucket,cluster}:maybeInvoke:*` binds and
`apm:couchbase:{append,prepend}` command subs have no publisher once
the 2.x hook is gone and are removed with it; the 3.x / 4.x hooks
still cover the surviving paths.
Drive-by fix:
* Tighten the `scripts/install_plugin_modules.js` ARM64-exclusion
comment to `< 3.2.2` so it matches the remaining `lib/`-style hooks.
Refs: #6400
The greedy `/.+\+(.+)-.+webspace(-Linux)?/` shape made the engine
backtrack through three open-ended `.+` quantifiers to find the right
`-` before `<region>webspace`. Plain string ops (`indexOf('+')` then
`endsWith('webspace')` then `lastIndexOf('-')`) read directly off the
documented format and stop on the first match, with no backtracking
needed.
#8378) `finish` parsed the peer string with `peer.split(':') + parts.at(-1)` and tagged `network.destination.port` whenever the last segment matched the unanchored `/^\d+/`. Two malformed-peer shapes slipped through: 1. Partially-numeric tails — e.g. `'1.2.3.4:80abc'` matched the leading `80` and tagged a mangled `port='80abc'`. 2. Pure-digit peers without a colon — e.g. `'8080'` tagged `ip='', port='8080'`, leaking an empty ip into peer-service resolution. Use `peer.lastIndexOf(':')` plus an anchored `/^\d+$/` on the tail; both shapes now fall through to the catch-all branch that tags the raw peer as `network.destination.ip`. The hot path also stops allocating an intermediate `parts` array per call. Bench (Node 24.13 / V8 13.6, n=200 k+ x 7 trials, drop best+worst): split + slice + at(-1) 360.06 ns/op lastIndexOf + slice 166.78 ns/op speedup: 2.16x
…#8375) `getQuery` did two full walks per command — `limitDepth` cloned the filter into a parallel "?-or-object" tree, then `sanitizeBigInt` ran `JSON.stringify` over the clone — so big `$or` arrays and deep `$lookup` pipelines paid the per-key allocation twice. Fold both into one `JSON.stringify` replacer; the native `toJSON` dispatch handles `ObjectId` / `Decimal128` / `Long` / `Date` / `Timestamp`, the replacer suppresses `Buffer` / `Binary` toJSON output, and an ancestor stack tracks depth without a separate clone. Three behaviour drifts vs `limitDepth`, none covered by existing specs: 1. Inherited enumerable keys are no longer walked. 2. Shallow cycles render as `{"self":"?"}` instead of a ten-deep nested fallback. 3. Arrays of `Buffer` / function are sanitised instead of falling through. Drive-by fix: * `truncate` short-circuits when the resource already fits under 10 KB.
Three per-message allocations that compound on a typical batch:
1. `bindStart` called `String(messageCount)` and
`String(Math.floor(batchSpan._startTime))` on every iteration
despite both being loop-invariant — on a 100-message batch
that's 200 redundant string allocations per send. Hoist both
above the loop.
2. The per-message `Object.assign({...})` over seven attribute
fields rebuilt a fresh object every iteration. Assign per-key so
V8 keeps `msg.attributes` on its existing hidden class.
3. The parent-from-message-0 span-link extraction
(`messages.slice(1).map(...).filter(Boolean)`) allocated three
intermediate arrays per call. Replace with a single `for` loop.
Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
Three coordinated pieces:
1. `getMethodMetadata` re-parsed the path on every call. Cache the
`{name, service, package}` triple by path in a module-scope `Map`;
size is bounded by the app's distinct gRPC methods.
2. `addMetadataTags` cloned metadata via `metadata.getMap()` even
when no filter was configured. Export the `getEmptyObject`
sentinel and short-circuit on identity before the clone.
3. The remaining `for-in` walks (filter-return iteration in
`addMetadataTags`, the client `inject` carrier) become `for-of
Object.keys`.
Bench (Node 24.13 / V8 13.6, n=200 k+ x 7 trials, drop best+worst):
getMethodMetadata parse on every call 74.50 ns/op
getMethodMetadata cache hit 5.84 ns/op speedup: 12.76x
…8371) `#createDBMPropagationCommentService` rebuilt the same six-segment comment on every query. Three fields (`dde`, `ddps`, `ddpv`) are immutable per process; the other three (`dddb`, `dddbs`, `ddh`) are stable per connection in any real workload. Three coordinated pieces: 1. `configure()` bakes `dde`, `ddps`, `ddpv` into pre-templated fragments; reconfiguring clears them so a new env / version takes effect on the next call. 2. A per-`DatabasePlugin` `LRUCache(max=256)` keyed by `${db}\0${host}\0${dbmService}` stores the per-connection prefix. The cap bounds high-cardinality `db.name` workloads (notably MongoDB's `${database}.${collection}`); steady-state working sets fit well below it and a missed lookup costs a few hundred ns. 3. `encode` short-circuits names matching `[A-Za-z0-9-_.~]*` — exactly what `encodeURIComponent` leaves unchanged. Bench (worker numbers, steady-state cache hit rate): before 6.85 Mops/s after 10.68 Mops/s speedup: 1.56x Refs: #8325 (comment)
`wrapConnectionCommand` (mongodb >= 4) rebuilt the same five objects from `this.address` on every command. The Connection's address is immutable for its lifetime, so the work lands once on the first command and reuses a per-Connection envelope thereafter. The cache lives in a module-scope `WeakMap` instead of a Symbol-keyed property: the Connection is a foreign object, and an own-key (even a Symbol) shows up to `Reflect.ownKeys` / `Object.getOwnPropertySymbols`, forces a hidden-class transition on first hit, and can collide with another tracer's instrumentation walking the same connection. The extra `WeakMap.get` is single-digit nanoseconds and the foreign object stays untouched. The address parser tightens the previous `length === 2` split to "exactly one `:`, non-empty parts on both sides" so non-standard addresses (random UUIDs, IPv6 forms, empty port / host halves) all collapse to the empty-options topology. `synthesizeTopology` is exported so the parser is unit-tested directly rather than through the mongodb integration suite. Bench (Node 24.15 / V8 13.6, n=500 k x 7 trials, drop best+worst, warm cache, hit-only): per-command rebuild 19.30 ns/op cached envelope (WeakMap) 8.32 ns/op speedup: 2.32x
A win on the AWS SDK response hot path:
addResponseTags: drop the temporary tags object, the empty
{} produced by extraTags = generateTags(...) || {}, and the
redundant 'span.kind': 'client' re-tag. Service-level
generateTags early-returns undefined instead of {}; SQS's
'span.kind': 'consumer'/'producer' override still flows through
addTags unchanged.
Node v24.13.0 V8 13.6.233.17-node.37 (n=200 k+ × 7 trials, drop best+worst)
aws-sdk addResponseTags: per-response tag allocation (no extra tags)
before (alloc tags + addTags) 385.90 ns/op
after (setTag direct) 178.90 ns/op speedup: 2.16x
Contributor
Overall package sizeSelf size: 5.81 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.1 | 82.56 kB | 817.39 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 138d873 | Docs | Datadog PR Page | Give us feedback! |
Replaced by GitHub's CodeQL default setup configured in repository settings. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumps [nock](https://github.com/nock/nock) from 13.5.6 to 14.0.14. - [Release notes](https://github.com/nock/nock/releases) - [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md) - [Commits](nock/nock@v13.5.6...v14.0.14) --- updated-dependencies: - dependency-name: nock dependency-version: 14.0.14 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
…afterEach (#8367) - Replace hardcoded ports (6015, 16015) with port 0 so the kernel assigns an available port, eliminating inter-run port conflicts - Move regression-test resource cleanup (server, socket) from test bodies into dedicated afterEach hooks - Split combined afterEach callbacks into one hook per concern so a failure in one cleanup step doesn't skip the others - Load/close the agent in beforeEach/afterEach instead of before/after so each test gets a clean agent state - Move channel declaration to top of file --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…built-in modules (#8304) * fix(tracing): use moduleId as cache key in ritm.js When a built-in module is required with the `node:` prefix (e.g. `node:fs`), `moduleId` is normalized (prefix stripped) but `filename` retains the original value. The cache is keyed by `moduleId`, so accessing `cache[filename]` results in `undefined`, causing a TypeError: TypeError: undefined is not an object (evaluating 'cache[filename].original') This was missed in commit e92e7f0 which refactored cache keys from `filename` to `moduleId`. One occurrence on line 104 was not updated. Reproduces when dd-trace instruments modules that transitively require node-prefixed built-ins (e.g. @aws-sdk/credential-provider-ini). * test(tracing): add regression test for node:-prefixed cache key in ritm.js --------- Co-authored-by: uchida <uchida@nulab.com>
Bumps the test-versions group with 1 update in the /integration-tests/esbuild directory: [openai](https://github.com/openai/openai-node). Updates `openai` from 6.35.0 to 6.36.0 - [Release notes](https://github.com/openai/openai-node/releases) - [Changelog](https://github.com/openai/openai-node/blob/master/CHANGELOG.md) - [Commits](openai/openai-node@v6.35.0...v6.36.0) --- updated-dependencies: - dependency-name: openai dependency-version: 6.36.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: test-versions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
dd-octo-sts
Bot
force-pushed
the
v5.102.1-proposal
branch
from
May 10, 2026 06:04
9a294dc to
1310499
Compare
…pdates (#8410) Bumps the test-versions group with 2 updates in the /integration-tests/esbuild directory: [@apollo/server](https://github.com/apollographql/apollo-server/tree/HEAD/packages/server) and [openai](https://github.com/openai/openai-node). Updates `@apollo/server` from 5.5.0 to 5.5.1 - [Release notes](https://github.com/apollographql/apollo-server/releases) - [Changelog](https://github.com/apollographql/apollo-server/blob/main/packages/server/CHANGELOG.md) - [Commits](https://github.com/apollographql/apollo-server/commits/@apollo/server@5.5.1/packages/server) Updates `openai` from 6.36.0 to 6.37.0 - [Release notes](https://github.com/openai/openai-node/releases) - [Changelog](https://github.com/openai/openai-node/blob/master/CHANGELOG.md) - [Commits](openai/openai-node@v6.36.0...v6.37.0) --- updated-dependencies: - dependency-name: "@apollo/server" dependency-version: 5.5.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-versions - dependency-name: openai dependency-version: 6.37.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: test-versions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dd-octo-sts
Bot
force-pushed
the
v5.102.1-proposal
branch
from
May 11, 2026 06:19
1310499 to
138d873
Compare
Contributor
Author
|
Superseded by #8436. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
0b494e8792] - (SEMVER-PATCH) chore(deps): bump the test-versions group across 1 directory with 2 updates (dependabot[bot]) #8410807fceb14d] - (SEMVER-PATCH) chore(deps): bump openai (dependabot[bot]) #8360f5ee7b20de] - (SEMVER-PATCH) fix(tracing): fix TypeError in ritm.js when requiring node:-prefixed built-in modules (Yuichi Uchida) #8304057685610b] - (SEMVER-PATCH) fix(stacktrace): filter dd-trace instrumentation frames for any repo directory name (Roch Devost) #8301a39c44ed42] - (SEMVER-PATCH) test(ws): refactor lifecycle hooks to use dynamic ports and separate afterEach (Roch Devost) #8367e3a718bae7] - (SEMVER-PATCH) chore(deps-dev): bump nock from 13.5.6 to 14.0.14 (dependabot[bot]) #8280a3bb4cd3af] - (SEMVER-PATCH) ci: replace CodeQL workflow with default setup configuration (Roch Devost) #838047591c3fde] - (SEMVER-PATCH) perf(aws-sdk): trim per-response allocations (Ruben Bridgewater) #8328c05e122cbe] - (SEMVER-PATCH) perf(mongodb): cache the per-connection topology shape (Ruben Bridgewater) #8370fc437471cc] - (SEMVER-PATCH) perf(database): cache the DBM SQL injection comment per connection (Ruben Bridgewater) #83718d6b8824d2] - (SEMVER-PATCH) perf(grpc): cache method metadata, drop banned for-in walks (Ruben Bridgewater) #83775c2656c36b] - (SEMVER-PATCH) chore(deps): bump dc-polyfill from 0.1.10 to 0.1.11 (Brian Marks) #8369e05e6c6784] - (SEMVER-PATCH) perf(pubsub): trim per-message allocations in publish hot path (Ruben Bridgewater) #83749fb4d152b2] - (SEMVER-PATCH) perf(mongodb): fold limit-depth and bigint sanitisation into one pass (Ruben Bridgewater) #8375c610358953] - (SEMVER-PATCH) fix(grpc): require a colon and a strictly numeric tail before tagging… (Ruben Bridgewater) #8378a46860bc55] - (SEMVER-PATCH) refactor(azure-metadata): parse WEBSITE_OWNER_NAME without regex (Ruben Bridgewater) #834843de16c356] - (SEMVER-PATCH) chore(couchbase): drop SDK 2.x instrumentation hook (Ruben Bridgewater) #8362b893e3165d] - (SEMVER-PATCH) test: add a few database tests to cover recent reports better (Ruben Bridgewater) #753426f3793cd9] - (SEMVER-PATCH) fix(aws-sdk): global crypto error (Pablo Erhard) #83685802bcb274] - (SEMVER-PATCH) fix(plugin-mysql): destructure CLIENT_PORT_KEY from the constants module (Ruben Bridgewater) #83035e54f8226f] - (SEMVER-PATCH) [test optimization] Bump playwright support to 1.59 (Juan Antonio Fernández de Alba) #8363b3c20f8cf1] - (SEMVER-PATCH) [test optimization] Bump cucumber latest version (Juan Antonio Fernández de Alba) #8364a5834a8f30] - (SEMVER-PATCH) [test optimization] Support Jest 30.4.1 (Juan Antonio Fernández de Alba) #8361aa3c020225] - (SEMVER-PATCH) fix(config): disable OTLP only when protocolVersion is explicitly set (Ruben Bridgewater) #83350b803f55de] - (SEMVER-PATCH) [test-optimization] Propagate ITR skipping enabled tag to suites and tests (Andrey Marchenko) #83327350d99b0f] - (SEMVER-PATCH) [test optimization] Use duration buckets for playwright EFD retries (Juan Antonio Fernández de Alba) #8289