Skip to content

refactor(lambda): collapse runtime/ritm.js into index.js#8397

Merged
BridgeAR merged 2 commits into
masterfrom
BridgeAR/2026-05-10-lambda-collapse
May 11, 2026
Merged

refactor(lambda): collapse runtime/ritm.js into index.js#8397
BridgeAR merged 2 commits into
masterfrom
BridgeAR/2026-05-10-lambda-collapse

Conversation

@BridgeAR
Copy link
Copy Markdown
Member

Summary

`registerLambdaHook` lived in `src/lambda/runtime/ritm.js` while the single bootstrap caller (`src/lambda/index.js`) was a one-line forwarder. Three underscore-prefixed helpers (`_extractModuleRootAndHandler`, `_extractModuleNameAndHandlerPath`, `_getLambdaFilePaths`) were exported only so the spec could reach them; both `runtime/ritm.js` and `runtime/patch.js` carried the same logic in two places.

The helpers move to a shared `src/lambda/handler-paths.js` so `index.js` and `runtime/patch.js` stop duplicating them. The underscore prefixes drop along with their export. `DD_TRACE_DISABLED_INSTRUMENTATIONS` gates `registerLambdaHook` at the bootstrap entry rather than from inside the hook callback; the env is read once at module load, the same shape every other integration uses. The spec rewrites to a black-box test of `registerLambdaHook` through a Hook spy injected by `proxyquire`, covering the four env permutations the production code branches on plus the inner Hook-callback paths (handler key wrap, datadog-lambda-js wrap, hook-error logging on both branches).

Test plan

  • `yarn test:lambda` passes (44 cases including the new `registration.spec.js`).
  • `yarn lint` passes.

\`registerLambdaHook\` lived in \`runtime/ritm.js\` while the
single bootstrap caller — \`src/lambda/index.js\` — was a one-line
forwarder. Three underscore-prefixed helpers
(\`_extractModuleRootAndHandler\`,
\`_extractModuleNameAndHandlerPath\`, \`_getLambdaFilePaths\`) were
exported only so the spec could reach them; both \`runtime/ritm.js\`
and \`runtime/patch.js\` carried the same logic in two places.

The helpers move to a shared \`src/lambda/handler-paths.js\` so
\`index.js\` and \`runtime/patch.js\` stop duplicating them. The
underscore prefixes drop along with their export.
\`DD_TRACE_DISABLED_INSTRUMENTATIONS\` gates \`registerLambdaHook\`
at the bootstrap entry rather than from inside the hook callback;
the env is read once at module load, the same shape every other
integration uses. The spec rewrites to a black-box test of
\`registerLambdaHook\` through a Hook spy injected by
\`proxyquire\`, covering the four env permutations the production
code branches on plus the inner Hook-callback paths.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 10, 2026

Overall package size

Self size: 5.82 MB
Deduped: 6.66 MB
No deduping: 6.66 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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.04%. Comparing base (807fceb) to head (eb47c57).
⚠️ Report is 30 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8397      +/-   ##
==========================================
+ Coverage   89.96%   90.04%   +0.07%     
==========================================
  Files         836      837       +1     
  Lines       44867    44985     +118     
  Branches     8320     8373      +53     
==========================================
+ Hits        40366    40507     +141     
+ Misses       4501     4478      -23     
Flag Coverage Δ
aiguard-integration-active 40.67% <ø> (+0.11%) ⬆️
aiguard-integration-latest 40.62% <ø> (+0.11%) ⬆️
aiguard-integration-maintenance 40.67% <ø> (+0.11%) ⬆️
aiguard-macos 35.37% <ø> (+0.05%) ⬆️
aiguard-ubuntu 35.47% <ø> (+0.05%) ⬆️
aiguard-windows 35.28% <ø> (+0.05%) ⬆️
apm-capabilities-tracing-macos 49.04% <ø> (+<0.01%) ⬆️
apm-capabilities-tracing-ubuntu-active 49.26% <ø> (+0.19%) ⬆️
apm-capabilities-tracing-ubuntu-latest 49.04% <ø> (+<0.01%) ⬆️
apm-capabilities-tracing-ubuntu-maintenance 49.26% <ø> (+0.01%) ⬆️
apm-capabilities-tracing-ubuntu-oldest 49.06% <ø> (-0.17%) ⬇️
apm-capabilities-tracing-windows 49.05% <ø> (+<0.01%) ⬆️
apm-integrations-aerospike-18-gte.5.2.0 34.44% <ø> (+0.08%) ⬆️
apm-integrations-aerospike-20-gte.5.5.0 34.45% <ø> (+0.08%) ⬆️
apm-integrations-aerospike-22-gte.5.12.1 34.45% <ø> (+0.08%) ⬆️
apm-integrations-aerospike-22-gte.6.0.0 34.45% <ø> (+0.08%) ⬆️
apm-integrations-aerospike-eol- 34.36% <ø> (+0.08%) ⬆️
apm-integrations-child-process 35.42% <ø> (+0.08%) ⬆️
apm-integrations-confluentinc-kafka-javascript-18 41.21% <ø> (+0.03%) ⬆️
apm-integrations-confluentinc-kafka-javascript-20 41.23% <ø> (+0.03%) ⬆️
apm-integrations-confluentinc-kafka-javascript-22 41.23% <ø> (+0.03%) ⬆️
apm-integrations-confluentinc-kafka-javascript-24 41.16% <ø> (+0.03%) ⬆️
apm-integrations-couchbase-18 34.61% <ø> (-0.15%) ⬇️
apm-integrations-couchbase-eol 34.72% <ø> (-0.06%) ⬇️
apm-integrations-dns 34.30% <ø> (+0.08%) ⬆️
apm-integrations-elasticsearch 35.08% <ø> (+0.07%) ⬆️
apm-integrations-http-latest 42.26% <ø> (+0.10%) ⬆️
apm-integrations-http-maintenance 42.31% <ø> (+0.10%) ⬆️
apm-integrations-http-oldest 42.32% <ø> (+0.10%) ⬆️
apm-integrations-http2 39.72% <ø> (+0.18%) ⬆️
apm-integrations-kafkajs-latest 41.09% <ø> (+0.02%) ⬆️
apm-integrations-kafkajs-oldest 41.15% <ø> (+0.03%) ⬆️
apm-integrations-net 35.00% <ø> (+0.08%) ⬆️
apm-integrations-next-11.1.4 29.10% <ø> (-0.01%) ⬇️
apm-integrations-next-13.2.0 30.79% <ø> (-0.02%) ⬇️
apm-integrations-next-gte.10.2.0.and.lt.11 22.99% <ø> (ø)
apm-integrations-next-gte.11.0.0.and.lt.13 30.79% <ø> (-0.02%) ⬇️
apm-integrations-next-gte.13.0.0.and.lt.14 31.04% <ø> (-0.02%) ⬇️
apm-integrations-next-gte.14.0.0.and.lte.14.2.6 30.86% <ø> (-0.04%) ⬇️
apm-integrations-next-gte.14.2.7.and.lt.15 30.86% <ø> (-0.02%) ⬇️
apm-integrations-next-gte.15.0.0 30.92% <ø> (-0.02%) ⬇️
apm-integrations-oracledb 34.73% <ø> (+0.08%) ⬆️
apm-integrations-prisma-18-gte.6.16.0.and.lt.7.0.0 35.11% <ø> (+0.08%) ⬆️
apm-integrations-prisma-latest-all 35.52% <ø> (+0.07%) ⬆️
apm-integrations-restify 36.56% <ø> (+0.15%) ⬆️
apm-integrations-sharedb 33.98% <ø> (+0.08%) ⬆️
apm-integrations-tedious 34.53% <ø> (+0.08%) ⬆️
appsec-express 52.01% <ø> (+0.03%) ⬆️
appsec-fastify 48.71% <ø> (+0.02%) ⬆️
appsec-graphql 49.04% <ø> (+0.07%) ⬆️
appsec-integration-active 36.98% <ø> (+0.07%) ⬆️
appsec-integration-latest 36.96% <ø> (+0.07%) ⬆️
appsec-integration-maintenance 36.98% <ø> (+0.07%) ⬆️
appsec-integration-oldest 36.97% <ø> (+0.07%) ⬆️
appsec-kafka 41.55% <ø> (+0.08%) ⬆️
appsec-ldapjs 40.76% <ø> (+0.04%) ⬆️
appsec-lodash 40.87% <ø> (+0.04%) ⬆️
appsec-macos 55.84% <ø> (+0.02%) ⬆️
appsec-mongodb-core 45.20% <ø> (+0.04%) ⬆️
appsec-mongoose 46.05% <ø> (+0.03%) ⬆️
appsec-mysql 48.09% <ø> (+0.09%) ⬆️
appsec-next-latest-11.1.4 29.21% <ø> (-0.01%) ⬇️
appsec-next-latest-13.2.0 30.93% <ø> (-0.02%) ⬇️
appsec-next-latest-gte.10.2.0.and.lt.11 28.86% <ø> (+0.19%) ⬆️
appsec-next-latest-gte.11.0.0.and.lt.13 30.91% <ø> (-0.02%) ⬇️
appsec-next-latest-gte.13.0.0.and.lt.14 31.16% <ø> (-0.02%) ⬇️
appsec-next-latest-gte.14.0.0.and.lte.14.2.6 31.00% <ø> (-0.02%) ⬇️
appsec-next-latest-gte.14.2.7.and.lt.15 31.00% <ø> (-0.02%) ⬇️
appsec-next-latest-gte.15.0.0 31.00% <ø> (-0.02%) ⬇️
appsec-next-oldest-11.1.4 29.22% <ø> (-0.02%) ⬇️
appsec-next-oldest-13.2.0 31.21% <ø> (-0.02%) ⬇️
appsec-next-oldest-gte.10.2.0.and.lt.11 28.98% <ø> (+0.19%) ⬆️
appsec-next-oldest-gte.11.0.0.and.lt.13 30.93% <ø> (-0.02%) ⬇️
appsec-next-oldest-gte.13.0.0.and.lt.14 31.40% <ø> (-0.02%) ⬇️
appsec-next-oldest-gte.14.0.0.and.lte.14.2.6 31.24% <ø> (-0.02%) ⬇️
appsec-next-oldest-gte.14.2.7.and.lt.15 31.24% <ø> (-0.02%) ⬇️
appsec-next-oldest-gte.15.0.0 31.24% <ø> (-0.02%) ⬇️
appsec-node-serialize 40.09% <ø> (+0.04%) ⬆️
appsec-passport 43.81% <ø> (+0.11%) ⬆️
appsec-postgres 47.66% <ø> (+0.05%) ⬆️
appsec-sourcing 39.44% <ø> (+0.06%) ⬆️
appsec-stripe 41.58% <ø> (+0.09%) ⬆️
appsec-template 40.25% <ø> (+0.04%) ⬆️
appsec-ubuntu 55.92% <ø> (+0.02%) ⬆️
appsec-windows 55.78% <ø> (+0.02%) ⬆️
debugger-ubuntu-active 43.32% <ø> (+0.14%) ⬆️
debugger-ubuntu-latest 43.27% <ø> (+0.14%) ⬆️
debugger-ubuntu-maintenance 43.33% <ø> (-0.29%) ⬇️
debugger-ubuntu-oldest 43.82% <ø> (+0.18%) ⬆️
instrumentations-instrumentation-bluebird 29.33% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-body-parser 37.02% <ø> (+0.07%) ⬆️
instrumentations-instrumentation-child_process 34.91% <ø> (+0.08%) ⬆️
instrumentations-instrumentation-cookie-parser 31.16% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-express 31.37% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 31.28% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-express-session 36.71% <ø> (+0.07%) ⬆️
instrumentations-instrumentation-fs 29.01% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-generic-pool 29.95% <ø> (+0.08%) ⬆️
instrumentations-instrumentation-http 36.38% <ø> (+0.08%) ⬆️
instrumentations-instrumentation-knex 29.30% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-light-my-request 36.64% <ø> (+0.07%) ⬆️
instrumentations-instrumentation-mongoose 30.42% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-multer 36.80% <ø> (+0.07%) ⬆️
instrumentations-instrumentation-mysql2 34.94% <ø> (+0.08%) ⬆️
instrumentations-instrumentation-passport 40.46% <ø> (+0.11%) ⬆️
instrumentations-instrumentation-passport-http 40.23% <ø> (+0.11%) ⬆️
instrumentations-instrumentation-passport-local 40.72% <ø> (+0.11%) ⬆️
instrumentations-instrumentation-pg 34.52% <ø> (+0.10%) ⬆️
instrumentations-instrumentation-promise 29.26% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-promise-js 29.27% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-q 29.30% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-url 29.27% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-when 29.28% <ø> (-0.02%) ⬇️
instrumentations-integration-esbuild-active 19.39% <ø> (+0.08%) ⬆️
instrumentations-integration-esbuild-latest 19.38% <ø> (+0.08%) ⬆️
instrumentations-integration-esbuild-maintenance 19.39% <ø> (+0.08%) ⬆️
instrumentations-integration-esbuild-oldest 19.38% <ø> (+0.08%) ⬆️
llmobs-ai 37.83% <ø> (+0.06%) ⬆️
llmobs-anthropic 37.89% <ø> (+0.06%) ⬆️
llmobs-bedrock 36.60% <ø> (+0.08%) ⬆️
llmobs-google-genai 36.91% <ø> (+0.06%) ⬆️
llmobs-langchain 36.59% <ø> (+0.04%) ⬆️
llmobs-openai 40.65% <ø> (+0.05%) ⬆️
llmobs-sdk-active 45.51% <ø> (+0.09%) ⬆️
llmobs-sdk-latest 45.44% <ø> (+0.09%) ⬆️
llmobs-sdk-maintenance 45.51% <ø> (+0.09%) ⬆️
llmobs-sdk-oldest 45.49% <ø> (+0.09%) ⬆️
llmobs-vertex-ai 37.06% <ø> (+0.06%) ⬆️
openfeature-macos 38.07% <ø> (+0.15%) ⬆️
openfeature-ubuntu 38.15% <ø> (+0.15%) ⬆️
openfeature-unit-active 48.65% <ø> (+0.14%) ⬆️
openfeature-unit-latest 48.49% <ø> (+0.14%) ⬆️
openfeature-unit-maintenance 48.65% <ø> (+0.14%) ⬆️
openfeature-unit-oldest 48.65% <ø> (+0.14%) ⬆️
openfeature-windows 37.95% <ø> (+0.20%) ⬆️
platform-core 37.27% <ø> (ø)
platform-esbuild 40.61% <ø> (ø)
platform-instrumentations-misc 30.75% <ø> (+0.06%) ⬆️
platform-integration-active 47.15% <ø> (+0.22%) ⬆️
platform-integration-latest 47.07% <ø> (+0.17%) ⬆️
platform-integration-maintenance 47.16% <ø> (+0.22%) ⬆️
platform-integration-oldest 47.33% <ø> (+0.22%) ⬆️
platform-shimmer 42.29% <ø> (ø)
platform-unit-guardrails 36.12% <ø> (ø)
platform-webpack 20.53% <ø> (+0.09%) ⬆️
plugins-azure-durable-functions 37.07% <ø> (+0.15%) ⬆️
plugins-azure-event-hubs 34.93% <ø> (+0.17%) ⬆️
plugins-azure-service-bus 35.39% <ø> (+0.16%) ⬆️
plugins-bullmq 40.17% <ø> (+0.07%) ⬆️
plugins-cassandra 34.87% <ø> (+0.20%) ⬆️
plugins-cookie 26.65% <ø> (?)
plugins-cookie-parser 26.46% <ø> (ø)
plugins-crypto 27.69% <ø> (ø)
plugins-dd-trace-api 34.84% <ø> (+0.08%) ⬆️
plugins-express-mongo-sanitize 26.59% <ø> (ø)
plugins-express-session 26.42% <ø> (ø)
plugins-fastify 38.78% <ø> (+0.07%) ⬆️
plugins-fetch 35.11% <ø> (+0.07%) ⬆️
plugins-fs 35.19% <ø> (+0.08%) ⬆️
plugins-generic-pool 25.58% <ø> (ø)
plugins-google-cloud-pubsub 42.51% <ø> (+0.03%) ⬆️
plugins-grpc 37.56% <ø> (+0.07%) ⬆️
plugins-handlebars 26.63% <ø> (ø)
plugins-hapi 36.68% <ø> (+0.08%) ⬆️
plugins-hono 36.97% <ø> (+0.07%) ⬆️
plugins-ioredis 35.31% <ø> (+0.12%) ⬆️
plugins-knex 26.31% <ø> (ø)
plugins-langgraph 34.54% <ø> (+0.08%) ⬆️
plugins-ldapjs 24.20% <ø> (ø)
plugins-light-my-request 26.06% <ø> (ø)
plugins-limitd-client 29.56% <ø> (-0.02%) ⬇️
plugins-lodash 25.65% <ø> (ø)
plugins-mariadb 36.16% <ø> (+0.02%) ⬆️
plugins-memcached 34.94% <ø> (+0.09%) ⬆️
plugins-microgateway-core 35.81% <ø> (+0.08%) ⬆️
plugins-modelcontextprotocol-sdk 33.83% <ø> (+0.08%) ⬆️
plugins-moleculer 37.64% <ø> (+0.07%) ⬆️
plugins-mongodb 36.15% <ø> (+0.11%) ⬆️
plugins-mongodb-core 35.90% <ø> (+0.12%) ⬆️
plugins-mongoose 35.61% <ø> (+0.06%) ⬆️
plugins-multer 26.42% <ø> (ø)
plugins-mysql 35.95% <ø> (+0.12%) ⬆️
plugins-mysql2 36.03% <ø> (+0.12%) ⬆️
plugins-node-serialize 26.69% <ø> (ø)
plugins-opensearch 34.62% <ø> (+0.08%) ⬆️
plugins-passport-http 26.47% <ø> (ø)
plugins-pino 31.27% <ø> (-0.02%) ⬇️
plugins-postgres 34.07% <ø> (+0.14%) ⬆️
plugins-process 27.69% <ø> (ø)
plugins-pug 26.65% <ø> (ø)
plugins-redis 35.36% <ø> (+0.11%) ⬆️
plugins-router 39.25% <ø> (+0.07%) ⬆️
plugins-sequelize 25.36% <ø> (ø)
plugins-test-and-upstream-amqp10 35.17% <ø> (+0.08%) ⬆️
plugins-test-and-upstream-amqplib 40.36% <ø> (+0.05%) ⬆️
plugins-test-and-upstream-apollo 36.02% <ø> (+0.07%) ⬆️
plugins-test-and-upstream-avsc 34.51% <ø> (+0.08%) ⬆️
plugins-test-and-upstream-bunyan 30.64% <ø> (-0.02%) ⬇️
plugins-test-and-upstream-connect 37.35% <ø> (+0.07%) ⬆️
plugins-test-and-upstream-graphql 36.92% <ø> (+0.05%) ⬆️
plugins-test-and-upstream-koa 36.94% <ø> (+0.07%) ⬆️
plugins-test-and-upstream-protobufjs 34.72% <ø> (+0.08%) ⬆️
plugins-test-and-upstream-rhea 40.38% <ø> (+0.05%) ⬆️
plugins-undici 35.84% <ø> (+0.07%) ⬆️
plugins-url 27.69% <ø> (ø)
plugins-valkey 34.95% <ø> (+0.09%) ⬆️
plugins-vm 27.69% <ø> (ø)
plugins-winston 31.15% <ø> (-0.02%) ⬇️
plugins-ws 38.46% <ø> (+0.22%) ⬆️
profiling-macos 42.79% <ø> (+0.02%) ⬆️
profiling-ubuntu 43.20% <ø> (+0.07%) ⬆️
profiling-windows 40.10% <ø> (+0.08%) ⬆️
serverless-aws-sdk-latest-aws-sdk 34.80% <ø> (+0.07%) ⬆️
serverless-aws-sdk-latest-bedrockruntime 33.14% <ø> (+0.07%) ⬆️
serverless-aws-sdk-latest-client 22.38% <ø> (ø)
serverless-aws-sdk-latest-dynamodb 35.76% <ø> (+0.06%) ⬆️
serverless-aws-sdk-latest-eventbridge 28.83% <ø> (-0.01%) ⬇️
serverless-aws-sdk-latest-kinesis 38.67% <ø> (+0.04%) ⬆️
serverless-aws-sdk-latest-lambda 35.95% <ø> (+0.06%) ⬆️
serverless-aws-sdk-latest-s3 33.91% <ø> (+0.06%) ⬆️
serverless-aws-sdk-latest-serverless-peer-service 40.04% <34.09%> (+0.02%) ⬆️
serverless-aws-sdk-latest-sns 39.77% <ø> (+0.04%) ⬆️
serverless-aws-sdk-latest-sqs 39.06% <ø> (+0.04%) ⬆️
serverless-aws-sdk-latest-stepfunctions 34.52% <ø> (+0.06%) ⬆️
serverless-aws-sdk-latest-util 48.00% <ø> (+0.28%) ⬆️
serverless-aws-sdk-oldest-aws-sdk 34.89% <ø> (+0.06%) ⬆️
serverless-aws-sdk-oldest-bedrockruntime 33.42% <ø> (+0.07%) ⬆️
serverless-aws-sdk-oldest-client 22.75% <ø> (ø)
serverless-aws-sdk-oldest-dynamodb 35.84% <ø> (+0.06%) ⬆️
serverless-aws-sdk-oldest-eventbridge 28.87% <ø> (-0.01%) ⬇️
serverless-aws-sdk-oldest-kinesis 38.80% <ø> (+0.04%) ⬆️
serverless-aws-sdk-oldest-lambda 36.03% <ø> (+0.06%) ⬆️
serverless-aws-sdk-oldest-s3 33.98% <ø> (+0.06%) ⬆️
serverless-aws-sdk-oldest-serverless-peer-service 40.10% <34.09%> (+0.02%) ⬆️
serverless-aws-sdk-oldest-sns 39.85% <ø> (-0.09%) ⬇️
serverless-aws-sdk-oldest-sqs 38.95% <ø> (+0.04%) ⬆️
serverless-aws-sdk-oldest-stepfunctions 34.61% <ø> (+0.06%) ⬆️
serverless-aws-sdk-oldest-util 48.31% <ø> (+0.28%) ⬆️
serverless-azure-functions-eventhubs 38.55% <ø> (+0.15%) ⬆️
serverless-azure-functions-servicebus 38.61% <ø> (+0.15%) ⬆️
serverless-lambda 34.50% <100.00%> (+1.65%) ⬆️
test-optimization-cucumber-latest-7.0.0 50.38% <ø> (+0.16%) ⬆️
test-optimization-cucumber-latest-latest 53.09% <ø> (+0.16%) ⬆️
test-optimization-cucumber-oldest-7.0.0 50.42% <ø> (+0.19%) ⬆️
test-optimization-cypress-latest-12.0.0-commonJS 48.88% <ø> (+0.68%) ⬆️
test-optimization-cypress-latest-12.0.0-esm 48.80% <ø> (+0.56%) ⬆️
test-optimization-cypress-latest-14.5.4-commonJS 48.62% <ø> (+0.59%) ⬆️
test-optimization-cypress-latest-14.5.4-esm 48.65% <ø> (+0.59%) ⬆️
test-optimization-cypress-latest-latest-commonJS 49.11% <ø> (+0.58%) ⬆️
test-optimization-cypress-latest-latest-esm 49.14% <ø> (+0.58%) ⬆️
test-optimization-cypress-oldest-12.0.0-commonJS 48.81% <ø> (+0.59%) ⬆️
test-optimization-cypress-oldest-12.0.0-esm 48.84% <ø> (+0.59%) ⬆️
test-optimization-cypress-oldest-14.5.4-commonJS 48.66% <ø> (+0.59%) ⬆️
test-optimization-cypress-oldest-14.5.4-esm 48.69% <ø> (+0.59%) ⬆️
test-optimization-jest-latest-latest 54.84% <ø> (+0.11%) ⬆️
test-optimization-jest-latest-oldest 53.63% <ø> (+0.07%) ⬆️
test-optimization-jest-oldest-latest 54.85% <ø> (+0.11%) ⬆️
test-optimization-jest-oldest-oldest 53.59% <ø> (+0.11%) ⬆️
test-optimization-mocha-latest-latest 53.36% <ø> (+0.12%) ⬆️
test-optimization-mocha-latest-oldest 51.00% <ø> (+0.15%) ⬆️
test-optimization-mocha-oldest-latest 53.45% <ø> (+0.14%) ⬆️
test-optimization-mocha-oldest-oldest 50.94% <ø> (+0.15%) ⬆️
test-optimization-playwright-latest-latest-playwright-active-test-span 44.30% <ø> (+0.34%) ⬆️
test-optimization-playwright-latest-latest-playwright-atr 43.07% <ø> (+0.17%) ⬆️
test-optimization-playwright-latest-latest-playwright-efd 43.49% <ø> (+0.21%) ⬆️
test-optimization-playwright-latest-latest-playwright-final-status 43.51% <ø> (+0.17%) ⬆️
test-optimization-playwright-latest-latest-playwright-impacted-tests 43.00% <ø> (+0.06%) ⬆️
test-optimization-playwright-latest-latest-playwright-reporting 42.94% <ø> (+0.60%) ⬆️
test-optimization-playwright-latest-latest-playwright-test-management 44.73% <ø> (+0.22%) ⬆️
test-optimization-playwright-latest-oldest-playwright-active-test-span 44.37% <ø> (+0.34%) ⬆️
test-optimization-playwright-latest-oldest-playwright-atr 43.28% <ø> (+0.18%) ⬆️
test-optimization-playwright-latest-oldest-playwright-efd 43.55% <ø> (+0.21%) ⬆️
test-optimization-playwright-latest-oldest-playwright-final-status 43.59% <ø> (+0.20%) ⬆️
test-optimization-playwright-latest-oldest-playwright-impacted-tests 43.05% <ø> (+0.06%) ⬆️
test-optimization-playwright-latest-oldest-playwright-reporting 43.01% <ø> (+0.61%) ⬆️
test-optimization-playwright-latest-oldest-playwright-test-management 44.80% <ø> (+0.22%) ⬆️
test-optimization-playwright-oldest-latest-playwright-active-test-span 44.31% <ø> (+0.32%) ⬆️
test-optimization-playwright-oldest-latest-playwright-atr 43.11% <ø> (+0.17%) ⬆️
test-optimization-playwright-oldest-latest-playwright-efd 43.51% <ø> (+0.21%) ⬆️
test-optimization-playwright-oldest-latest-playwright-final-status 43.55% <ø> (+0.17%) ⬆️
test-optimization-playwright-oldest-latest-playwright-impacted-tests 43.04% <ø> (+0.06%) ⬆️
test-optimization-playwright-oldest-latest-playwright-reporting 42.98% <ø> (+0.63%) ⬆️
test-optimization-playwright-oldest-latest-playwright-test-management 44.74% <ø> (+0.22%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-active-test-span 44.40% <ø> (+0.34%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-atr 43.32% <ø> (+0.18%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-efd 43.56% <ø> (+0.21%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-final-status 43.61% <ø> (+0.18%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-impacted-tests 43.09% <ø> (+0.06%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-reporting 43.03% <ø> (+0.61%) ⬆️
test-optimization-playwright-oldest-oldest-playwright-test-management 44.81% <ø> (+0.22%) ⬆️
test-optimization-selenium-latest 45.67% <ø> (+0.12%) ⬆️
test-optimization-selenium-oldest 45.17% <ø> (+0.13%) ⬆️
test-optimization-testopt-active 46.99% <ø> (+0.14%) ⬆️
test-optimization-testopt-latest 46.95% <ø> (+0.14%) ⬆️
test-optimization-testopt-maintenance 46.99% <ø> (+0.14%) ⬆️
test-optimization-testopt-oldest 47.85% <ø> (+0.15%) ⬆️
test-optimization-vitest-latest 51.05% <ø> (+0.21%) ⬆️
test-optimization-vitest-oldest 48.05% <ø> (+0.70%) ⬆️

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.

@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented May 10, 2026

Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 1 Test failed

Plugin kafkajs with kafkajs >=1.4 (2.2.4) without configuration "before each" hook for "should not extract bootstrap servers when initialized with a function" from producer   View in Datadog   (Fix with Cursor)
This server does not host this topic-partition

KafkaJSProtocolError: This server does not host this topic-partition
    at createErrorFromCode (versions/kafkajs@>=1.4/node_modules/kafkajs/src/protocol/error.js:581:10)
    at Object.parse (versions/kafkajs@>=1.4/node_modules/kafkajs/src/protocol/requests/metadata/v0/response.js:55:11)
    at Connection.send (versions/kafkajs@>=1.4/node_modules/kafkajs/src/network/connection.js:433:35)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async [private:Broker:sendRequest] (versions/kafkajs@>=1.4/node_modules/kafkajs/src/broker/index.js:904:14)
    at async Broker.metadata (versions/kafkajs@>=1.4/node_modules/kafkajs/src/broker/index.js:177:12)
    at async retryOnLeaderNotAvailable.delay (versions/kafkajs@>=1.4/node_modules/kafkajs/src/admin/index.js:175:55)
...

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 96.23%
Overall Coverage: 86.85% (+0.10%)

Useful? React with 👍 / 👎

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

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented May 10, 2026

Benchmarks

Benchmark execution time: 2026-05-11 20:06:03

Comparing candidate commit eb47c57 in PR branch BridgeAR/2026-05-10-lambda-collapse with baseline commit 807fceb in branch master.

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

@BridgeAR BridgeAR marked this pull request as ready for review May 10, 2026 16:29
@BridgeAR BridgeAR requested review from a team as code owners May 10, 2026 16:29
Comment thread packages/dd-trace/src/lambda/index.js Outdated
tlhunter
tlhunter previously approved these changes May 11, 2026
Copy link
Copy Markdown
Contributor

@joeyzhao2018 joeyzhao2018 left a comment

Choose a reason for hiding this comment

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

LGTM

@BridgeAR BridgeAR merged commit 1b83d35 into master May 11, 2026
1004 of 1005 checks passed
@BridgeAR BridgeAR deleted the BridgeAR/2026-05-10-lambda-collapse branch May 11, 2026 21:39
@dd-octo-sts dd-octo-sts Bot mentioned this pull request May 12, 2026
rochdev pushed a commit that referenced this pull request May 13, 2026
* refactor(lambda): collapse runtime/ritm.js into index.js

\`registerLambdaHook\` lived in \`runtime/ritm.js\` while the
single bootstrap caller — \`src/lambda/index.js\` — was a one-line
forwarder. Three underscore-prefixed helpers
(\`_extractModuleRootAndHandler\`,
\`_extractModuleNameAndHandlerPath\`, \`_getLambdaFilePaths\`) were
exported only so the spec could reach them; both \`runtime/ritm.js\`
and \`runtime/patch.js\` carried the same logic in two places.

The helpers move to a shared \`src/lambda/handler-paths.js\` so
\`index.js\` and \`runtime/patch.js\` stop duplicating them. The
underscore prefixes drop along with their export.
\`DD_TRACE_DISABLED_INSTRUMENTATIONS\` gates \`registerLambdaHook\`
at the bootstrap entry rather than from inside the hook callback;
the env is read once at module load, the same shape every other
integration uses. The spec rewrites to a black-box test of
\`registerLambdaHook\` through a Hook spy injected by
\`proxyquire\`, covering the four env permutations the production
code branches on plus the inner Hook-callback paths.
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.

3 participants