dd-trace 6.16.0 → 6.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/ci/diagnose.js +0 -23
  2. package/ci/test-optimization-validation/approval-artifacts.js +0 -3
  3. package/ci/test-optimization-validation/approval.js +0 -6
  4. package/ci/test-optimization-validation/artifact-id.js +0 -1
  5. package/ci/test-optimization-validation/bounded-json.js +0 -1
  6. package/ci/test-optimization-validation/cli.js +0 -12
  7. package/ci/test-optimization-validation/command-output-policy.js +0 -1
  8. package/ci/test-optimization-validation/command-runner.js +0 -3
  9. package/ci/test-optimization-validation/environment.js +0 -4
  10. package/ci/test-optimization-validation/executable-approval.js +0 -1
  11. package/ci/test-optimization-validation/executable.js +0 -5
  12. package/ci/test-optimization-validation/framework-adapters/cucumber.js +0 -6
  13. package/ci/test-optimization-validation/framework-adapters/cypress.js +0 -3
  14. package/ci/test-optimization-validation/framework-adapters/playwright.js +0 -6
  15. package/ci/test-optimization-validation/framework-adapters/vitest.js +0 -4
  16. package/ci/test-optimization-validation/generated-test-contract.js +0 -5
  17. package/ci/test-optimization-validation/generated-verifier.js +0 -1
  18. package/ci/test-optimization-validation/literal-environment.js +0 -1
  19. package/ci/test-optimization-validation/manifest-scaffold.js +0 -17
  20. package/ci/test-optimization-validation/manifest-schema.js +0 -21
  21. package/ci/test-optimization-validation/offline-fixtures.js +0 -4
  22. package/ci/test-optimization-validation/plan-writer.js +0 -11
  23. package/ci/test-optimization-validation/preflight-runner.js +0 -1
  24. package/ci/test-optimization-validation/redaction.js +0 -4
  25. package/ci/test-optimization-validation/report-writer.js +0 -16
  26. package/ci/test-optimization-validation/runner-command.js +0 -3
  27. package/ci/test-optimization-validation/runner-contract.js +0 -4
  28. package/ci/test-optimization-validation/safe-files.js +0 -1
  29. package/ci/test-optimization-validation/scenarios/basic-reporting.js +0 -1
  30. package/ci/test-optimization-validation/scenarios/ci-wiring.js +0 -1
  31. package/ci/test-optimization-validation/source-text.js +0 -3
  32. package/ci/vitest-no-worker-init-setup.mjs +41 -16
  33. package/index.d.ts +165 -0
  34. package/package.json +17 -16
  35. package/packages/datadog-esbuild/src/utils.js +0 -2
  36. package/packages/datadog-instrumentations/src/aerospike.js +28 -6
  37. package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js.js +0 -2
  38. package/packages/datadog-instrumentations/src/aws-sdk.js +0 -2
  39. package/packages/datadog-instrumentations/src/claude-agent-sdk.js +0 -2
  40. package/packages/datadog-instrumentations/src/console.js +97 -0
  41. package/packages/datadog-instrumentations/src/cucumber.js +72 -12
  42. package/packages/datadog-instrumentations/src/cypress-config.js +0 -23
  43. package/packages/datadog-instrumentations/src/helpers/channel.js +0 -2
  44. package/packages/datadog-instrumentations/src/helpers/graphql-jit-runtime.js +0 -5
  45. package/packages/datadog-instrumentations/src/helpers/hooks.js +8 -0
  46. package/packages/datadog-instrumentations/src/helpers/instrumentation-utils.js +0 -3
  47. package/packages/datadog-instrumentations/src/helpers/pool-acquire.js +0 -6
  48. package/packages/datadog-instrumentations/src/helpers/register.js +4 -0
  49. package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +72 -24
  50. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentation-registry.js +39 -0
  51. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +3 -17
  52. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/playwright.js +12 -0
  53. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/postgres.js +36 -0
  54. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/supabase.js +128 -0
  55. package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +16 -0
  56. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms/postgres.js +388 -0
  57. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +0 -5
  58. package/packages/datadog-instrumentations/src/helpers/router-helper.js +0 -1
  59. package/packages/datadog-instrumentations/src/jest.js +141 -51
  60. package/packages/datadog-instrumentations/src/knex.js +0 -1
  61. package/packages/datadog-instrumentations/src/mariadb-bundle.js +0 -24
  62. package/packages/datadog-instrumentations/src/mariadb.js +0 -2
  63. package/packages/datadog-instrumentations/src/mocha/common.js +0 -1
  64. package/packages/datadog-instrumentations/src/mocha/main.js +22 -25
  65. package/packages/datadog-instrumentations/src/mocha/utils.js +119 -49
  66. package/packages/datadog-instrumentations/src/mocha/webdriverio-protocol.js +0 -6
  67. package/packages/datadog-instrumentations/src/mocha/worker.js +14 -17
  68. package/packages/datadog-instrumentations/src/mysql2.js +0 -2
  69. package/packages/datadog-instrumentations/src/openai-realtime/audio-accumulator.js +241 -0
  70. package/packages/datadog-instrumentations/src/openai-realtime/events.js +76 -0
  71. package/packages/datadog-instrumentations/src/openai-realtime/index.js +301 -0
  72. package/packages/datadog-instrumentations/src/openai-realtime/session.js +998 -0
  73. package/packages/datadog-instrumentations/src/openai-realtime/turns.js +211 -0
  74. package/packages/datadog-instrumentations/src/openai.js +51 -12
  75. package/packages/datadog-instrumentations/src/oracledb.js +9 -3
  76. package/packages/datadog-instrumentations/src/playwright-reporter.js +3 -16
  77. package/packages/datadog-instrumentations/src/playwright.js +238 -55
  78. package/packages/datadog-instrumentations/src/postgres.js +7 -0
  79. package/packages/datadog-instrumentations/src/router.js +0 -2
  80. package/packages/datadog-instrumentations/src/rum-browser-scripts.js +0 -2
  81. package/packages/datadog-instrumentations/src/sequelize.js +0 -1
  82. package/packages/datadog-instrumentations/src/supabase.js +15 -0
  83. package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +18 -18
  84. package/packages/datadog-instrumentations/src/vitest-main.js +37 -17
  85. package/packages/datadog-instrumentations/src/vitest-util.js +7 -1
  86. package/packages/datadog-instrumentations/src/vitest-worker.js +49 -13
  87. package/packages/datadog-instrumentations/src/webdriverio.js +23 -42
  88. package/packages/datadog-instrumentations/src/ws.js +0 -1
  89. package/packages/datadog-plugin-ai/src/utils.js +0 -2
  90. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/trace-checkpoint.js +0 -1
  91. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/util.js +0 -2
  92. package/packages/datadog-plugin-aws-sdk/src/base.js +0 -1
  93. package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +0 -1
  94. package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +0 -1
  95. package/packages/datadog-plugin-aws-sdk/src/util.js +0 -1
  96. package/packages/datadog-plugin-azure-durable-functions/src/index.js +0 -1
  97. package/packages/datadog-plugin-cucumber/src/index.js +10 -0
  98. package/packages/datadog-plugin-cypress/src/cypress-plugin.js +171 -75
  99. package/packages/datadog-plugin-cypress/src/finalization.js +0 -3
  100. package/packages/datadog-plugin-cypress/src/source-map-utils.js +0 -4
  101. package/packages/datadog-plugin-cypress/src/support.js +52 -7
  102. package/packages/datadog-plugin-graphql/src/resolve-error.js +1 -2
  103. package/packages/datadog-plugin-graphql/src/utils.js +0 -5
  104. package/packages/datadog-plugin-jest/src/index.js +13 -0
  105. package/packages/datadog-plugin-kafkajs/src/producer.js +0 -1
  106. package/packages/datadog-plugin-mocha/src/index.js +39 -11
  107. package/packages/datadog-plugin-mongodb-core/src/query.js +0 -1
  108. package/packages/datadog-plugin-openai/src/index.js +16 -1
  109. package/packages/datadog-plugin-openai/src/realtime.js +144 -0
  110. package/packages/datadog-plugin-openai-agents/src/integration.js +0 -4
  111. package/packages/datadog-plugin-openai-agents/src/util.js +0 -1
  112. package/packages/datadog-plugin-playwright/src/index.js +76 -9
  113. package/packages/datadog-plugin-postgres/src/index.js +167 -0
  114. package/packages/datadog-plugin-prisma/src/datadog-tracing-helper.js +0 -1
  115. package/packages/datadog-plugin-redis/src/index.js +15 -1
  116. package/packages/datadog-plugin-supabase/src/error.js +18 -0
  117. package/packages/datadog-plugin-supabase/src/index.js +21 -0
  118. package/packages/datadog-plugin-supabase/src/supabase-auth-js-gotrueclient-getuser.js +69 -0
  119. package/packages/datadog-plugin-supabase/src/supabase-functions-js-functionsclient-invoke.js +70 -0
  120. package/packages/datadog-plugin-supabase/src/supabase-postgrest-js-postgrestbuilder-then.js +122 -0
  121. package/packages/datadog-plugin-supabase/src/supabase-realtime-js-realtimechannel-send.js +66 -0
  122. package/packages/datadog-plugin-supabase/src/supabase-storage-js-handle-request.js +93 -0
  123. package/packages/datadog-plugin-supabase/src/url.js +17 -0
  124. package/packages/datadog-plugin-vitest/src/index.js +10 -0
  125. package/packages/datadog-plugin-ws/src/util.js +0 -4
  126. package/packages/datadog-turbopack/index.js +0 -6
  127. package/packages/datadog-turbopack/src/loader.js +0 -16
  128. package/packages/datadog-webpack/src/loader.js +0 -1
  129. package/packages/dd-trace/src/aiguard/client.js +2 -3
  130. package/packages/dd-trace/src/aiguard/evaluation.js +6 -12
  131. package/packages/dd-trace/src/aiguard/index.js +2 -2
  132. package/packages/dd-trace/src/aiguard/integrations/index.js +1 -1
  133. package/packages/dd-trace/src/aiguard/integrations/openai.js +81 -7
  134. package/packages/dd-trace/src/aiguard/messages/anthropic.js +0 -2
  135. package/packages/dd-trace/src/aiguard/messages/openai.js +64 -1
  136. package/packages/dd-trace/src/aiguard/messages/utils.js +0 -1
  137. package/packages/dd-trace/src/aiguard/redaction.js +0 -1
  138. package/packages/dd-trace/src/aiguard/sdk.js +1 -1
  139. package/packages/dd-trace/src/appsec/activation.js +1 -1
  140. package/packages/dd-trace/src/appsec/api_security/normalized-route.js +0 -5
  141. package/packages/dd-trace/src/appsec/api_security/sampler.js +0 -4
  142. package/packages/dd-trace/src/appsec/blocking/index.js +3 -3
  143. package/packages/dd-trace/src/appsec/downstream_requests.js +1 -4
  144. package/packages/dd-trace/src/appsec/iast/index.js +1 -1
  145. package/packages/dd-trace/src/appsec/iast/overhead-controller.js +5 -5
  146. package/packages/dd-trace/src/appsec/iast/taint-tracking/index.js +1 -1
  147. package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +1 -1
  148. package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +3 -3
  149. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/sql-sensitive-analyzer.js +8 -10
  150. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +2 -2
  151. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +4 -1
  152. package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +7 -7
  153. package/packages/dd-trace/src/appsec/index.js +2 -2
  154. package/packages/dd-trace/src/appsec/lambda.js +71 -2
  155. package/packages/dd-trace/src/appsec/rasp/utils.js +5 -1
  156. package/packages/dd-trace/src/appsec/remote_config.js +8 -6
  157. package/packages/dd-trace/src/appsec/reporter.js +10 -6
  158. package/packages/dd-trace/src/appsec/rule_manager.js +3 -3
  159. package/packages/dd-trace/src/appsec/sdk/track_event.js +0 -2
  160. package/packages/dd-trace/src/appsec/waf/index.js +2 -2
  161. package/packages/dd-trace/src/appsec/waf/waf_manager.js +8 -5
  162. package/packages/dd-trace/src/carrier.js +0 -5
  163. package/packages/dd-trace/src/ci-visibility/dynamic-atr-retries.js +104 -0
  164. package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +0 -2
  165. package/packages/dd-trace/src/ci-visibility/efd-retry-policy.js +34 -3
  166. package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +0 -1
  167. package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +0 -1
  168. package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +0 -1
  169. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/index.js +0 -4
  170. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/msgpack-to-json.js +0 -1
  171. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/sink.js +0 -2
  172. package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +37 -15
  173. package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +0 -3
  174. package/packages/dd-trace/src/ci-visibility/exporters/request.js +0 -11
  175. package/packages/dd-trace/src/ci-visibility/exporters/settings-cache-key.js +0 -1
  176. package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +0 -1
  177. package/packages/dd-trace/src/ci-visibility/requests/fs-cache.js +0 -6
  178. package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +2 -2
  179. package/packages/dd-trace/src/ci-visibility/requests/rate-limit.js +0 -1
  180. package/packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js +0 -5
  181. package/packages/dd-trace/src/ci-visibility/requests/video-request.js +0 -1
  182. package/packages/dd-trace/src/ci-visibility/telemetry.js +13 -0
  183. package/packages/dd-trace/src/ci-visibility/test-optimization-cache.js +0 -1
  184. package/packages/dd-trace/src/ci-visibility/test-screenshot.js +0 -2
  185. package/packages/dd-trace/src/ci-visibility/test-video.js +0 -1
  186. package/packages/dd-trace/src/config/defaults.js +3 -2
  187. package/packages/dd-trace/src/config/generated-config-types.d.ts +73 -67
  188. package/packages/dd-trace/src/config/helper.js +0 -1
  189. package/packages/dd-trace/src/config/index.js +24 -24
  190. package/packages/dd-trace/src/config/parsers.js +34 -6
  191. package/packages/dd-trace/src/config/remote_config.js +25 -109
  192. package/packages/dd-trace/src/config/supported-configurations.json +139 -10
  193. package/packages/dd-trace/src/datastreams/encoding.js +0 -1
  194. package/packages/dd-trace/src/datastreams/pathway.js +0 -1
  195. package/packages/dd-trace/src/debugger/constants.js +10 -0
  196. package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +62 -10
  197. package/packages/dd-trace/src/debugger/devtools_client/config.js +2 -0
  198. package/packages/dd-trace/src/debugger/devtools_client/guardrail-metrics.js +15 -0
  199. package/packages/dd-trace/src/debugger/devtools_client/index.js +103 -27
  200. package/packages/dd-trace/src/debugger/devtools_client/json-buffer.js +50 -7
  201. package/packages/dd-trace/src/debugger/devtools_client/log.js +3 -1
  202. package/packages/dd-trace/src/debugger/devtools_client/probe_sampler.js +21 -8
  203. package/packages/dd-trace/src/debugger/devtools_client/send.js +40 -14
  204. package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +53 -13
  205. package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +118 -71
  206. package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +0 -3
  207. package/packages/dd-trace/src/debugger/devtools_client/status.js +20 -6
  208. package/packages/dd-trace/src/debugger/guardrail-metrics.js +167 -0
  209. package/packages/dd-trace/src/debugger/index.js +50 -2
  210. package/packages/dd-trace/src/debugger/inspect-segment.js +0 -3
  211. package/packages/dd-trace/src/debugger/probe_sampler.js +133 -9
  212. package/packages/dd-trace/src/debugger/probe_sampler_constants.js +31 -1
  213. package/packages/dd-trace/src/dogstatsd.js +0 -23
  214. package/packages/dd-trace/src/encode/0.4-cross-payload.js +0 -3
  215. package/packages/dd-trace/src/encode/0.4.js +0 -7
  216. package/packages/dd-trace/src/encode/0.5.js +0 -2
  217. package/packages/dd-trace/src/encode/tags-processors.js +0 -1
  218. package/packages/dd-trace/src/evp_proxy/discovery.js +0 -1
  219. package/packages/dd-trace/src/evp_proxy/path.js +0 -2
  220. package/packages/dd-trace/src/exporters/agent/writer.js +0 -1
  221. package/packages/dd-trace/src/exporters/agentless/index.js +0 -1
  222. package/packages/dd-trace/src/exporters/agentless/intake.js +0 -1
  223. package/packages/dd-trace/src/exporters/agentless/writer.js +0 -3
  224. package/packages/dd-trace/src/exporters/common/final-flush-request-tracker.js +0 -6
  225. package/packages/dd-trace/src/exporters/common/request.js +1 -0
  226. package/packages/dd-trace/src/exporters/common/url.js +0 -2
  227. package/packages/dd-trace/src/exporters/common/writer.js +0 -2
  228. package/packages/dd-trace/src/id.js +0 -11
  229. package/packages/dd-trace/src/llmobs/audio-codec.js +192 -0
  230. package/packages/dd-trace/src/llmobs/audio-utils.js +121 -0
  231. package/packages/dd-trace/src/llmobs/constants/audio.js +35 -0
  232. package/packages/dd-trace/src/llmobs/constants/prompts.js +14 -0
  233. package/packages/dd-trace/src/llmobs/constants/tags.js +17 -0
  234. package/packages/dd-trace/src/llmobs/eval-metric.js +0 -6
  235. package/packages/dd-trace/src/llmobs/experiments/dataset.js +0 -4
  236. package/packages/dd-trace/src/llmobs/experiments/experiment.js +0 -3
  237. package/packages/dd-trace/src/llmobs/experiments/index.js +7 -6
  238. package/packages/dd-trace/src/llmobs/experiments/util.js +1 -11
  239. package/packages/dd-trace/src/llmobs/index.js +1 -3
  240. package/packages/dd-trace/src/llmobs/noop.js +10 -0
  241. package/packages/dd-trace/src/llmobs/plugins/ai/util.js +0 -4
  242. package/packages/dd-trace/src/llmobs/plugins/anthropic/util.js +0 -1
  243. package/packages/dd-trace/src/llmobs/plugins/genai/util.js +0 -4
  244. package/packages/dd-trace/src/llmobs/plugins/modelcontextprotocol-sdk/utils.js +0 -2
  245. package/packages/dd-trace/src/llmobs/plugins/openai/constants.js +0 -2
  246. package/packages/dd-trace/src/llmobs/plugins/openai/index.js +4 -6
  247. package/packages/dd-trace/src/llmobs/plugins/openai/realtime.js +285 -0
  248. package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +16 -3
  249. package/packages/dd-trace/src/llmobs/prompts/cache.js +272 -0
  250. package/packages/dd-trace/src/llmobs/prompts/manager.js +639 -0
  251. package/packages/dd-trace/src/llmobs/prompts/noop.js +29 -0
  252. package/packages/dd-trace/src/llmobs/prompts/prompt.js +92 -0
  253. package/packages/dd-trace/src/llmobs/sdk.js +21 -6
  254. package/packages/dd-trace/src/llmobs/span_processor.js +81 -2
  255. package/packages/dd-trace/src/llmobs/tagger.js +30 -7
  256. package/packages/dd-trace/src/llmobs/telemetry.js +36 -4
  257. package/packages/dd-trace/src/llmobs/util.js +0 -34
  258. package/packages/dd-trace/src/llmobs/writers/base.js +0 -1
  259. package/packages/dd-trace/src/llmobs/writers/util.js +1 -2
  260. package/packages/dd-trace/src/log/channels.js +3 -0
  261. package/packages/dd-trace/src/log/index.js +23 -5
  262. package/packages/dd-trace/src/log-submission/log-submission-plugin.js +74 -6
  263. package/packages/dd-trace/src/msgpack/chunk.js +0 -1
  264. package/packages/dd-trace/src/openfeature/agentless_configuration_source.js +0 -12
  265. package/packages/dd-trace/src/openfeature/encoding.js +0 -2
  266. package/packages/dd-trace/src/openfeature/eval-metrics-hook.js +0 -1
  267. package/packages/dd-trace/src/openfeature/index.js +0 -4
  268. package/packages/dd-trace/src/openfeature/span-enrichment-hook.js +0 -1
  269. package/packages/dd-trace/src/openfeature/span-enrichment.js +0 -4
  270. package/packages/dd-trace/src/openfeature/writers/base.js +0 -6
  271. package/packages/dd-trace/src/openfeature/writers/exposures.js +0 -5
  272. package/packages/dd-trace/src/openfeature/writers/util.js +0 -4
  273. package/packages/dd-trace/src/opentelemetry/logs/logger.js +0 -1
  274. package/packages/dd-trace/src/opentelemetry/logs/logger_provider.js +0 -1
  275. package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +0 -1
  276. package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +0 -2
  277. package/packages/dd-trace/src/opentelemetry/metrics/meter_provider.js +0 -1
  278. package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_transformer.js +0 -1
  279. package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +0 -1
  280. package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +1 -14
  281. package/packages/dd-trace/src/opentelemetry/metrics/time.js +0 -1
  282. package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +30 -13
  283. package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +0 -1
  284. package/packages/dd-trace/src/opentelemetry/span-helpers.js +0 -1
  285. package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +0 -1
  286. package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +0 -3
  287. package/packages/dd-trace/src/opentracing/propagation/text_map.js +0 -6
  288. package/packages/dd-trace/src/opentracing/span_context.js +0 -1
  289. package/packages/dd-trace/src/otel-thread-ctx.js +38 -11
  290. package/packages/dd-trace/src/payload-tagging/tagging.js +15 -3
  291. package/packages/dd-trace/src/plugins/ci_plugin.js +0 -1
  292. package/packages/dd-trace/src/plugins/database.js +2 -6
  293. package/packages/dd-trace/src/plugins/index.js +7 -0
  294. package/packages/dd-trace/src/plugins/plugin.js +0 -4
  295. package/packages/dd-trace/src/plugins/tracing.js +1 -1
  296. package/packages/dd-trace/src/plugins/util/git.js +1 -3
  297. package/packages/dd-trace/src/plugins/util/http-otel-semantics.js +0 -1
  298. package/packages/dd-trace/src/plugins/util/llm.js +0 -2
  299. package/packages/dd-trace/src/plugins/util/status-validator.js +0 -1
  300. package/packages/dd-trace/src/plugins/util/test.js +21 -20
  301. package/packages/dd-trace/src/plugins/util/url.js +0 -5
  302. package/packages/dd-trace/src/priority_sampler.js +0 -6
  303. package/packages/dd-trace/src/process-tags/index.js +0 -1
  304. package/packages/dd-trace/src/profiler.js +132 -35
  305. package/packages/dd-trace/src/profiling/exporters/event_serializer.js +0 -1
  306. package/packages/dd-trace/src/profiling/profiler.js +101 -41
  307. package/packages/dd-trace/src/profiling/ssi-heuristics.js +29 -15
  308. package/packages/dd-trace/src/propagation-hash/index.js +0 -1
  309. package/packages/dd-trace/src/proxy.js +21 -45
  310. package/packages/dd-trace/src/random_sampler.js +0 -4
  311. package/packages/dd-trace/src/rate_limiter.js +0 -4
  312. package/packages/dd-trace/src/remote_config/capabilities.js +1 -9
  313. package/packages/dd-trace/src/remote_config/index.js +0 -1
  314. package/packages/dd-trace/src/runtime_metrics/otlp_runtime_metrics.js +0 -3
  315. package/packages/dd-trace/src/sampler.js +0 -4
  316. package/packages/dd-trace/src/sampling_rule.js +0 -7
  317. package/packages/dd-trace/src/serverless/vercel.js +0 -1
  318. package/packages/dd-trace/src/serverless.js +0 -1
  319. package/packages/dd-trace/src/service-naming/index.js +0 -1
  320. package/packages/dd-trace/src/service-naming/schemas/util.js +0 -1
  321. package/packages/dd-trace/src/service-naming/schemas/v0/storage.js +7 -0
  322. package/packages/dd-trace/src/service-naming/schemas/v1/storage.js +5 -0
  323. package/packages/dd-trace/src/span_processor.js +2 -2
  324. package/packages/dd-trace/src/span_sampler.js +0 -1
  325. package/packages/dd-trace/src/standalone/product.js +2 -2
  326. package/packages/dd-trace/src/standalone/tracesource.js +0 -1
  327. package/packages/dd-trace/src/startup-log.js +1 -1
  328. package/packages/dd-trace/src/telemetry/endpoints.js +0 -8
  329. package/packages/dd-trace/src/telemetry/logs/index.js +16 -5
  330. package/packages/dd-trace/src/telemetry/logs/log-collector.js +16 -6
  331. package/packages/dd-trace/src/telemetry/metrics.js +0 -2
  332. package/packages/dd-trace/src/telemetry/telemetry.js +4 -1
  333. package/packages/dd-trace/src/util.js +13 -1
  334. package/vendor/dist/@datadog/openfeature-node-server/index.js +1 -1
@@ -4,7 +4,6 @@
4
4
  * Replaces JavaScript comments with spaces while preserving line structure and string literals.
5
5
  *
6
6
  * @param {string} source JavaScript or TypeScript source
7
- * @returns {string} source with comments masked
8
7
  */
9
8
  function maskJavaScriptComments (source) {
10
9
  return maskJavaScriptSource(source, false)
@@ -14,7 +13,6 @@ function maskJavaScriptComments (source) {
14
13
  * Replaces JavaScript comments and string literals with spaces while preserving line structure.
15
14
  *
16
15
  * @param {string} source JavaScript or TypeScript source
17
- * @returns {string} source with non-code text masked
18
16
  */
19
17
  function maskJavaScriptNonCode (source) {
20
18
  return maskJavaScriptSource(source, true)
@@ -25,7 +23,6 @@ function maskJavaScriptNonCode (source) {
25
23
  *
26
24
  * @param {string} source JavaScript or TypeScript source
27
25
  * @param {boolean} maskStrings whether string and template literal contents should be masked
28
- * @returns {string} masked source
29
26
  */
30
27
  function maskJavaScriptSource (source, maskStrings) {
31
28
  const characters = [...source]
@@ -15,6 +15,8 @@ const earlyFlakeDetectionRetryPolicy = providedContext.earlyFlakeDetectionRetryP
15
15
  schedulingRetryCount: 0,
16
16
  }
17
17
  const earlyFlakeDetectionRetries = earlyFlakeDetectionRetryPolicy.schedulingRetryCount
18
+ const dynamicAtrRetryPolicy = providedContext.dynamicAtrRetryPolicy
19
+ const flakyTestRetriesConfiguration = providedContext.flakyTestRetriesConfiguration
18
20
  const isEfdSuiteAdmissionEnabled = providedContext.isEfdSuiteAdmissionEnabled === true
19
21
  const isEarlyFlakeDetectionEnabled = providedContext.isEarlyFlakeDetectionEnabled === true
20
22
  const knownTests = providedContext.knownTests || {}
@@ -31,6 +33,7 @@ const earlyFlakeDetectionSkippedResults = new WeakMap()
31
33
  const earlyFlakeDetectionStartByTask = new WeakMap()
32
34
  const nextAttemptIndexByTask = new WeakMap()
33
35
  const retryAttemptIndexByTask = new WeakMap()
36
+ const dynamicAtrExecutionStartByTask = new WeakMap()
34
37
  const usedRumTestExecutionIds = new Set()
35
38
  let browserCommands
36
39
  let now
@@ -86,6 +89,11 @@ if (isNoWorkerInitActive) {
86
89
  const isQuarantinedTest = quarantinedTests[testSuite]?.[testName] && !isAttemptToFixTest
87
90
  const attemptIndex = getNextAttemptIndex(task)
88
91
  const attemptStart = now()
92
+ if (task.retry?.__ddTestOptAtr && retryAttemptIndexByTask.get(task).index === 0) {
93
+ const executionStart = task.result.repeatCount > 0 ? attemptStart : task.result.startTime - timeOrigin
94
+ dynamicAtrExecutionStartByTask.set(task, executionStart)
95
+ task.meta.__ddTestOptAtrRetries = undefined
96
+ }
89
97
  if (attemptIndex > 0) {
90
98
  recordTestOptimizationStatus(task, attemptIndex - 1)
91
99
  }
@@ -153,11 +161,43 @@ function applyExecutionChanges (suite, isEfdSuiteAdmissionAllowed) {
153
161
  task.repeats = earlyFlakeDetectionRetries
154
162
  task.meta.__ddTestOptEfdRetries = earlyFlakeDetectionRetries
155
163
  }
164
+ configureDynamicAtr(task)
156
165
  wrapRetryCondition(task)
157
166
  }
158
167
  }
159
168
  }
160
169
 
170
+ /**
171
+ * Stops Datadog-managed retries at the initial attempt's duration budget, after the complete lifecycle.
172
+ *
173
+ * @param {object} task
174
+ */
175
+ function configureDynamicAtr (task) {
176
+ if (!dynamicAtrRetryPolicy || !flakyTestRetriesConfiguration) return
177
+ const projectName = task.file.projectName
178
+ const isManagedProject = projectName
179
+ ? flakyTestRetriesConfiguration.projectNames.includes(projectName)
180
+ : flakyTestRetriesConfiguration.includesUnnamedProject
181
+ if (!isManagedProject || !task.retry?.__ddTestOptAtr || task.retry.count <= 0) return
182
+
183
+ task.retry = {
184
+ ...task.retry,
185
+ condition () {
186
+ // AroundEach fixture teardown can fail after onTestFinished recorded the attempt's errors.
187
+ recordRetryErrorCount(task)
188
+ if (task.meta.__ddTestOptAtrRetries === undefined) {
189
+ const executionStart = dynamicAtrExecutionStartByTask.get(task) ?? task.result.startTime - timeOrigin
190
+ const duration = now() - executionStart
191
+ task.meta.__ddTestOptAtrRetries = dynamicAtrRetryPolicy.find(
192
+ ({ durationLimitMs }) => durationLimitMs === undefined || duration <= durationLimitMs
193
+ ).retryCount
194
+ }
195
+ const retryIndex = retryAttemptIndexByTask.get(task)?.index ?? task.result.retryCount
196
+ return retryIndex < task.meta.__ddTestOptAtrRetries
197
+ },
198
+ }
199
+ }
200
+
161
201
  function getNextAttemptIndex (task) {
162
202
  const attemptIndex = nextAttemptIndexByTask.get(task) || 0
163
203
  nextAttemptIndexByTask.set(task, attemptIndex + 1)
@@ -179,7 +219,6 @@ function getNextAttemptIndex (task) {
179
219
  *
180
220
  * @param {object} task
181
221
  * @param {number} attemptIndex
182
- * @returns {void}
183
222
  */
184
223
  function prepareRumCorrelation (task, attemptIndex) {
185
224
  // A per-origin cookie cannot identify overlapping attempts without racing.
@@ -213,7 +252,6 @@ function prepareRumCorrelation (task, attemptIndex) {
213
252
  *
214
253
  * @param {object} task
215
254
  * @param {number} attemptIndex
216
- * @returns {void}
217
255
  */
218
256
  function finishRumCorrelation (task, attemptIndex) {
219
257
  const testExecutionId = task.meta.__ddTestOptRumTestExecutionIds?.[attemptIndex]
@@ -228,7 +266,6 @@ function finishRumCorrelation (task, attemptIndex) {
228
266
  *
229
267
  * @param {object} task
230
268
  * @param {number} attemptIndex
231
- * @returns {void}
232
269
  */
233
270
  function recordRumActivity (task, attemptIndex) {
234
271
  if (!getIsRumActive(getRum())) return
@@ -252,7 +289,6 @@ function getRum () {
252
289
  * Returns whether the current RUM session is active.
253
290
  *
254
291
  * @param {object|undefined} rum
255
- * @returns {boolean}
256
292
  */
257
293
  function getIsRumActive (rum) {
258
294
  if (!rum) return false
@@ -269,7 +305,6 @@ function getIsRumActive (rum) {
269
305
  * Returns whether a task or any containing suite is concurrent.
270
306
  *
271
307
  * @param {object} task
272
- * @returns {boolean}
273
308
  */
274
309
  function isConcurrentTask (task) {
275
310
  let currentTask = task
@@ -308,7 +343,6 @@ function generateTestExecutionId () {
308
343
  * Sets and verifies the RUM correlation cookie for the current origin.
309
344
  *
310
345
  * @param {string} testExecutionId
311
- * @returns {boolean}
312
346
  */
313
347
  function setRumCorrelationCookie (testExecutionId) {
314
348
  try {
@@ -324,7 +358,6 @@ function setRumCorrelationCookie (testExecutionId) {
324
358
  * Clears the RUM correlation cookie if it still belongs to this attempt.
325
359
  *
326
360
  * @param {string} testExecutionId
327
- * @returns {void}
328
361
  */
329
362
  function clearRumCorrelationCookie (testExecutionId) {
330
363
  try {
@@ -440,7 +473,6 @@ function recordManualRepeatStatus (task, attemptIndex) {
440
473
  * Records cumulative errors at the end of each configured retry attempt.
441
474
  *
442
475
  * @param {object} task
443
- * @returns {void}
444
476
  */
445
477
  function recordRetryErrorCount (task) {
446
478
  const retryLimit = getRetryLimit(task)
@@ -457,7 +489,6 @@ function recordRetryErrorCount (task) {
457
489
  * @param {object} task
458
490
  * @param {number} attemptIndex
459
491
  * @param {number} attemptStart
460
- * @returns {void}
461
492
  */
462
493
  function recordTestAttemptTiming (task, attemptIndex, attemptStart) {
463
494
  task.meta.__ddTestOptAttemptStartTimes ||= []
@@ -470,17 +501,15 @@ function recordTestAttemptTiming (task, attemptIndex, attemptStart) {
470
501
  * Returns the configured retry count for numeric and object-form retry options.
471
502
  *
472
503
  * @param {object} task
473
- * @returns {number}
474
504
  */
475
505
  function getRetryLimit (task) {
476
- return typeof task.retry === 'number' ? task.retry : task.retry?.count || 0
506
+ return task.meta.__ddTestOptAtrRetries ?? (typeof task.retry === 'number' ? task.retry : task.retry?.count || 0)
477
507
  }
478
508
 
479
509
  /**
480
510
  * Wraps Vitest's retry condition so final-attempt handling follows the condition's actual result.
481
511
  *
482
512
  * @param {object} task
483
- * @returns {void}
484
513
  */
485
514
  function wrapRetryCondition (task) {
486
515
  if (typeof task.retry !== 'object' || !task.retry?.condition || getRetryLimit(task) === 0) return
@@ -572,7 +601,6 @@ function switchQuarantinedFinalFailure (task, attemptIndex) {
572
601
  * Converts a quarantined failure into the passing runner state expected by Vitest.
573
602
  *
574
603
  * @param {object} task
575
- * @returns {void}
576
604
  */
577
605
  function markQuarantinedFailure (task) {
578
606
  const testSuite = getTestSuite(task)
@@ -676,7 +704,6 @@ function noopTest () {}
676
704
  /**
677
705
  * Returns whether Vitest's private task function setter is available.
678
706
  *
679
- * @returns {boolean}
680
707
  */
681
708
  function canReplaceVitestTaskFn () {
682
709
  return typeof setVitestTaskFn === 'function'
@@ -703,7 +730,6 @@ function isEarlyFlakeDetectionTest (testSuite, testName) {
703
730
  * Returns whether Datadog admitted this task for EFD retries.
704
731
  *
705
732
  * @param {object} task
706
- * @returns {boolean}
707
733
  */
708
734
  function isEarlyFlakeDetectionTask (task) {
709
735
  return task.meta.__ddTestOptEfdRetries !== undefined
@@ -751,7 +777,6 @@ function getEarlyFlakeDetectionSuiteCandidate (suite) {
751
777
  *
752
778
  * @param {string} testSuite
753
779
  * @param {string} testName
754
- * @returns {boolean}
755
780
  */
756
781
  function isNewTest (testSuite, testName) {
757
782
  return !(knownTests[testSuite] || []).includes(testName)
package/index.d.ts CHANGED
@@ -298,6 +298,7 @@ interface Plugins {
298
298
  "playwright": tracer.plugins.playwright;
299
299
  "pg": tracer.plugins.pg;
300
300
  "pino": tracer.plugins.pino;
301
+ "postgres": tracer.plugins.postgres;
301
302
  "prisma": tracer.plugins.prisma;
302
303
  "protobufjs": tracer.plugins.protobufjs;
303
304
  "redis": tracer.plugins.redis;
@@ -306,6 +307,7 @@ interface Plugins {
306
307
  "router": tracer.plugins.router;
307
308
  "selenium": tracer.plugins.selenium;
308
309
  "sharedb": tracer.plugins.sharedb;
310
+ "supabase": tracer.plugins.supabase;
309
311
  "tedious": tracer.plugins.tedious;
310
312
  "undici": tracer.plugins.undici;
311
313
  "vitest": tracer.plugins.vitest;
@@ -3126,6 +3128,25 @@ declare namespace tracer {
3126
3128
  */
3127
3129
  interface pino extends Integration {}
3128
3130
 
3131
+ /**
3132
+ * This plugin automatically instruments the
3133
+ * [Postgres.js](https://github.com/porsager/postgres) module.
3134
+ */
3135
+ interface postgres extends DatabaseInstrumentation {
3136
+ /**
3137
+ * The service name to be used for this plugin.
3138
+ */
3139
+ service?: string;
3140
+ /**
3141
+ * The database monitoring propagation mode to be used for this plugin.
3142
+ */
3143
+ dbmPropagationMode?: TracerOptions['dbmPropagationMode'];
3144
+ /**
3145
+ * Appends the SQL comment propagation to the query string. Prepends the comment if `false`. For long query strings, the appended propagation comment might be truncated, causing loss of correlation between the query and trace.
3146
+ */
3147
+ appendComment?: boolean;
3148
+ }
3149
+
3129
3150
  /**
3130
3151
  * This plugin automatically instruments the
3131
3152
  * [@prisma/client](https://www.prisma.io/docs/orm/prisma-client) module.
@@ -3241,6 +3262,12 @@ declare namespace tracer {
3241
3262
  };
3242
3263
  }
3243
3264
 
3265
+ /**
3266
+ * This plugin automatically instruments the
3267
+ * [Supabase JavaScript client](https://github.com/supabase/supabase-js).
3268
+ */
3269
+ interface supabase extends Instrumentation {}
3270
+
3244
3271
  /**
3245
3272
  * This plugin automatically instruments the
3246
3273
  * [tedious](https://github.com/tediousjs/tedious/) module.
@@ -3686,6 +3713,9 @@ declare namespace tracer {
3686
3713
  */
3687
3714
  experiments: Experiments,
3688
3715
 
3716
+ /** Prompt Management API. */
3717
+ prompts: Prompts,
3718
+
3689
3719
  /**
3690
3720
  * Enable LLM Observability tracing.
3691
3721
  *
@@ -3846,6 +3876,135 @@ declare namespace tracer {
3846
3876
  flush (): void
3847
3877
  }
3848
3878
 
3879
+ interface Prompts {
3880
+ /** Resolve an exact, environment-targeted, or latest managed prompt. */
3881
+ getPrompt (promptId: string, options?: GetPromptOptions): Promise<ManagedPrompt>
3882
+ /** Refresh the prompt selected by the current environment. */
3883
+ refreshPrompt (promptId: string): Promise<ManagedPrompt | undefined>
3884
+ /** Clear the in-memory and/or persistent prompt caches. */
3885
+ clearPromptCache (options?: ClearPromptCacheOptions): void
3886
+ /** Create a text or chat prompt and its first version. */
3887
+ createPrompt (
3888
+ promptId: string,
3889
+ template: string | PromptTemplateMessage[],
3890
+ options?: CreatePromptOptions
3891
+ ): Promise<PromptResponse>
3892
+ /** Add a text or chat version to an existing prompt. */
3893
+ createPromptVersion (
3894
+ promptId: string,
3895
+ template: string | PromptTemplateMessage[],
3896
+ options?: CreatePromptVersionOptions
3897
+ ): Promise<PromptVersionResponse>
3898
+ /** Update prompt metadata. */
3899
+ updatePrompt (promptId: string, options: UpdatePromptOptions): Promise<PromptResponse>
3900
+ /** Update prompt-version metadata or environment assignments. */
3901
+ updatePromptVersion (
3902
+ promptId: string,
3903
+ version: number,
3904
+ options: UpdatePromptVersionOptions
3905
+ ): Promise<PromptVersionResponse>
3906
+ /** Delete a prompt. */
3907
+ deletePrompt (promptId: string): Promise<DeletedPromptResponse>
3908
+ /** List prompts. */
3909
+ listPrompts (): Promise<PromptResponse[]>
3910
+ /** List versions for a prompt. */
3911
+ listPromptVersions (promptId: string): Promise<PromptVersionResponse[]>
3912
+ }
3913
+
3914
+ interface PromptTemplateMessage {
3915
+ role: string,
3916
+ content: string
3917
+ }
3918
+
3919
+ type PromptFallbackValue =
3920
+ | string
3921
+ | PromptTemplateMessage[]
3922
+ | { template: string | PromptTemplateMessage[], version?: string }
3923
+ type PromptFallback = PromptFallbackValue | (() => PromptFallbackValue)
3924
+
3925
+ interface GetPromptOptions {
3926
+ version?: number,
3927
+ fallback?: PromptFallback,
3928
+ targetingKey?: string,
3929
+ attributes?: Record<string, string | number | boolean>
3930
+ }
3931
+
3932
+ interface ClearPromptCacheOptions {
3933
+ hot?: boolean,
3934
+ warm?: boolean
3935
+ }
3936
+
3937
+ interface CreatePromptOptions {
3938
+ title?: string,
3939
+ description?: string,
3940
+ userVersion?: string,
3941
+ envIds?: string[]
3942
+ }
3943
+
3944
+ interface CreatePromptVersionOptions {
3945
+ description?: string,
3946
+ userVersion?: string,
3947
+ envIds?: string[]
3948
+ }
3949
+
3950
+ interface UpdatePromptOptions {
3951
+ title?: string,
3952
+ description?: string
3953
+ }
3954
+
3955
+ interface UpdatePromptVersionOptions {
3956
+ description?: string,
3957
+ envIds?: string[]
3958
+ }
3959
+
3960
+ interface ManagedPrompt {
3961
+ readonly id: string,
3962
+ readonly version: string,
3963
+ readonly source: 'registry' | 'cache' | 'fallback' | 'ff' | 'resolve',
3964
+ readonly template: string | ReadonlyArray<Readonly<PromptTemplateMessage>>,
3965
+ readonly promptUuid?: string,
3966
+ readonly promptVersionUuid?: string,
3967
+ format (variables?: Record<string, unknown>): string | PromptTemplateMessage[]
3968
+ toAnnotation (variables?: Record<string, unknown>): Prompt
3969
+ }
3970
+
3971
+ interface PromptResponse {
3972
+ id?: string,
3973
+ prompt_id?: string,
3974
+ title?: string,
3975
+ description?: string,
3976
+ created_at?: string,
3977
+ source?: string,
3978
+ num_versions?: number,
3979
+ in_registry?: boolean,
3980
+ created_from?: string,
3981
+ author?: string,
3982
+ ml_app?: string,
3983
+ ml_apps?: string[],
3984
+ last_version_created_at?: string,
3985
+ extracted_from?: string
3986
+ }
3987
+
3988
+ interface PromptVersionResponse {
3989
+ id?: string,
3990
+ prompt_uuid?: string,
3991
+ prompt_id?: string,
3992
+ template?: string | PromptTemplateMessage[],
3993
+ version?: number,
3994
+ user_version?: string,
3995
+ created_at?: string,
3996
+ version_created_at?: string,
3997
+ author?: string,
3998
+ description?: string,
3999
+ ml_app?: string
4000
+ }
4001
+
4002
+ interface DeletedPromptResponse {
4003
+ id?: string,
4004
+ prompt_id?: string,
4005
+ deleted_at?: string
4006
+ }
4007
+
3849
4008
  /** JSON-serializable value accepted by LLMObs Experiments. */
3850
4009
  type JSONType = string | number | boolean | null | JSONType[] | { [key: string]: JSONType }
3851
4010
 
@@ -4449,6 +4608,12 @@ declare namespace tracer {
4449
4608
  * A template string or chat message template list.
4450
4609
  */
4451
4610
  template?: string | Message[]
4611
+
4612
+ /** Internal Datadog prompt identity. */
4613
+ promptUuid?: string,
4614
+
4615
+ /** Internal Datadog prompt-version identity. */
4616
+ promptVersionUuid?: string
4452
4617
  }
4453
4618
 
4454
4619
  interface ToolDefinition {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dd-trace",
3
- "version": "6.16.0",
3
+ "version": "6.17.0",
4
4
  "description": "Datadog APM tracing client for JavaScript",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -28,6 +28,7 @@
28
28
  "lint:inspect": "npx @eslint/config-inspector@latest",
29
29
  "lint:codeowners": "codeowners-audit",
30
30
  "lint:editorconfig": "docker build -q -t ec .github/editorconfig-checker && docker run --rm --volume=$PWD:/check ec",
31
+ "release:merge-proposal": "node scripts/release/merge-proposal.js",
31
32
  "release:proposal": "node scripts/release/proposal",
32
33
  "services": "node ./scripts/install_plugin_modules && node packages/dd-trace/test/setup/services",
33
34
  "test": "echo '\nError: The root \"npm test\" command is intentionally disabled.\n\nInstead, run specific test suites:\n - npm run test:trace:core\n - npm run test:appsec\n - etc.\n\nOr run individual test files:\n npx mocha path/to/test.spec.js\n\nSee CONTRIBUTING.md (Testing section) for more details.\n' && exit 1",
@@ -105,8 +106,8 @@
105
106
  "test:integration:selenium": "mocha --timeout 60000 \"integration-tests/selenium/*.spec.js\"",
106
107
  "test:integration:selenium:coverage": "node ./integration-tests/coverage/run-suite.js --timeout 60000 \"integration-tests/selenium/*.spec.js\"",
107
108
  "test:integration:test-optimization:helpers": "mocha \"integration-tests/cypress/*dependencies.spec.js\" \"integration-tests/jest/*dependencies.spec.js\" \"integration-tests/playwright/version*.spec.js\"",
108
- "test:integration:webdriverio": "mocha --timeout 60000 \"integration-tests/webdriverio/*.spec.js\"",
109
- "test:integration:webdriverio:coverage": "node ./integration-tests/coverage/run-suite.js --timeout 60000 \"integration-tests/webdriverio/*.spec.js\"",
109
+ "test:integration:webdriverio": "mocha --timeout 60000 \"integration-tests/webdriverio/${SPEC:-*}.spec.js\"",
110
+ "test:integration:webdriverio:coverage": "node ./integration-tests/coverage/run-suite.js --timeout 60000 \"integration-tests/webdriverio/${SPEC:-*}.spec.js\"",
110
111
  "test:integration:vitest": "mocha --timeout 60000 \"integration-tests/vitest/${SPEC:-vitest*}.spec.js\"",
111
112
  "test:integration:vitest:coverage": "node ./integration-tests/coverage/run-suite.js --timeout 60000 \"integration-tests/vitest/${SPEC:-vitest*}.spec.js\"",
112
113
  "test:integration:testopt": "mocha --timeout 120000 \"integration-tests/ci-visibility/*.spec.js\"",
@@ -192,7 +193,7 @@
192
193
  "@datadog/native-appsec": "11.0.2",
193
194
  "@datadog/native-iast-taint-tracking": "4.2.1",
194
195
  "@datadog/native-metrics": "4.0.0",
195
- "@datadog/pprof": "5.18.1",
196
+ "@datadog/pprof": "5.19.0",
196
197
  "@datadog/wasm-js-rewriter": "5.0.4",
197
198
  "@opentelemetry/api": ">=1.0.0 <1.10.0",
198
199
  "@opentelemetry/api-logs": "<1.0.0",
@@ -201,11 +202,11 @@
201
202
  "devDependencies": {
202
203
  "@actions/core": "^3.0.1",
203
204
  "@actions/github": "^9.1.1",
204
- "@babel/helpers": "^8.0.0",
205
+ "@babel/helpers": "^8.0.5",
205
206
  "@eslint/eslintrc": "^3.3.7",
206
207
  "@eslint/js": "^10.0.1",
207
208
  "@eslint/plugin-kit": "^0.7.3",
208
- "@datadog/openfeature-node-server": "2.2.0",
209
+ "@datadog/openfeature-node-server": "2.3.0",
209
210
  "@msgpack/msgpack": "^3.1.3",
210
211
  "@openfeature/core": "^1.12.0",
211
212
  "@openfeature/server-sdk": "~1.23.0",
@@ -218,18 +219,18 @@
218
219
  "axios": "^1.20.0",
219
220
  "benchmark": "^2.1.4",
220
221
  "body-parser": "^2.3.0",
221
- "bun": "1.4.0",
222
+ "bun": "1.4.2",
222
223
  "c8": "^12.0.0",
223
224
  "codeowners-audit": "^2.9.0",
224
- "eslint": "^10.9.1",
225
- "eslint-plugin-cypress": "^7.0.1",
225
+ "eslint": "^10.10.0",
226
+ "eslint-plugin-cypress": "^7.0.2",
226
227
  "eslint-plugin-import-x": "^4.16.2",
227
- "eslint-plugin-jsdoc": "^64.3.5",
228
+ "eslint-plugin-jsdoc": "^64.5.2",
228
229
  "eslint-plugin-mocha": "^12.0.2",
229
230
  "eslint-plugin-n": "^18.3.0",
230
231
  "eslint-plugin-promise": "^7.3.0",
231
- "eslint-plugin-regexp": "^3.2.0",
232
- "eslint-plugin-sonarjs": "^4.2.0",
232
+ "eslint-plugin-regexp": "^3.3.0",
233
+ "eslint-plugin-sonarjs": "^4.2.1",
233
234
  "eslint-plugin-unicorn": "^74.0.0",
234
235
  "express": "^5.1.0",
235
236
  "glob": "^10.4.5",
@@ -240,12 +241,12 @@
240
241
  "istanbul-lib-report": "^3.0.0",
241
242
  "istanbul-reports": "^3.0.2",
242
243
  "jsonc-parser": "^3.3.1",
243
- "jszip": "^3.10.1",
244
+ "jszip": "^3.10.2",
244
245
  "minimatch": "^10.2.6",
245
246
  "mocha": "^11.8.0",
246
247
  "mocha-junit-reporter": "^2.2.1",
247
- "mocha-multi-reporters": "^1.5.1",
248
- "multer": "^2.3.0",
248
+ "mocha-multi-reporters": "^1.5.2",
249
+ "multer": "^2.4.0",
249
250
  "nock": "^14.0.17",
250
251
  "node-preload": "^0.2.1",
251
252
  "nyc": "^18.0.0",
@@ -262,7 +263,7 @@
262
263
  "typescript": "^6.0.3",
263
264
  "v8-to-istanbul": "^9.0.0",
264
265
  "workerpool": "^10.0.3",
265
- "yaml": "^2.9.0",
266
+ "yaml": "^2.9.1",
266
267
  "yarn-deduplicate": "^6.0.2"
267
268
  }
268
269
  }
@@ -78,7 +78,6 @@ function isBareSpecifier (specifier) {
78
78
  /**
79
79
  * @param {string} modulePath
80
80
  * @param {string} format
81
- * @returns {string}
82
81
  */
83
82
  function getModuleFormat (modulePath, format) {
84
83
  if (modulePath.endsWith('.mts')) return 'module-typescript'
@@ -287,7 +286,6 @@ async function processModuleWithResolver (
287
286
  * @param {string} fullPathToModule File to analize
288
287
  * @param {string} [modulePackageJsonPath] Path of the package.json
289
288
  * @param {object} [packageJson] The content of the module package.json
290
- * @returns {boolean}
291
289
  */
292
290
  function isESMFile (fullPathToModule, modulePackageJsonPath, packageJson = {}) {
293
291
  if (fullPathToModule.endsWith('.mjs') || fullPathToModule.endsWith('.mts')) return true
@@ -8,6 +8,7 @@ const {
8
8
  } = require('./helpers/instrument')
9
9
 
10
10
  const ch = tracingChannel('apm:aerospike:command')
11
+ const kTracingCallbackCommand = Symbol('datadog.aerospike.tracing_callback_command')
11
12
 
12
13
  function wrapCreateCommand (createCommand) {
13
14
  if (typeof createCommand !== 'function') return createCommand
@@ -17,27 +18,48 @@ function wrapCreateCommand (createCommand) {
17
18
 
18
19
  if (!CommandClass) return CommandClass
19
20
 
21
+ shimmer.wrap(CommandClass.prototype, 'executeWithCallback', wrapExecuteWithCallback)
20
22
  shimmer.wrap(CommandClass.prototype, 'process', wrapProcess)
21
23
 
22
24
  return CommandClass
23
25
  }
24
26
  }
25
27
 
26
- function wrapProcess (process) {
28
+ function wrapExecuteWithCallback (executeWithCallback) {
27
29
  return function (...args) {
28
30
  const cb = args[0]
29
- if (typeof cb !== 'function') return process.apply(this, args)
31
+ if (!ch.start.hasSubscribers || typeof cb !== 'function') return executeWithCallback.apply(this, args)
30
32
 
31
- const ctx = {
32
- commandName: this.constructor.name,
33
- commandArgs: this.args,
34
- clientConfig: this.client.config,
33
+ this[kTracingCallbackCommand] = true
34
+ try {
35
+ return ch.traceCallback(executeWithCallback, 0, getContext(this), this, ...args)
36
+ } finally {
37
+ this[kTracingCallbackCommand] = false
35
38
  }
39
+ }
40
+ }
41
+
42
+ function wrapProcess (process) {
43
+ return function (...args) {
44
+ const cb = args[0]
45
+ if (!ch.start.hasSubscribers || typeof cb !== 'function') return process.apply(this, args)
46
+
47
+ if (this[kTracingCallbackCommand]) return process.apply(this, args)
48
+
49
+ const ctx = getContext(this)
36
50
 
37
51
  return ch.traceCallback(process, -1, ctx, this, ...args)
38
52
  }
39
53
  }
40
54
 
55
+ function getContext (command) {
56
+ return {
57
+ commandName: command.constructor.name,
58
+ commandArgs: command.args,
59
+ clientConfig: command.client.config,
60
+ }
61
+ }
62
+
41
63
  addHook({
42
64
  name: 'aerospike',
43
65
  file: 'lib/commands/command.js',
@@ -70,7 +70,6 @@ const instrumentedProtos = new WeakSet()
70
70
  * observer attaches at most once (a promise settles only once). Instances we don't observe
71
71
  * never set `ON_SETTLE`, so for them the wrappers are a single property read and a passthrough.
72
72
  * @param {object} proto - The DurablePromise prototype (`Object.getPrototypeOf(dp)`).
73
- * @returns {void}
74
73
  */
75
74
  function instrumentDurablePromiseProto (proto) {
76
75
  if (instrumentedProtos.has(proto)) return
@@ -97,7 +96,6 @@ function instrumentDurablePromiseProto (proto) {
97
96
  * @param {object} dp - The returned DurablePromise instance.
98
97
  * @param {(err: unknown) => void} onSettle - Called once with `undefined` on success or the
99
98
  * rejection reason on failure.
100
- * @returns {void}
101
99
  */
102
100
  function observeDurablePromise (dp, onSettle) {
103
101
  if (!dp || typeof dp.then !== 'function') return
@@ -77,7 +77,6 @@ const clientNameCache = new WeakMap()
77
77
 
78
78
  /**
79
79
  * @param {Function} clientCtor
80
- * @returns {string}
81
80
  */
82
81
  function getClientName (clientCtor) {
83
82
  let name = clientNameCache.get(clientCtor)
@@ -93,7 +92,6 @@ const operationCache = new WeakMap()
93
92
 
94
93
  /**
95
94
  * @param {Function} commandCtor
96
- * @returns {string}
97
95
  */
98
96
  function getOperationName (commandCtor) {
99
97
  let operation = operationCache.get(commandCtor)
@@ -353,7 +353,6 @@ function getToolResultContent (chunk, toolUseId) {
353
353
  * @param {SessionContext | null | undefined} sessionCtx
354
354
  * @param {GetLifecycle} getLifecycle
355
355
  * @param {ToolLifecycle} lifecycle
356
- * @returns {number} index in chunks where the next step should start iteration
357
356
  */
358
357
  function processTool (chunks, startIndex, toolUseId, sessionCtx, getLifecycle, lifecycle) {
359
358
  let chunkIndex = startIndex
@@ -412,7 +411,6 @@ function processTool (chunks, startIndex, toolUseId, sessionCtx, getLifecycle, l
412
411
  * @param {StepContext | null | undefined} stepCtx
413
412
  * @param {SessionContext | null | undefined} sessionCtx
414
413
  * @param {GetLifecycle} getLifecycle
415
- * @returns {number} index in chunks where the next step should start iteration
416
414
  */
417
415
  function processStep (
418
416
  chunks,