@depup/dd-trace 5.97.0-depup.0 → 6.5.0-depup.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 (712) hide show
  1. package/LICENSE-3rdparty.csv +89 -104
  2. package/README.electron.md +7 -0
  3. package/README.md +2 -2
  4. package/changes.json +1 -1
  5. package/ci/diagnose.js +2100 -0
  6. package/ci/init.js +46 -5
  7. package/ci/runbook.md +198 -0
  8. package/ci/test-optimization-validation/approval-artifacts.js +143 -0
  9. package/ci/test-optimization-validation/approval.js +299 -0
  10. package/ci/test-optimization-validation/artifact-id.js +20 -0
  11. package/ci/test-optimization-validation/bounded-json.js +121 -0
  12. package/ci/test-optimization-validation/ci-command-candidate.js +83 -0
  13. package/ci/test-optimization-validation/ci-discovery.js +181 -0
  14. package/ci/test-optimization-validation/ci-remediation.js +210 -0
  15. package/ci/test-optimization-validation/cli.js +903 -0
  16. package/ci/test-optimization-validation/command-blocker.js +81 -0
  17. package/ci/test-optimization-validation/command-output-policy.js +206 -0
  18. package/ci/test-optimization-validation/command-runner.js +707 -0
  19. package/ci/test-optimization-validation/command-suitability.js +471 -0
  20. package/ci/test-optimization-validation/executable-approval.js +48 -0
  21. package/ci/test-optimization-validation/executable.js +480 -0
  22. package/ci/test-optimization-validation/generated-file-policy.js +63 -0
  23. package/ci/test-optimization-validation/generated-files.js +351 -0
  24. package/ci/test-optimization-validation/generated-verifier.js +196 -0
  25. package/ci/test-optimization-validation/init-probe-preload.js +163 -0
  26. package/ci/test-optimization-validation/init-probe.js +246 -0
  27. package/ci/test-optimization-validation/late-initialization.js +63 -0
  28. package/ci/test-optimization-validation/local-command.js +163 -0
  29. package/ci/test-optimization-validation/manifest-loader.js +133 -0
  30. package/ci/test-optimization-validation/manifest-scaffold.js +738 -0
  31. package/ci/test-optimization-validation/manifest-schema.js +862 -0
  32. package/ci/test-optimization-validation/offline-fixtures.js +327 -0
  33. package/ci/test-optimization-validation/offline-output.js +406 -0
  34. package/ci/test-optimization-validation/payload-normalizer.js +72 -0
  35. package/ci/test-optimization-validation/plan-writer.js +1120 -0
  36. package/ci/test-optimization-validation/preflight-runner.js +114 -0
  37. package/ci/test-optimization-validation/redaction.js +331 -0
  38. package/ci/test-optimization-validation/report-writer.js +1508 -0
  39. package/ci/test-optimization-validation/safe-files.js +203 -0
  40. package/ci/test-optimization-validation/scenarios/auto-test-retries.js +159 -0
  41. package/ci/test-optimization-validation/scenarios/basic-reporting.js +657 -0
  42. package/ci/test-optimization-validation/scenarios/ci-wiring.js +780 -0
  43. package/ci/test-optimization-validation/scenarios/early-flake-detection.js +141 -0
  44. package/ci/test-optimization-validation/scenarios/helpers.js +539 -0
  45. package/ci/test-optimization-validation/scenarios/test-management.js +218 -0
  46. package/ci/test-optimization-validation/setup-runner.js +97 -0
  47. package/ci/test-optimization-validation/static-diagnosis.js +159 -0
  48. package/ci/test-optimization-validation/test-output.js +129 -0
  49. package/ci/test-optimization-validation-manifest.schema.json +1 -0
  50. package/ci/validate-test-optimization.js +3 -0
  51. package/ci/vitest-no-worker-init-setup.mjs +430 -0
  52. package/ext/exporters.js +2 -0
  53. package/ext/tags.js +3 -0
  54. package/index.d.ts +436 -252
  55. package/index.electron.js +3 -0
  56. package/init.js +18 -0
  57. package/initialize.mjs +10 -9
  58. package/loader-hook.mjs +170 -53
  59. package/openfeature.d.ts +1 -0
  60. package/openfeature.js +4 -0
  61. package/package.json +118 -80
  62. package/packages/datadog-core/src/storage.js +47 -48
  63. package/packages/datadog-esbuild/index.js +32 -1
  64. package/packages/datadog-esbuild/src/utils.js +46 -3
  65. package/packages/datadog-instrumentations/src/aerospike.js +3 -3
  66. package/packages/datadog-instrumentations/src/ai.js +137 -76
  67. package/packages/datadog-instrumentations/src/amqplib.js +6 -7
  68. package/packages/datadog-instrumentations/src/anthropic.js +10 -10
  69. package/packages/datadog-instrumentations/src/apollo-server-core.js +3 -3
  70. package/packages/datadog-instrumentations/src/apollo-server.js +10 -18
  71. package/packages/datadog-instrumentations/src/avsc.js +6 -6
  72. package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js-context-methods.js +18 -0
  73. package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js.js +111 -0
  74. package/packages/datadog-instrumentations/src/aws-sdk.js +172 -72
  75. package/packages/datadog-instrumentations/src/azure-cosmos.js +7 -0
  76. package/packages/datadog-instrumentations/src/azure-durable-functions.js +8 -8
  77. package/packages/datadog-instrumentations/src/azure-functions.js +3 -0
  78. package/packages/datadog-instrumentations/src/bluebird.js +2 -2
  79. package/packages/datadog-instrumentations/src/body-parser.js +5 -2
  80. package/packages/datadog-instrumentations/src/cassandra-driver.js +12 -9
  81. package/packages/datadog-instrumentations/src/child_process.js +16 -16
  82. package/packages/datadog-instrumentations/src/claude-agent-sdk.js +587 -0
  83. package/packages/datadog-instrumentations/src/confluentinc-kafka-javascript.js +41 -24
  84. package/packages/datadog-instrumentations/src/connect.js +14 -12
  85. package/packages/datadog-instrumentations/src/cookie-parser.js +5 -4
  86. package/packages/datadog-instrumentations/src/cookie.js +9 -3
  87. package/packages/datadog-instrumentations/src/couchbase.js +73 -238
  88. package/packages/datadog-instrumentations/src/crypto.js +49 -4
  89. package/packages/datadog-instrumentations/src/cucumber-worker-threads.js +25 -0
  90. package/packages/datadog-instrumentations/src/cucumber.js +762 -189
  91. package/packages/datadog-instrumentations/src/cypress-config.js +547 -93
  92. package/packages/datadog-instrumentations/src/cypress.js +5 -3
  93. package/packages/datadog-instrumentations/src/dns.js +60 -59
  94. package/packages/datadog-instrumentations/src/elasticsearch.js +9 -12
  95. package/packages/datadog-instrumentations/src/electron/preload.js +42 -0
  96. package/packages/datadog-instrumentations/src/electron.js +240 -0
  97. package/packages/datadog-instrumentations/src/express-mongo-sanitize.js +11 -9
  98. package/packages/datadog-instrumentations/src/express-session.js +14 -13
  99. package/packages/datadog-instrumentations/src/express.js +52 -30
  100. package/packages/datadog-instrumentations/src/fastify.js +166 -87
  101. package/packages/datadog-instrumentations/src/fetch.js +5 -5
  102. package/packages/datadog-instrumentations/src/fs.js +22 -20
  103. package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +5 -7
  104. package/packages/datadog-instrumentations/src/google-genai.js +4 -4
  105. package/packages/datadog-instrumentations/src/graphql.js +26 -362
  106. package/packages/datadog-instrumentations/src/grpc/client.js +48 -32
  107. package/packages/datadog-instrumentations/src/grpc/server.js +20 -2
  108. package/packages/datadog-instrumentations/src/hapi.js +2 -2
  109. package/packages/datadog-instrumentations/src/helpers/callback-instrumentor.js +74 -0
  110. package/packages/datadog-instrumentations/src/helpers/check-require-cache.js +85 -9
  111. package/packages/datadog-instrumentations/src/helpers/hook.js +31 -7
  112. package/packages/datadog-instrumentations/src/helpers/hooks.js +12 -0
  113. package/packages/datadog-instrumentations/src/helpers/instrument.js +36 -3
  114. package/packages/datadog-instrumentations/src/helpers/kafka.js +58 -0
  115. package/packages/datadog-instrumentations/src/helpers/optional-peer-bundler.js +65 -0
  116. package/packages/datadog-instrumentations/src/helpers/promise-instrumentor.js +42 -0
  117. package/packages/datadog-instrumentations/src/helpers/promise.js +2 -2
  118. package/packages/datadog-instrumentations/src/helpers/register.js +7 -5
  119. package/packages/datadog-instrumentations/src/helpers/rewriter/compiler.js +13 -5
  120. package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +24 -7
  121. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/ai.js +6 -6
  122. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/aws-durable-execution-sdk-js.js +31 -0
  123. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/azure-cosmos.js +50 -0
  124. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/claude-agent-sdk.js +17 -0
  125. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql.js +201 -0
  126. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +7 -0
  127. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/langgraph.js +4 -2
  128. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/mercurius.js +31 -0
  129. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/modelcontextprotocol-sdk.js +35 -0
  130. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/playwright.js +111 -0
  131. package/packages/datadog-instrumentations/src/helpers/rewriter/loader.mjs +18 -2
  132. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +49 -224
  133. package/packages/datadog-instrumentations/src/helpers/router-helper.js +8 -8
  134. package/packages/datadog-instrumentations/src/hono.js +71 -9
  135. package/packages/datadog-instrumentations/src/http/client.js +48 -24
  136. package/packages/datadog-instrumentations/src/http/server.js +75 -29
  137. package/packages/datadog-instrumentations/src/http2/client.js +15 -12
  138. package/packages/datadog-instrumentations/src/http2/server.js +156 -23
  139. package/packages/datadog-instrumentations/src/ioredis.js +17 -14
  140. package/packages/datadog-instrumentations/src/iovalkey.js +1 -2
  141. package/packages/datadog-instrumentations/src/jest/bail-reporter.js +42 -0
  142. package/packages/datadog-instrumentations/src/jest/coverage-backfill.js +163 -0
  143. package/packages/datadog-instrumentations/src/jest.js +1809 -401
  144. package/packages/datadog-instrumentations/src/kafkajs.js +284 -170
  145. package/packages/datadog-instrumentations/src/knex.js +17 -17
  146. package/packages/datadog-instrumentations/src/koa.js +15 -14
  147. package/packages/datadog-instrumentations/src/ldapjs.js +5 -5
  148. package/packages/datadog-instrumentations/src/light-my-request.js +2 -2
  149. package/packages/datadog-instrumentations/src/limitd-client.js +4 -4
  150. package/packages/datadog-instrumentations/src/lodash.js +4 -4
  151. package/packages/datadog-instrumentations/src/mariadb.js +18 -16
  152. package/packages/datadog-instrumentations/src/memcached.js +4 -3
  153. package/packages/datadog-instrumentations/src/mercurius.js +11 -0
  154. package/packages/datadog-instrumentations/src/microgateway-core.js +2 -2
  155. package/packages/datadog-instrumentations/src/mocha/common.js +7 -4
  156. package/packages/datadog-instrumentations/src/mocha/main.js +557 -120
  157. package/packages/datadog-instrumentations/src/mocha/utils.js +531 -135
  158. package/packages/datadog-instrumentations/src/mocha/worker.js +27 -9
  159. package/packages/datadog-instrumentations/src/modelcontextprotocol-sdk.js +254 -0
  160. package/packages/datadog-instrumentations/src/mongodb-core.js +43 -31
  161. package/packages/datadog-instrumentations/src/mongodb.js +82 -8
  162. package/packages/datadog-instrumentations/src/mongoose.js +46 -37
  163. package/packages/datadog-instrumentations/src/mquery.js +7 -7
  164. package/packages/datadog-instrumentations/src/multer.js +5 -4
  165. package/packages/datadog-instrumentations/src/mysql.js +17 -17
  166. package/packages/datadog-instrumentations/src/mysql2.js +39 -5
  167. package/packages/datadog-instrumentations/src/nats.js +182 -0
  168. package/packages/datadog-instrumentations/src/net.js +19 -11
  169. package/packages/datadog-instrumentations/src/next.js +68 -10
  170. package/packages/datadog-instrumentations/src/nyc.js +43 -8
  171. package/packages/datadog-instrumentations/src/openai.js +124 -38
  172. package/packages/datadog-instrumentations/src/oracledb.js +12 -7
  173. package/packages/datadog-instrumentations/src/otel-sdk-trace.js +27 -6
  174. package/packages/datadog-instrumentations/src/passport-utils.js +5 -5
  175. package/packages/datadog-instrumentations/src/path-to-regexp.js +44 -0
  176. package/packages/datadog-instrumentations/src/pg.js +58 -25
  177. package/packages/datadog-instrumentations/src/pino.js +25 -41
  178. package/packages/datadog-instrumentations/src/playwright-browser-scripts.js +27 -0
  179. package/packages/datadog-instrumentations/src/playwright.js +1229 -356
  180. package/packages/datadog-instrumentations/src/process.js +3 -0
  181. package/packages/datadog-instrumentations/src/protobufjs.js +16 -16
  182. package/packages/datadog-instrumentations/src/redis.js +28 -15
  183. package/packages/datadog-instrumentations/src/restify.js +6 -5
  184. package/packages/datadog-instrumentations/src/router.js +253 -87
  185. package/packages/datadog-instrumentations/src/selenium.js +53 -28
  186. package/packages/datadog-instrumentations/src/stripe.js +47 -33
  187. package/packages/datadog-instrumentations/src/tedious.js +28 -0
  188. package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +1297 -0
  189. package/packages/datadog-instrumentations/src/vitest-main.js +1590 -0
  190. package/packages/datadog-instrumentations/src/vitest-util.js +251 -0
  191. package/packages/datadog-instrumentations/src/vitest-worker.js +822 -0
  192. package/packages/datadog-instrumentations/src/vitest.js +11 -1262
  193. package/packages/datadog-instrumentations/src/winston.js +4 -4
  194. package/packages/datadog-instrumentations/src/ws.js +9 -8
  195. package/packages/datadog-instrumentations/src/zlib.js +29 -0
  196. package/packages/datadog-plugin-ai/src/index.js +1 -1
  197. package/packages/datadog-plugin-ai/src/tracing.js +66 -3
  198. package/packages/datadog-plugin-ai/src/utils.js +17 -4
  199. package/packages/datadog-plugin-apollo/src/gateway/request.js +1 -21
  200. package/packages/datadog-plugin-avsc/src/schema_iterator.js +3 -3
  201. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/checkpoint.js +31 -0
  202. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/client.js +55 -0
  203. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/context.js +123 -0
  204. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/handler.js +129 -0
  205. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/index.js +19 -0
  206. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/trace-checkpoint.js +224 -0
  207. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/util.js +80 -0
  208. package/packages/datadog-plugin-aws-sdk/src/base.js +86 -50
  209. package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/tracing.js +1 -1
  210. package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +218 -4
  211. package/packages/datadog-plugin-aws-sdk/src/services/cloudwatchlogs.js +1 -1
  212. package/packages/datadog-plugin-aws-sdk/src/services/dynamodb.js +2 -1
  213. package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +59 -14
  214. package/packages/datadog-plugin-aws-sdk/src/services/kinesis.js +174 -75
  215. package/packages/datadog-plugin-aws-sdk/src/services/lambda.js +34 -23
  216. package/packages/datadog-plugin-aws-sdk/src/services/redshift.js +2 -1
  217. package/packages/datadog-plugin-aws-sdk/src/services/s3.js +1 -1
  218. package/packages/datadog-plugin-aws-sdk/src/services/sns.js +26 -26
  219. package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +187 -101
  220. package/packages/datadog-plugin-aws-sdk/src/services/stepfunctions.js +20 -18
  221. package/packages/datadog-plugin-aws-sdk/src/util.js +2 -2
  222. package/packages/datadog-plugin-azure-cosmos/src/index.js +144 -0
  223. package/packages/datadog-plugin-azure-event-hubs/src/producer.js +8 -15
  224. package/packages/datadog-plugin-azure-functions/src/index.js +7 -3
  225. package/packages/datadog-plugin-azure-service-bus/src/producer.js +5 -10
  226. package/packages/datadog-plugin-bullmq/src/consumer.js +5 -4
  227. package/packages/datadog-plugin-bullmq/src/filter.js +35 -0
  228. package/packages/datadog-plugin-bullmq/src/producer.js +121 -33
  229. package/packages/datadog-plugin-bunyan/src/index.js +28 -0
  230. package/packages/datadog-plugin-child_process/src/index.js +13 -2
  231. package/packages/datadog-plugin-child_process/src/scrub-cmd-params.js +6 -6
  232. package/packages/datadog-plugin-claude-agent-sdk/src/index.js +31 -0
  233. package/packages/datadog-plugin-claude-agent-sdk/src/tracing.js +107 -0
  234. package/packages/datadog-plugin-claude-agent-sdk/src/util.js +15 -0
  235. package/packages/datadog-plugin-couchbase/src/index.js +58 -52
  236. package/packages/datadog-plugin-cucumber/src/index.js +47 -29
  237. package/packages/datadog-plugin-cypress/src/cypress-plugin.js +929 -98
  238. package/packages/datadog-plugin-cypress/src/index.js +109 -2
  239. package/packages/datadog-plugin-cypress/src/plugin.js +6 -14
  240. package/packages/datadog-plugin-cypress/src/source-map-utils.js +48 -1
  241. package/packages/datadog-plugin-cypress/src/support.js +272 -51
  242. package/packages/datadog-plugin-dd-trace-api/src/index.js +1 -1
  243. package/packages/datadog-plugin-dns/src/lookup.js +8 -6
  244. package/packages/datadog-plugin-elasticsearch/src/index.js +28 -8
  245. package/packages/datadog-plugin-electron/src/index.js +17 -0
  246. package/packages/datadog-plugin-electron/src/ipc.js +143 -0
  247. package/packages/datadog-plugin-electron/src/net.js +82 -0
  248. package/packages/datadog-plugin-express/src/code_origin.js +1 -1
  249. package/packages/datadog-plugin-fastify/src/code_origin.js +1 -1
  250. package/packages/datadog-plugin-fs/src/index.js +2 -1
  251. package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +2 -5
  252. package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +27 -18
  253. package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-push-subscription.js +5 -8
  254. package/packages/datadog-plugin-graphql/src/execute.js +748 -34
  255. package/packages/datadog-plugin-graphql/src/index.js +43 -9
  256. package/packages/datadog-plugin-graphql/src/parse.js +45 -4
  257. package/packages/datadog-plugin-graphql/src/request.js +135 -0
  258. package/packages/datadog-plugin-graphql/src/tools/signature.js +32 -7
  259. package/packages/datadog-plugin-graphql/src/tools/transforms.js +118 -100
  260. package/packages/datadog-plugin-graphql/src/utils.js +261 -3
  261. package/packages/datadog-plugin-graphql/src/validate.js +54 -8
  262. package/packages/datadog-plugin-grpc/src/client.js +7 -8
  263. package/packages/datadog-plugin-grpc/src/server.js +1 -1
  264. package/packages/datadog-plugin-grpc/src/util.js +57 -22
  265. package/packages/datadog-plugin-http/src/client.js +12 -14
  266. package/packages/datadog-plugin-http/src/index.js +6 -8
  267. package/packages/datadog-plugin-http/src/server.js +63 -20
  268. package/packages/datadog-plugin-http2/src/client.js +7 -4
  269. package/packages/datadog-plugin-http2/src/server.js +48 -8
  270. package/packages/datadog-plugin-jest/src/index.js +133 -67
  271. package/packages/datadog-plugin-jest/src/util.js +37 -16
  272. package/packages/datadog-plugin-kafkajs/src/batch-consumer.js +1 -1
  273. package/packages/datadog-plugin-kafkajs/src/consumer.js +2 -9
  274. package/packages/datadog-plugin-kafkajs/src/producer.js +37 -8
  275. package/packages/datadog-plugin-langchain/src/handlers/embedding.js +2 -1
  276. package/packages/datadog-plugin-langchain/src/handlers/language_models.js +2 -1
  277. package/packages/datadog-plugin-langchain/src/tokens.js +2 -2
  278. package/packages/datadog-plugin-langgraph/src/stream.js +1 -1
  279. package/packages/datadog-plugin-memcached/src/index.js +1 -1
  280. package/packages/datadog-plugin-mocha/src/index.js +66 -20
  281. package/packages/datadog-plugin-modelcontextprotocol-sdk/src/index.js +24 -0
  282. package/packages/datadog-plugin-modelcontextprotocol-sdk/src/tracing.js +173 -0
  283. package/packages/datadog-plugin-modelcontextprotocol-sdk/src/utils.js +30 -0
  284. package/packages/datadog-plugin-mongodb-core/src/bulk-write.js +43 -0
  285. package/packages/datadog-plugin-mongodb-core/src/index.js +8 -206
  286. package/packages/datadog-plugin-mongodb-core/src/query.js +452 -0
  287. package/packages/datadog-plugin-mysql/src/index.js +9 -4
  288. package/packages/datadog-plugin-nats/src/consumer.js +43 -0
  289. package/packages/datadog-plugin-nats/src/index.js +20 -0
  290. package/packages/datadog-plugin-nats/src/producer.js +62 -0
  291. package/packages/datadog-plugin-nats/src/util.js +33 -0
  292. package/packages/datadog-plugin-next/src/index.js +12 -4
  293. package/packages/datadog-plugin-openai/src/services.js +4 -3
  294. package/packages/datadog-plugin-openai/src/tracing.js +27 -25
  295. package/packages/datadog-plugin-oracledb/src/index.js +13 -2
  296. package/packages/datadog-plugin-pg/src/index.js +13 -3
  297. package/packages/datadog-plugin-pino/src/index.js +42 -0
  298. package/packages/datadog-plugin-playwright/src/index.js +195 -72
  299. package/packages/datadog-plugin-protobufjs/src/schema_iterator.js +3 -3
  300. package/packages/datadog-plugin-redis/src/index.js +54 -25
  301. package/packages/datadog-plugin-rhea/src/producer.js +1 -1
  302. package/packages/datadog-plugin-router/src/index.js +55 -44
  303. package/packages/datadog-plugin-selenium/src/index.js +5 -36
  304. package/packages/datadog-plugin-tedious/src/index.js +1 -1
  305. package/packages/datadog-plugin-undici/src/index.js +24 -2
  306. package/packages/datadog-plugin-vitest/src/index.js +160 -90
  307. package/packages/datadog-plugin-winston/src/index.js +30 -0
  308. package/packages/datadog-plugin-ws/src/close.js +5 -2
  309. package/packages/datadog-plugin-ws/src/producer.js +4 -1
  310. package/packages/datadog-plugin-ws/src/receiver.js +4 -2
  311. package/packages/datadog-plugin-ws/src/server.js +2 -1
  312. package/packages/datadog-shimmer/src/shimmer.js +101 -39
  313. package/packages/datadog-webpack/index.js +17 -1
  314. package/packages/datadog-webpack/src/optional-peer-loader.js +17 -0
  315. package/packages/dd-trace/index.electron.js +3 -0
  316. package/packages/dd-trace/index.js +2 -36
  317. package/packages/dd-trace/src/aiguard/channels.js +7 -0
  318. package/packages/dd-trace/src/aiguard/index.js +16 -34
  319. package/packages/dd-trace/src/aiguard/integrations/evaluate.js +46 -0
  320. package/packages/dd-trace/src/aiguard/integrations/index.js +34 -0
  321. package/packages/dd-trace/src/aiguard/integrations/openai.js +80 -0
  322. package/packages/dd-trace/src/aiguard/integrations/vercel-ai.js +92 -0
  323. package/packages/dd-trace/src/aiguard/messages/openai.js +382 -0
  324. package/packages/{datadog-instrumentations/src/helpers/ai-messages.js → dd-trace/src/aiguard/messages/vercel-ai.js} +30 -27
  325. package/packages/dd-trace/src/aiguard/sdk.js +148 -55
  326. package/packages/dd-trace/src/aiguard/tags.js +26 -10
  327. package/packages/dd-trace/src/appsec/api_security/index.js +55 -0
  328. package/packages/dd-trace/src/appsec/api_security/sampler.js +147 -0
  329. package/packages/dd-trace/src/appsec/blocked_templates.js +4 -3
  330. package/packages/dd-trace/src/appsec/blocking.js +82 -42
  331. package/packages/dd-trace/src/appsec/channels.js +5 -1
  332. package/packages/dd-trace/src/appsec/downstream_requests.js +116 -62
  333. package/packages/dd-trace/src/appsec/graphql.js +20 -17
  334. package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-password-rules.js +1 -1
  335. package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-secret-rules.js +81 -81
  336. package/packages/dd-trace/src/appsec/iast/analyzers/nosql-injection-mongodb-analyzer.js +23 -23
  337. package/packages/dd-trace/src/appsec/iast/index.js +3 -2
  338. package/packages/dd-trace/src/appsec/iast/security-controls/index.js +4 -4
  339. package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +2 -2
  340. package/packages/dd-trace/src/appsec/iast/taint-tracking/plugins/kafka.js +2 -2
  341. package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +4 -4
  342. package/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js +2 -2
  343. package/packages/dd-trace/src/appsec/iast/telemetry/index.js +2 -1
  344. package/packages/dd-trace/src/appsec/iast/telemetry/span-tags.js +3 -1
  345. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/ldap-sensitive-analyzer.js +54 -12
  346. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/url-sensitive-analyzer.js +5 -1
  347. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +31 -4
  348. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/index.js +1 -3
  349. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +83 -48
  350. package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +1 -1
  351. package/packages/dd-trace/src/appsec/index.js +65 -47
  352. package/packages/dd-trace/src/appsec/lambda.js +135 -0
  353. package/packages/dd-trace/src/appsec/rasp/command_injection.js +4 -5
  354. package/packages/dd-trace/src/appsec/rasp/lfi.js +8 -4
  355. package/packages/dd-trace/src/appsec/rasp/sql_injection.js +5 -10
  356. package/packages/dd-trace/src/appsec/rasp/ssrf.js +26 -18
  357. package/packages/dd-trace/src/appsec/recommended.json +2438 -13
  358. package/packages/dd-trace/src/appsec/reporter.js +87 -28
  359. package/packages/dd-trace/src/appsec/rule_manager.js +4 -2
  360. package/packages/dd-trace/src/appsec/sdk/set_user.js +1 -1
  361. package/packages/dd-trace/src/appsec/sdk/track_event.js +5 -5
  362. package/packages/dd-trace/src/appsec/sdk/user_blocking.js +7 -11
  363. package/packages/dd-trace/src/appsec/sdk/utils.js +5 -3
  364. package/packages/dd-trace/src/appsec/store.js +50 -0
  365. package/packages/dd-trace/src/appsec/telemetry/api_security.js +34 -0
  366. package/packages/dd-trace/src/appsec/telemetry/index.js +27 -1
  367. package/packages/dd-trace/src/appsec/user_tracking.js +5 -4
  368. package/packages/dd-trace/src/appsec/waf/index.js +19 -9
  369. package/packages/dd-trace/src/appsec/waf/waf_context_wrapper.js +35 -20
  370. package/packages/dd-trace/src/appsec/waf/waf_manager.js +1 -1
  371. package/packages/dd-trace/src/azure_metadata.js +19 -7
  372. package/packages/dd-trace/src/baggage.js +32 -13
  373. package/packages/dd-trace/src/bootstrap.js +39 -0
  374. package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/index.js +123 -33
  375. package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +122 -24
  376. package/packages/dd-trace/src/ci-visibility/early-flake-detection/get-known-tests.js +22 -7
  377. package/packages/dd-trace/src/ci-visibility/exporters/agent-proxy/index.js +5 -2
  378. package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +2 -2
  379. package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +2 -2
  380. package/packages/dd-trace/src/ci-visibility/exporters/agentless/index.js +6 -2
  381. package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +2 -2
  382. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/index.js +160 -0
  383. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/msgpack-to-json.js +288 -0
  384. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/payload-projection.js +84 -0
  385. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/sink.js +369 -0
  386. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/writer.js +60 -0
  387. package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +188 -27
  388. package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +3 -4
  389. package/packages/dd-trace/src/ci-visibility/exporters/test-worker/index.js +28 -10
  390. package/packages/dd-trace/src/ci-visibility/exporters/test-worker/writer.js +22 -0
  391. package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +110 -22
  392. package/packages/dd-trace/src/ci-visibility/lage.js +2 -1
  393. package/packages/dd-trace/src/ci-visibility/log-submission/log-submission-plugin.js +4 -5
  394. package/packages/dd-trace/src/ci-visibility/requests/fs-cache.js +4 -5
  395. package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +73 -55
  396. package/packages/dd-trace/src/ci-visibility/requests/request.js +14 -50
  397. package/packages/dd-trace/src/ci-visibility/requests/upload-coverage-report.js +10 -6
  398. package/packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js +156 -0
  399. package/packages/dd-trace/src/ci-visibility/rum.js +7 -0
  400. package/packages/dd-trace/src/ci-visibility/test-api-manual/test-api-manual-plugin.js +9 -3
  401. package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +24 -6
  402. package/packages/dd-trace/src/ci-visibility/test-optimization-cache.js +70 -6
  403. package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache-schema.js +256 -0
  404. package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache.js +451 -0
  405. package/packages/dd-trace/src/ci-visibility/test-screenshot.js +90 -0
  406. package/packages/dd-trace/src/config/config-types.d.ts +8 -6
  407. package/packages/dd-trace/src/config/defaults.js +71 -44
  408. package/packages/dd-trace/src/config/generated-config-types.d.ts +692 -131
  409. package/packages/dd-trace/src/config/git_properties.js +2 -2
  410. package/packages/dd-trace/src/config/helper.js +140 -33
  411. package/packages/dd-trace/src/config/index.js +127 -131
  412. package/packages/dd-trace/src/config/major-overrides.js +100 -0
  413. package/packages/dd-trace/src/config/normalize-service.js +31 -0
  414. package/packages/dd-trace/src/config/parsers.js +138 -10
  415. package/packages/dd-trace/src/config/remote_config.js +1 -1
  416. package/packages/dd-trace/src/config/supported-configurations.json +460 -203
  417. package/packages/dd-trace/src/constants.js +15 -0
  418. package/packages/dd-trace/src/crashtracking/crashtracker.js +18 -6
  419. package/packages/dd-trace/src/datastreams/checkpointer.js +6 -12
  420. package/packages/dd-trace/src/datastreams/context.js +4 -2
  421. package/packages/dd-trace/src/datastreams/encoding.js +39 -28
  422. package/packages/dd-trace/src/datastreams/index.js +2 -1
  423. package/packages/dd-trace/src/datastreams/manager.js +1 -1
  424. package/packages/dd-trace/src/datastreams/pathway.js +35 -30
  425. package/packages/dd-trace/src/datastreams/processor.js +31 -22
  426. package/packages/dd-trace/src/datastreams/size.js +6 -2
  427. package/packages/dd-trace/src/datastreams/writer.js +15 -6
  428. package/packages/dd-trace/src/debugger/config.js +9 -4
  429. package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +49 -35
  430. package/packages/dd-trace/src/debugger/devtools_client/condition.js +5 -8
  431. package/packages/dd-trace/src/debugger/devtools_client/config.js +3 -2
  432. package/packages/dd-trace/src/debugger/devtools_client/index.js +33 -71
  433. package/packages/dd-trace/src/debugger/devtools_client/probe_sampler.js +83 -0
  434. package/packages/dd-trace/src/debugger/devtools_client/send.js +27 -6
  435. package/packages/dd-trace/src/debugger/devtools_client/snapshot/collector.js +2 -2
  436. package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +5 -2
  437. package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +1 -0
  438. package/packages/dd-trace/src/debugger/devtools_client/source-maps.js +1 -1
  439. package/packages/dd-trace/src/debugger/devtools_client/state.js +3 -1
  440. package/packages/dd-trace/src/debugger/index.js +13 -9
  441. package/packages/dd-trace/src/debugger/probe_sampler.js +112 -0
  442. package/packages/dd-trace/src/debugger/probe_sampler_constants.js +19 -0
  443. package/packages/dd-trace/src/dogstatsd.js +34 -28
  444. package/packages/dd-trace/src/encode/0.4.js +829 -268
  445. package/packages/dd-trace/src/encode/0.5.js +158 -22
  446. package/packages/dd-trace/src/encode/agentless-ci-visibility.js +141 -65
  447. package/packages/dd-trace/src/encode/agentless-json.js +12 -6
  448. package/packages/dd-trace/src/encode/coverage-ci-visibility.js +52 -15
  449. package/packages/dd-trace/src/encode/span-stats.js +19 -16
  450. package/packages/dd-trace/src/encode/tags-processors.js +30 -25
  451. package/packages/dd-trace/src/exporter.js +5 -1
  452. package/packages/dd-trace/src/exporters/agent/index.js +4 -5
  453. package/packages/dd-trace/src/exporters/agent/writer.js +1 -2
  454. package/packages/dd-trace/src/exporters/agentless/index.js +12 -13
  455. package/packages/dd-trace/src/exporters/agentless/intake.js +43 -0
  456. package/packages/dd-trace/src/exporters/agentless/writer.js +12 -11
  457. package/packages/dd-trace/src/exporters/common/agents.js +3 -1
  458. package/packages/dd-trace/src/exporters/common/buffering-exporter.js +3 -3
  459. package/packages/dd-trace/src/exporters/common/client-library-headers.js +21 -0
  460. package/packages/dd-trace/src/exporters/common/request.js +93 -44
  461. package/packages/dd-trace/src/exporters/common/retry.js +104 -0
  462. package/packages/dd-trace/src/exporters/common/url.js +48 -0
  463. package/packages/dd-trace/src/exporters/common/util.js +2 -2
  464. package/packages/dd-trace/src/exporters/common/writer.js +17 -1
  465. package/packages/dd-trace/src/exporters/electron/index.js +49 -0
  466. package/packages/dd-trace/src/exporters/span-stats/index.js +1 -2
  467. package/packages/dd-trace/src/exporters/span-stats/writer.js +1 -3
  468. package/packages/dd-trace/src/external-logger/src/index.js +2 -1
  469. package/packages/dd-trace/src/feature-registry.js +29 -0
  470. package/packages/dd-trace/src/git_metadata.js +68 -0
  471. package/packages/dd-trace/src/git_metadata_tagger.js +13 -5
  472. package/packages/dd-trace/src/guardrails/index.js +11 -6
  473. package/packages/dd-trace/src/guardrails/telemetry.js +40 -3
  474. package/packages/dd-trace/src/heap_snapshots.js +4 -4
  475. package/packages/dd-trace/src/id.js +46 -27
  476. package/packages/dd-trace/src/index.js +7 -8
  477. package/packages/dd-trace/src/lambda/handler-paths.js +52 -0
  478. package/packages/dd-trace/src/lambda/handler.js +2 -6
  479. package/packages/dd-trace/src/lambda/index.js +62 -14
  480. package/packages/dd-trace/src/lambda/runtime/patch.js +21 -46
  481. package/packages/dd-trace/src/llmobs/constants/tags.js +13 -0
  482. package/packages/dd-trace/src/llmobs/experiments/client.js +113 -0
  483. package/packages/dd-trace/src/llmobs/experiments/dataset.js +154 -0
  484. package/packages/dd-trace/src/llmobs/experiments/experiment.js +283 -0
  485. package/packages/dd-trace/src/llmobs/experiments/index.js +152 -0
  486. package/packages/dd-trace/src/llmobs/experiments/noop.js +30 -0
  487. package/packages/dd-trace/src/llmobs/experiments/result.js +34 -0
  488. package/packages/dd-trace/src/llmobs/index.js +37 -7
  489. package/packages/dd-trace/src/llmobs/noop.js +6 -0
  490. package/packages/dd-trace/src/llmobs/plugins/ai/ddTelemetry.js +403 -0
  491. package/packages/dd-trace/src/llmobs/plugins/ai/index.js +8 -395
  492. package/packages/dd-trace/src/llmobs/plugins/ai/util.js +119 -7
  493. package/packages/dd-trace/src/llmobs/plugins/ai/vercelTelemetry.js +380 -0
  494. package/packages/dd-trace/src/llmobs/plugins/{anthropic.js → anthropic/index.js} +32 -79
  495. package/packages/dd-trace/src/llmobs/plugins/anthropic/util.js +109 -0
  496. package/packages/dd-trace/src/llmobs/plugins/base.js +4 -4
  497. package/packages/dd-trace/src/llmobs/plugins/bedrockruntime.js +89 -37
  498. package/packages/dd-trace/src/llmobs/plugins/claude-agent-sdk/index.js +270 -0
  499. package/packages/dd-trace/src/llmobs/plugins/claude-agent-sdk/utils.js +10 -0
  500. package/packages/dd-trace/src/llmobs/plugins/genai/index.js +5 -1
  501. package/packages/dd-trace/src/llmobs/plugins/genai/util.js +81 -16
  502. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chain.js +3 -2
  503. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chat_model.js +3 -2
  504. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/embedding.js +2 -1
  505. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/index.js +1 -50
  506. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/vectorstore.js +2 -1
  507. package/packages/dd-trace/src/llmobs/plugins/langchain/index.js +14 -8
  508. package/packages/dd-trace/src/llmobs/plugins/langchain/messages.js +76 -0
  509. package/packages/dd-trace/src/llmobs/plugins/langgraph/index.js +4 -29
  510. package/packages/dd-trace/src/llmobs/plugins/modelcontextprotocol-sdk/index.js +68 -0
  511. package/packages/dd-trace/src/llmobs/plugins/modelcontextprotocol-sdk/utils.js +57 -0
  512. package/packages/dd-trace/src/llmobs/plugins/openai/constants.js +8 -0
  513. package/packages/dd-trace/src/llmobs/plugins/openai/index.js +68 -64
  514. package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +43 -0
  515. package/packages/dd-trace/src/llmobs/sdk.js +73 -35
  516. package/packages/dd-trace/src/llmobs/span_processor.js +90 -11
  517. package/packages/dd-trace/src/llmobs/tagger.js +197 -4
  518. package/packages/dd-trace/src/llmobs/telemetry.js +33 -2
  519. package/packages/dd-trace/src/llmobs/util.js +234 -9
  520. package/packages/dd-trace/src/llmobs/writers/base.js +11 -5
  521. package/packages/dd-trace/src/llmobs/writers/spans.js +1 -1
  522. package/packages/dd-trace/src/llmobs/writers/util.js +1 -2
  523. package/packages/dd-trace/src/log/index.js +19 -31
  524. package/packages/dd-trace/src/log/writer.js +3 -1
  525. package/packages/dd-trace/src/msgpack/chunk.js +430 -11
  526. package/packages/dd-trace/src/msgpack/index.js +101 -2
  527. package/packages/dd-trace/src/noop/proxy.js +5 -4
  528. package/packages/dd-trace/src/noop/span.js +3 -1
  529. package/packages/dd-trace/src/openfeature/agentless_configuration_source.js +322 -0
  530. package/packages/dd-trace/src/openfeature/configuration_source.js +90 -0
  531. package/packages/dd-trace/src/openfeature/encoding.js +70 -0
  532. package/packages/dd-trace/src/openfeature/eval-metrics-hook.js +103 -0
  533. package/packages/dd-trace/src/openfeature/flagging_provider.js +32 -16
  534. package/packages/dd-trace/src/openfeature/index.js +0 -2
  535. package/packages/dd-trace/src/openfeature/noop.js +41 -64
  536. package/packages/dd-trace/src/openfeature/register.js +35 -0
  537. package/packages/dd-trace/src/openfeature/remote_config.js +16 -14
  538. package/packages/dd-trace/src/openfeature/require-provider.js +18 -0
  539. package/packages/dd-trace/src/openfeature/span-enrichment-hook.js +143 -0
  540. package/packages/dd-trace/src/openfeature/span-enrichment.js +149 -0
  541. package/packages/dd-trace/src/openfeature/writers/base.js +3 -11
  542. package/packages/dd-trace/src/openfeature/writers/exposures.js +82 -70
  543. package/packages/dd-trace/src/openfeature/writers/util.js +1 -2
  544. package/packages/dd-trace/src/opentelemetry/active-span-proxy.js +42 -0
  545. package/packages/dd-trace/src/opentelemetry/bridge-span-base.js +107 -0
  546. package/packages/dd-trace/src/opentelemetry/context_manager.js +27 -13
  547. package/packages/dd-trace/src/opentelemetry/logs/index.js +6 -6
  548. package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +3 -2
  549. package/packages/dd-trace/src/opentelemetry/metrics/index.js +61 -12
  550. package/packages/dd-trace/src/opentelemetry/metrics/instruments.js +28 -14
  551. package/packages/dd-trace/src/opentelemetry/metrics/meter.js +7 -10
  552. package/packages/dd-trace/src/opentelemetry/metrics/otlp_http_metric_exporter.js +3 -2
  553. package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_exporter.js +40 -0
  554. package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_transformer.js +169 -0
  555. package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +99 -5
  556. package/packages/dd-trace/src/opentelemetry/metrics/time.js +19 -0
  557. package/packages/dd-trace/src/opentelemetry/otlp/common.proto +2 -2
  558. package/packages/dd-trace/src/opentelemetry/otlp/logs.proto +1 -1
  559. package/packages/dd-trace/src/opentelemetry/otlp/logs_service.proto +1 -1
  560. package/packages/dd-trace/src/opentelemetry/otlp/metrics.proto +1 -1
  561. package/packages/dd-trace/src/opentelemetry/otlp/metrics_service.proto +1 -1
  562. package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +56 -82
  563. package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +1 -2
  564. package/packages/dd-trace/src/opentelemetry/otlp/protobuf_loader.js +14 -2
  565. package/packages/dd-trace/src/opentelemetry/otlp/trace.proto +358 -0
  566. package/packages/dd-trace/src/opentelemetry/otlp/trace_service.proto +78 -0
  567. package/packages/dd-trace/src/opentelemetry/span-ending-hook.js +10 -0
  568. package/packages/dd-trace/src/opentelemetry/span-helpers.js +325 -0
  569. package/packages/dd-trace/src/opentelemetry/span.js +64 -109
  570. package/packages/dd-trace/src/opentelemetry/span_context.js +1 -0
  571. package/packages/dd-trace/src/opentelemetry/span_processor.js +7 -5
  572. package/packages/dd-trace/src/opentelemetry/trace/index.js +75 -0
  573. package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +75 -0
  574. package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +375 -0
  575. package/packages/dd-trace/src/opentelemetry/tracer.js +20 -69
  576. package/packages/dd-trace/src/opentelemetry/tracer_provider.js +33 -17
  577. package/packages/dd-trace/src/opentracing/propagation/log.js +28 -8
  578. package/packages/dd-trace/src/opentracing/propagation/text_map.js +278 -148
  579. package/packages/dd-trace/src/opentracing/propagation/text_map_dsm.js +11 -11
  580. package/packages/dd-trace/src/opentracing/propagation/tracestate.js +98 -32
  581. package/packages/dd-trace/src/opentracing/span.js +127 -73
  582. package/packages/dd-trace/src/opentracing/span_context.js +68 -3
  583. package/packages/dd-trace/src/opentracing/tracer.js +46 -19
  584. package/packages/dd-trace/src/payload-tagging/config/index.js +2 -2
  585. package/packages/dd-trace/src/plugin_manager.js +36 -14
  586. package/packages/dd-trace/src/plugins/apollo.js +3 -1
  587. package/packages/dd-trace/src/plugins/ci_plugin.js +407 -91
  588. package/packages/dd-trace/src/plugins/database.js +61 -18
  589. package/packages/dd-trace/src/plugins/index.js +14 -0
  590. package/packages/dd-trace/src/plugins/log_injection.js +56 -0
  591. package/packages/dd-trace/src/plugins/log_plugin.js +4 -44
  592. package/packages/dd-trace/src/plugins/outbound.js +1 -1
  593. package/packages/dd-trace/src/plugins/plugin.js +19 -28
  594. package/packages/dd-trace/src/plugins/storage.js +2 -2
  595. package/packages/dd-trace/src/plugins/tracing.js +70 -13
  596. package/packages/dd-trace/src/plugins/util/ci.js +127 -40
  597. package/packages/dd-trace/src/plugins/util/git-cache.js +23 -23
  598. package/packages/dd-trace/src/plugins/util/git.js +6 -3
  599. package/packages/dd-trace/src/plugins/util/http-otel-semantics.js +276 -0
  600. package/packages/dd-trace/src/plugins/util/inferred_proxy.js +29 -5
  601. package/packages/dd-trace/src/plugins/util/llm.js +6 -1
  602. package/packages/dd-trace/src/plugins/util/stacktrace.js +2 -2
  603. package/packages/dd-trace/src/plugins/util/test.js +950 -69
  604. package/packages/dd-trace/src/plugins/util/url.js +71 -5
  605. package/packages/dd-trace/src/plugins/util/user-provided-git.js +18 -16
  606. package/packages/dd-trace/src/plugins/util/web.js +116 -180
  607. package/packages/dd-trace/src/priority_sampler.js +12 -21
  608. package/packages/dd-trace/src/profiling/config.js +132 -212
  609. package/packages/dd-trace/src/profiling/constants.js +4 -7
  610. package/packages/dd-trace/src/profiling/exporter_cli.js +10 -10
  611. package/packages/dd-trace/src/profiling/exporters/agent.js +61 -28
  612. package/packages/dd-trace/src/profiling/exporters/event_serializer.js +45 -14
  613. package/packages/dd-trace/src/profiling/exporters/file.js +16 -5
  614. package/packages/dd-trace/src/profiling/oom.js +71 -0
  615. package/packages/dd-trace/src/profiling/profiler.js +84 -105
  616. package/packages/dd-trace/src/profiling/profilers/event_plugins/crypto.js +32 -0
  617. package/packages/dd-trace/src/profiling/profilers/event_plugins/zlib.js +19 -0
  618. package/packages/dd-trace/src/profiling/profilers/events.js +57 -13
  619. package/packages/dd-trace/src/profiling/profilers/space.js +27 -16
  620. package/packages/dd-trace/src/profiling/profilers/wall.js +49 -35
  621. package/packages/dd-trace/src/profiling/ssi-heuristics.js +3 -3
  622. package/packages/dd-trace/src/propagation-hash/index.js +1 -1
  623. package/packages/dd-trace/src/proxy.js +128 -37
  624. package/packages/dd-trace/src/rate_limiter.js +1 -1
  625. package/packages/dd-trace/src/remote_config/index.js +6 -5
  626. package/packages/dd-trace/src/remote_config/scheduler.js +1 -1
  627. package/packages/dd-trace/src/ritm.js +6 -3
  628. package/packages/dd-trace/src/runtime_metrics/client.js +30 -0
  629. package/packages/dd-trace/src/runtime_metrics/index.js +14 -4
  630. package/packages/dd-trace/src/runtime_metrics/otlp_runtime_metrics.js +284 -0
  631. package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +42 -41
  632. package/packages/dd-trace/src/sampling_rule.js +7 -7
  633. package/packages/dd-trace/src/scope.js +10 -15
  634. package/packages/dd-trace/src/serverless.js +6 -7
  635. package/packages/dd-trace/src/service-naming/extra-services.js +14 -0
  636. package/packages/dd-trace/src/service-naming/index.js +1 -1
  637. package/packages/dd-trace/src/service-naming/schemas/definition.js +4 -1
  638. package/packages/dd-trace/src/service-naming/schemas/util.js +48 -3
  639. package/packages/dd-trace/src/service-naming/schemas/v0/graphql.js +6 -0
  640. package/packages/dd-trace/src/service-naming/schemas/v0/messaging.js +61 -2
  641. package/packages/dd-trace/src/service-naming/schemas/v0/serverless.js +12 -0
  642. package/packages/dd-trace/src/service-naming/schemas/v0/storage.js +60 -0
  643. package/packages/dd-trace/src/service-naming/schemas/v0/web.js +25 -1
  644. package/packages/dd-trace/src/service-naming/schemas/v0/websocket.js +5 -0
  645. package/packages/dd-trace/src/service-naming/schemas/v1/graphql.js +8 -0
  646. package/packages/dd-trace/src/service-naming/schemas/v1/messaging.js +32 -0
  647. package/packages/dd-trace/src/service-naming/schemas/v1/serverless.js +12 -0
  648. package/packages/dd-trace/src/service-naming/schemas/v1/storage.js +17 -0
  649. package/packages/dd-trace/src/service-naming/schemas/v1/web.js +23 -3
  650. package/packages/dd-trace/src/service-naming/schemas/v1/websocket.js +6 -0
  651. package/packages/dd-trace/src/service-naming/source-resolver.js +50 -0
  652. package/packages/dd-trace/src/span_format.js +269 -81
  653. package/packages/dd-trace/src/span_processor.js +18 -13
  654. package/packages/dd-trace/src/span_stats.js +101 -79
  655. package/packages/dd-trace/src/spanleak.js +1 -2
  656. package/packages/dd-trace/src/standalone/index.js +0 -36
  657. package/packages/dd-trace/src/startup-log.js +3 -3
  658. package/packages/dd-trace/src/tagger.js +2 -4
  659. package/packages/dd-trace/src/telemetry/dependencies.js +2 -2
  660. package/packages/dd-trace/src/telemetry/endpoints.js +7 -5
  661. package/packages/dd-trace/src/telemetry/index.js +2 -2
  662. package/packages/dd-trace/src/telemetry/logs/index.js +1 -1
  663. package/packages/dd-trace/src/telemetry/send-data.js +22 -22
  664. package/packages/dd-trace/src/telemetry/session-propagation.js +1 -1
  665. package/packages/dd-trace/src/telemetry/telemetry.js +16 -14
  666. package/packages/dd-trace/src/tracer.js +23 -9
  667. package/packages/dd-trace/src/tracer_metadata.js +1 -1
  668. package/packages/dd-trace/src/util.js +57 -0
  669. package/register.js +58 -1
  670. package/vendor/dist/@apm-js-collab/code-transformer/index.js +94 -42
  671. package/vendor/dist/@datadog/sketches-js/LICENSE +10 -36
  672. package/vendor/dist/@datadog/sketches-js/index.js +1 -1
  673. package/vendor/dist/pprof-format/index.js +1 -1
  674. package/vendor/dist/protobufjs/index.js +1 -1
  675. package/vendor/dist/protobufjs/minimal/index.js +1 -1
  676. package/vendor/dist/shell-quote/index.js +1 -1
  677. package/packages/datadog-plugin-graphql/src/resolve.js +0 -178
  678. package/packages/dd-trace/src/agent/url.js +0 -28
  679. package/packages/dd-trace/src/appsec/api_security_sampler.js +0 -117
  680. package/packages/dd-trace/src/lambda/runtime/ritm.js +0 -133
  681. package/packages/dd-trace/src/log/utils.js +0 -16
  682. package/packages/dd-trace/src/msgpack/encoder.js +0 -308
  683. package/packages/dd-trace/src/plugins/structured_log_plugin.js +0 -9
  684. package/scripts/preinstall.js +0 -34
  685. package/vendor/dist/ignore/LICENSE +0 -21
  686. package/vendor/dist/ignore/index.js +0 -1
  687. package/vendor/dist/opentracing/LICENSE +0 -201
  688. package/vendor/dist/opentracing/binary_carrier.d.ts +0 -11
  689. package/vendor/dist/opentracing/constants.d.ts +0 -61
  690. package/vendor/dist/opentracing/examples/demo/demo.d.ts +0 -2
  691. package/vendor/dist/opentracing/ext/tags.d.ts +0 -90
  692. package/vendor/dist/opentracing/functions.d.ts +0 -20
  693. package/vendor/dist/opentracing/global_tracer.d.ts +0 -14
  694. package/vendor/dist/opentracing/index.d.ts +0 -12
  695. package/vendor/dist/opentracing/index.js +0 -1
  696. package/vendor/dist/opentracing/mock_tracer/index.d.ts +0 -5
  697. package/vendor/dist/opentracing/mock_tracer/mock_context.d.ts +0 -13
  698. package/vendor/dist/opentracing/mock_tracer/mock_report.d.ts +0 -16
  699. package/vendor/dist/opentracing/mock_tracer/mock_span.d.ts +0 -50
  700. package/vendor/dist/opentracing/mock_tracer/mock_tracer.d.ts +0 -26
  701. package/vendor/dist/opentracing/noop.d.ts +0 -8
  702. package/vendor/dist/opentracing/reference.d.ts +0 -33
  703. package/vendor/dist/opentracing/span.d.ts +0 -147
  704. package/vendor/dist/opentracing/span_context.d.ts +0 -26
  705. package/vendor/dist/opentracing/test/api_compatibility.d.ts +0 -16
  706. package/vendor/dist/opentracing/test/mocktracer_implemenation.d.ts +0 -3
  707. package/vendor/dist/opentracing/test/noop_implementation.d.ts +0 -4
  708. package/vendor/dist/opentracing/test/opentracing_api.d.ts +0 -3
  709. package/vendor/dist/opentracing/test/unittest.d.ts +0 -2
  710. package/vendor/dist/opentracing/tracer.d.ts +0 -127
  711. package/vendor/dist/path-to-regexp/LICENSE +0 -21
  712. package/vendor/dist/path-to-regexp/index.js +0 -1
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ClientRequest, IncomingMessage, OutgoingMessage, ServerResponse } from "http";
2
2
  import { LookupFunction } from 'net';
3
- import * as opentracing from "./vendor/dist/opentracing";
3
+ import * as opentracing from "opentracing";
4
4
  import * as otel from "@opentelemetry/api";
5
5
 
6
6
  /**
@@ -19,6 +19,12 @@ interface Tracer extends opentracing.Tracer {
19
19
 
20
20
  /**
21
21
  * Starts and returns a new Span representing a logical unit of work.
22
+ *
23
+ * The returned span is not activated on the current scope. Spans created
24
+ * while it is open — via {@link Tracer.trace} or auto-instrumentation — only
25
+ * nest under it when it is the active span, so wrap the work in
26
+ * {@link Scope.activate} (or use {@link Tracer.trace}) when child spans
27
+ * should descend from it.
22
28
  * @param {string} name The name of the operation.
23
29
  * @param {tracer.SpanOptions} [options] Options for the newly created span.
24
30
  * @returns {Span} A new Span object.
@@ -150,12 +156,12 @@ interface Tracer extends opentracing.Tracer {
150
156
  llmobs: tracer.llmobs.LLMObs;
151
157
 
152
158
  /**
153
- * OpenFeature Provider with Remote Config integration.
159
+ * OpenFeature Provider with agentless and Agent Remote Config delivery.
154
160
  *
155
- * Extends DatadogNodeServerProvider with Remote Config integration for dynamic flag configuration.
156
- * Enable with DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true.
161
+ * Agentless delivery is enabled by default and starts when the provider is first accessed.
157
162
  *
158
- * @env DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED
163
+ * @env DD_FEATURE_FLAGS_ENABLED
164
+ * @env DD_FEATURE_FLAGS_CONFIGURATION_SOURCE
159
165
  * @beta This feature is in preview and not ready for production use
160
166
  */
161
167
  openfeature: tracer.OpenFeatureProvider;
@@ -218,8 +224,8 @@ interface Tracer extends opentracing.Tracer {
218
224
  removeAllBaggageItems (): Record<string, string>;
219
225
  }
220
226
 
221
- // left out of the namespace, so it
222
- // is doesn't need to be exported for Tracer
227
+ // Left out of the namespace, so it doesn't need to be exported for Tracer.
228
+ // Only include plugins here that can be either disabled or configured.
223
229
  /** @hidden */
224
230
  interface Plugins {
225
231
  "aerospike": tracer.plugins.aerospike;
@@ -227,9 +233,12 @@ interface Plugins {
227
233
  "amqp10": tracer.plugins.amqp10;
228
234
  "amqplib": tracer.plugins.amqplib;
229
235
  "anthropic": tracer.plugins.anthropic;
236
+ "claude-agent-sdk": tracer.plugins.claude_agent_sdk;
230
237
  "apollo": tracer.plugins.apollo;
231
238
  "avsc": tracer.plugins.avsc;
239
+ "aws-durable-execution-sdk-js": tracer.plugins.aws_durable_execution_sdk_js;
232
240
  "aws-sdk": tracer.plugins.aws_sdk;
241
+ "azure-cosmos": tracer.plugins.azure_cosmos;
233
242
  "azure-event-hubs": tracer.plugins.azure_event_hubs;
234
243
  "azure-functions": tracer.plugins.azure_functions;
235
244
  "azure-service-bus": tracer.plugins.azure_service_bus;
@@ -245,12 +254,12 @@ interface Plugins {
245
254
  "cypress": tracer.plugins.cypress;
246
255
  "dns": tracer.plugins.dns;
247
256
  "elasticsearch": tracer.plugins.elasticsearch;
257
+ "electron": tracer.plugins.electron;
248
258
  "express": tracer.plugins.express;
249
259
  "fastify": tracer.plugins.fastify;
250
260
  "fetch": tracer.plugins.fetch;
251
261
  "find-my-way": tracer.plugins.find_my_way;
252
262
  "fs": tracer.plugins.fs;
253
- "generic-pool": tracer.plugins.generic_pool;
254
263
  "google-cloud-pubsub": tracer.plugins.google_cloud_pubsub;
255
264
  "google-cloud-vertexai": tracer.plugins.google_cloud_vertexai;
256
265
  "google-genai": tracer.plugins.google_genai;
@@ -264,7 +273,6 @@ interface Plugins {
264
273
  "iovalkey": tracer.plugins.iovalkey;
265
274
  "jest": tracer.plugins.jest;
266
275
  "kafkajs": tracer.plugins.kafkajs;
267
- "knex": tracer.plugins.knex;
268
276
  "koa": tracer.plugins.koa;
269
277
  "langchain": tracer.plugins.langchain;
270
278
  "langgraph": tracer.plugins.langgraph;
@@ -272,11 +280,13 @@ interface Plugins {
272
280
  "memcached": tracer.plugins.memcached;
273
281
  "microgateway-core": tracer.plugins.microgateway_core;
274
282
  "mocha": tracer.plugins.mocha;
283
+ "modelcontextprotocol-sdk": tracer.plugins.modelcontextprotocol_sdk;
275
284
  "moleculer": tracer.plugins.moleculer;
276
285
  "mongodb-core": tracer.plugins.mongodb_core;
277
286
  "mongoose": tracer.plugins.mongoose;
278
287
  "mysql": tracer.plugins.mysql;
279
288
  "mysql2": tracer.plugins.mysql2;
289
+ "nats": tracer.plugins.nats;
280
290
  "net": tracer.plugins.net;
281
291
  "next": tracer.plugins.next;
282
292
  "nyc": tracer.plugins.nyc;
@@ -351,17 +361,6 @@ declare namespace tracer {
351
361
  export interface Span extends opentracing.Span {
352
362
  context (): SpanContext;
353
363
 
354
- /**
355
- * Causally links another span to the current span
356
- *
357
- * @deprecated In favor of addLink(link: { context: SpanContext, attributes?: Object }).
358
- * This will be removed in the next major version.
359
- * @param {SpanContext} context The context of the span to link to.
360
- * @param {Object} attributes An optional key value pair of arbitrary values.
361
- * @returns {void}
362
- */
363
- addLink (context: SpanContext, attributes?: Object): void;
364
-
365
364
  /**
366
365
  * Adds a single link to the span.
367
366
  *
@@ -415,7 +414,7 @@ declare namespace tracer {
415
414
  */
416
415
  export interface SamplingRule {
417
416
  /**
418
- * Sampling rate for this rule.
417
+ * Sampling rate for this rule. A range between 0 and 1 representing the percent of traces sampled.
419
418
  */
420
419
  sampleRate: number
421
420
 
@@ -428,6 +427,22 @@ declare namespace tracer {
428
427
  * Operation name on which to apply this rule. The rule will apply to all operation names if not provided.
429
428
  */
430
429
  name?: string | RegExp
430
+
431
+ /**
432
+ * Resource name on which to apply this rule. The rule will apply to all resource names if not provided.
433
+ */
434
+ resource?: string | RegExp
435
+
436
+ /**
437
+ * Span tags on which to apply this rule, keyed by tag name. Each value is a glob pattern or regular
438
+ * expression, and the rule only applies when every entry matches the span's tags.
439
+ */
440
+ tags?: { [key: string]: string | RegExp }
441
+
442
+ /**
443
+ * Maximum number of traces matching this rule to sample per second.
444
+ */
445
+ maxPerSecond?: number
431
446
  }
432
447
 
433
448
  /**
@@ -609,10 +624,10 @@ declare namespace tracer {
609
624
  rateLimit?: number,
610
625
 
611
626
  /**
612
- * Sampling rules to apply to priority sampling. Each rule is a JSON,
613
- * consisting of `service` and `name`, which are regexes to match against
614
- * a trace's `service` and `name`, and a corresponding `sampleRate`. If not
615
- * specified, will defer to global sampling rate for all spans.
627
+ * Sampling rules to apply to priority sampling. Each rule matches against a trace's
628
+ * `service`, `name`, `resource`, and `tags`, and applies the rule's `sampleRate`. Use a
629
+ * `sampleRate` of `0` to drop matching traces (for example to filter out unwanted resources).
630
+ * If not specified, will defer to global sampling rate for all spans.
616
631
  * @default []
617
632
  * @env DD_TRACE_SAMPLING_RULES
618
633
  * Programmatic configuration takes precedence over the environment variables listed above.
@@ -649,23 +664,31 @@ declare namespace tracer {
649
664
  */
650
665
  runtimeMetrics?: boolean | {
651
666
 
652
- /**
667
+ /**
653
668
  * @env DD_RUNTIME_METRICS_ENABLED
654
669
  * Programmatic configuration takes precedence over the environment variables listed above.
655
670
  */
656
671
  enabled?: boolean,
657
672
 
658
- /**
673
+ /**
659
674
  * @env DD_RUNTIME_METRICS_GC_ENABLED
660
675
  * Programmatic configuration takes precedence over the environment variables listed above.
661
676
  */
662
677
  gc?: boolean,
663
678
 
664
- /**
679
+ /**
665
680
  * @env DD_RUNTIME_METRICS_EVENT_LOOP_ENABLED
666
681
  * Programmatic configuration takes precedence over the environment variables listed above.
667
682
  */
668
- eventLoop?: boolean
683
+ eventLoop?: boolean,
684
+
685
+ /**
686
+ * Whether to use native metrics. When set to false, forces the JS implementation
687
+ * @default true
688
+ * @env DD_RUNTIME_METRICS_NATIVE
689
+ * Programmatic configuration takes precedence over the environment variables listed above.
690
+ */
691
+ native?: boolean
669
692
  }
670
693
 
671
694
  /**
@@ -690,28 +713,6 @@ declare namespace tracer {
690
713
  */
691
714
  protocolVersion?: string
692
715
 
693
- /**
694
- * Deprecated in favor of the global versions of the variables provided under this option
695
- *
696
- * @deprecated
697
- * @hidden
698
- */
699
- ingestion?: {
700
- /**
701
- * Controls the ingestion sample rate (between 0 and 1) between the agent and the backend.
702
- * @env DD_TRACE_SAMPLE_RATE
703
- * Programmatic configuration takes precedence over the environment variables listed above.
704
- */
705
- sampleRate?: number
706
-
707
- /**
708
- * Controls the ingestion rate limit between the agent and the backend. Defaults to deferring the decision to the agent.
709
- * @env DD_TRACE_RATE_LIMIT
710
- * Programmatic configuration takes precedence over the environment variables listed above.
711
- */
712
- rateLimit?: number
713
- };
714
-
715
716
  /**
716
717
  * Whether to enable inferred proxy services.
717
718
  * @default false
@@ -734,19 +735,12 @@ declare namespace tracer {
734
735
  */
735
736
  experimental?: {
736
737
 
737
- /**
738
- * @default false
739
- * @env DD_TRACE_EXPERIMENTAL_B3_ENABLED
740
- * Programmatic configuration takes precedence over the environment variables listed above.
741
- */
742
- b3?: boolean
743
-
744
738
  /**
745
739
  * Whether to write traces to log output or agentless, rather than send to an agent
746
740
  * @env DD_TRACE_EXPERIMENTAL_EXPORTER
747
741
  * Programmatic configuration takes precedence over the environment variables listed above.
748
742
  */
749
- exporter?: 'log' | 'agent' | 'datadog'
743
+ exporter?: 'log' | 'agent' | 'datadog' | 'electron'
750
744
 
751
745
  /**
752
746
  * Whether to enable the experimental `getRumData` method.
@@ -756,34 +750,6 @@ declare namespace tracer {
756
750
  */
757
751
  enableGetRumData?: boolean
758
752
 
759
- /**
760
- * Configuration of the IAST. Can be a boolean as an alias to `iast.enabled`.
761
- * @deprecated Please use the non-experimental `iast` option instead.
762
- */
763
- iast?: boolean | IastOptions
764
-
765
- /**
766
- * Configuration of the AppSec. Can be a boolean as an alias to `appsec.enabled`.
767
- * @deprecated Please use the non-experimental `appsec` option instead.
768
- */
769
- appsec?: boolean | {
770
- /**
771
- * Configuration of Standalone ASM mode
772
- * Deprecated in favor of `apmTracingEnabled`.
773
- *
774
- * @deprecated Please use `apmTracingEnabled` instead.
775
- */
776
- standalone?: {
777
- /**
778
- * Whether to enable Standalone ASM.
779
- * @default false
780
- * @env DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED
781
- * Programmatic configuration takes precedence over the environment variables listed above.
782
- */
783
- enabled?: boolean
784
- }
785
- } | TracerOptions['appsec'],
786
-
787
753
  aiguard?: {
788
754
  /**
789
755
  * Set to `true` to enable the SDK.
@@ -795,7 +761,7 @@ declare namespace tracer {
795
761
  * Whether to request blocking mode when evaluating prompts via auto-instrumentation.
796
762
  * When `true`, AI Guard will block requests that violate security policies.
797
763
  * When `false`, AI Guard evaluates but never blocks (monitor-only mode).
798
- * @default false
764
+ * @default true
799
765
  * @env DD_AI_GUARD_BLOCK
800
766
  * Programmatic configuration takes precedence over the environment variables listed above.
801
767
  */
@@ -833,9 +799,9 @@ declare namespace tracer {
833
799
  */
834
800
  flaggingProvider?: {
835
801
  /**
836
- * Whether to enable the feature flagging provider.
837
- * Requires Remote Config to be properly configured.
838
- * Can be configured via DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED environment variable.
802
+ * Legacy feature flagging provider switch.
803
+ * When the stable Feature Flags configuration is unset, true selects Agent Remote Config and false disables
804
+ * the provider.
839
805
  *
840
806
  * @default false
841
807
  * @env DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED
@@ -852,6 +818,21 @@ declare namespace tracer {
852
818
  * Programmatic configuration takes precedence over the environment variables listed above.
853
819
  */
854
820
  initializationTimeoutMs?: number
821
+ /**
822
+ * Configuration for span enrichment with feature flag evaluation data.
823
+ */
824
+ spanEnrichment?: {
825
+ /**
826
+ * Whether to enable span enrichment with feature flag data.
827
+ * When enabled, feature flag evaluation metadata is attached to APM spans.
828
+ * Can be configured via DD_EXPERIMENTAL_FLAGGING_PROVIDER_SPAN_ENRICHMENT_ENABLED environment variable.
829
+ *
830
+ * @default false
831
+ * @env DD_EXPERIMENTAL_FLAGGING_PROVIDER_SPAN_ENRICHMENT_ENABLED
832
+ * Programmatic configuration takes precedence over the environment variables listed above.
833
+ */
834
+ enabled?: boolean
835
+ }
855
836
  }
856
837
  };
857
838
 
@@ -899,11 +880,20 @@ declare namespace tracer {
899
880
 
900
881
  /**
901
882
  * Enables DBM to APM link using tag injection.
883
+ *
884
+ * - `disabled`: No SQL comment is injected (default).
885
+ * - `service`: Injects a SQL comment with service-level tags (database name, service, environment,
886
+ * host, tracer service, tracer version). Enables DBM–APM correlation without full trace linking.
887
+ * - `full`: Same as `service`, plus a W3C `traceparent` for full distributed trace correlation.
888
+ * - `dynamic_service`: Same as `service`, but also automatically injects the propagation hash
889
+ * (`ddsh`) when process tags are enabled (`DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED=true`).
890
+ * This is a convenience shorthand for `service` + `DD_DBM_INJECT_SQL_BASEHASH=true`.
891
+ *
902
892
  * @default 'disabled'
903
893
  * @env DD_DBM_PROPAGATION_MODE
904
894
  * Programmatic configuration takes precedence over the environment variables listed above.
905
895
  */
906
- dbmPropagationMode?: 'disabled' | 'service' | 'full'
896
+ dbmPropagationMode?: 'disabled' | 'service' | 'full' | 'dynamic_service'
907
897
 
908
898
  /**
909
899
  * Whether to enable Data Streams Monitoring.
@@ -1061,15 +1051,6 @@ declare namespace tracer {
1061
1051
  * Programmatic configuration takes precedence over the environment variables listed above.
1062
1052
  */
1063
1053
  enabled?: boolean,
1064
-
1065
- /** Whether to enable request body collection on RASP event
1066
- * @default false
1067
- *
1068
- * @deprecated Use UI and Remote Configuration to enable extended data collection
1069
- * @env DD_APPSEC_RASP_COLLECT_REQUEST_BODY
1070
- * Programmatic configuration takes precedence over the environment variables listed above.
1071
- */
1072
- bodyCollection?: boolean
1073
1054
  },
1074
1055
  /**
1075
1056
  * Configuration for stack trace reporting
@@ -1096,39 +1077,6 @@ declare namespace tracer {
1096
1077
  */
1097
1078
  maxDepth?: number,
1098
1079
  },
1099
- /**
1100
- * Configuration for extended headers collection tied to security events
1101
- *
1102
- * @deprecated Use UI and Remote Configuration to enable extended data collection
1103
- */
1104
- extendedHeadersCollection?: {
1105
- /** Whether to enable extended headers collection
1106
- * @default false
1107
- *
1108
- * @deprecated Use UI and Remote Configuration to enable extended data collection
1109
- * @env DD_APPSEC_COLLECT_ALL_HEADERS
1110
- * Programmatic configuration takes precedence over the environment variables listed above.
1111
- */
1112
- enabled: boolean,
1113
-
1114
- /** Whether to redact collected headers
1115
- * @default true
1116
- *
1117
- * @deprecated Use UI and Remote Configuration to enable extended data collection
1118
- * @env DD_APPSEC_HEADER_COLLECTION_REDACTION_ENABLED
1119
- * Programmatic configuration takes precedence over the environment variables listed above.
1120
- */
1121
- redaction: boolean,
1122
-
1123
- /** Specifies the maximum number of headers collected.
1124
- * @default 50
1125
- *
1126
- * @deprecated Use UI and Remote Configuration to enable extended data collection
1127
- * @env DD_APPSEC_MAX_COLLECTED_HEADERS
1128
- * Programmatic configuration takes precedence over the environment variables listed above.
1129
- */
1130
- maxHeaders: number,
1131
- }
1132
1080
  }
1133
1081
 
1134
1082
  /**
@@ -1315,7 +1263,7 @@ declare namespace tracer {
1315
1263
 
1316
1264
  /**
1317
1265
  * Whether to use Datadog legacy baggage extraction and injection behavior.
1318
- * @default false
1266
+ * @default true
1319
1267
  * @env DD_TRACE_LEGACY_BAGGAGE_ENABLED
1320
1268
  * Programmatic configuration takes precedence over the environment variables listed above.
1321
1269
  */
@@ -1672,7 +1620,7 @@ declare namespace tracer {
1672
1620
  /**
1673
1621
  * Flagging Provider (OpenFeature-compatible).
1674
1622
  *
1675
- * Wraps @datadog/openfeature-node-server with Remote Config integration for dynamic flag configuration.
1623
+ * Wraps @datadog/openfeature-node-server with agentless and Agent Remote Config delivery.
1676
1624
  * Implements the OpenFeature Provider interface for flag evaluation.
1677
1625
  *
1678
1626
  * @beta This feature is in preview and not ready for production use
@@ -1847,6 +1795,10 @@ declare namespace tracer {
1847
1795
  * List of tags associated with the evaluation (e.g. indirect-prompt-injection)
1848
1796
  */
1849
1797
  tags: string[];
1798
+ /**
1799
+ * Dictionary of tag probabilities (e.g. { indirect-prompt-injection: 0.2, jailbreak-attempt: 0.8 })
1800
+ */
1801
+ tagProbabilities: { [key: string]: number }
1850
1802
  /**
1851
1803
  * Sensitive Data Scanner findings from the evaluation.
1852
1804
  */
@@ -1866,6 +1818,10 @@ declare namespace tracer {
1866
1818
  * List of tags associated with the evaluation (e.g. indirect-prompt-injection)
1867
1819
  */
1868
1820
  tags: string[];
1821
+ /**
1822
+ * Dictionary of tag probabilities (e.g. { indirect-prompt-injection: 0.2, jailbreak-attempt: 0.8 })
1823
+ */
1824
+ tagProbabilities: { [key: string]: number }
1869
1825
  /**
1870
1826
  * Sensitive Data Scanner findings from the evaluation.
1871
1827
  */
@@ -1980,6 +1936,20 @@ declare namespace tracer {
1980
1936
  /** @hidden */
1981
1937
  interface Instrumentation extends Integration, Analyzable {}
1982
1938
 
1939
+ /** @hidden */
1940
+ interface DatabaseInstrumentation extends Instrumentation {
1941
+ /**
1942
+ * Truncate the resource name (e.g. the query) to the given length.
1943
+ * When set to `true`, truncates to 5000 characters (matching the
1944
+ * Datadog agent's default). When set to a number, truncates to that
1945
+ * many characters. This can help prevent large queries from blocking
1946
+ * the event loop during trace encoding.
1947
+ *
1948
+ * @default false
1949
+ */
1950
+ truncate?: boolean | number;
1951
+ }
1952
+
1983
1953
  /** @hidden */
1984
1954
  interface Http extends Instrumentation {
1985
1955
  /**
@@ -1993,14 +1963,6 @@ declare namespace tracer {
1993
1963
  */
1994
1964
  allowlist?: string | RegExp | ((urlOrPath: string) => boolean) | (string | RegExp | ((urlOrPath: string) => boolean))[];
1995
1965
 
1996
- /**
1997
- * Deprecated in favor of `allowlist`.
1998
- *
1999
- * @deprecated
2000
- * @hidden
2001
- */
2002
- whitelist?: string | RegExp | ((urlOrPath: string) => boolean) | (string | RegExp | ((urlOrPath: string) => boolean))[];
2003
-
2004
1966
  /**
2005
1967
  * List of URLs/paths that should not be instrumented. Takes precedence over
2006
1968
  * allowlist if a URL matches an entry in both.
@@ -2013,14 +1975,6 @@ declare namespace tracer {
2013
1975
  */
2014
1976
  blocklist?: string | RegExp | ((urlOrPath: string) => boolean) | (string | RegExp | ((urlOrPath: string) => boolean))[];
2015
1977
 
2016
- /**
2017
- * Deprecated in favor of `blocklist`.
2018
- *
2019
- * @deprecated
2020
- * @hidden
2021
- */
2022
- blacklist?: string | RegExp | ((urlOrPath: string) => boolean) | (string | RegExp | ((urlOrPath: string) => boolean))[];
2023
-
2024
1978
  /**
2025
1979
  * Custom filter function used to decide whether a URL/path is allowed.
2026
1980
  * When provided, this takes precedence over allowlist/blocklist configuration.
@@ -2200,7 +2154,7 @@ declare namespace tracer {
2200
2154
  }
2201
2155
 
2202
2156
  /** @hidden */
2203
- interface Prisma extends Instrumentation {}
2157
+ interface Prisma extends DatabaseInstrumentation {}
2204
2158
 
2205
2159
  /** @hidden */
2206
2160
  interface PrismaClient extends Prisma {}
@@ -2238,6 +2192,12 @@ declare namespace tracer {
2238
2192
  */
2239
2193
  interface anthropic extends Instrumentation {}
2240
2194
 
2195
+ /**
2196
+ * This plugin automatically instruments the
2197
+ * [@anthropic-ai/claude-agent-sdk](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) module.
2198
+ */
2199
+ interface claude_agent_sdk extends Instrumentation {}
2200
+
2241
2201
  /**
2242
2202
  * Currently this plugin automatically instruments
2243
2203
  * [@apollo/gateway](https://github.com/apollographql/federation) for module versions >= v2.3.0.
@@ -2287,11 +2247,25 @@ declare namespace tracer {
2287
2247
  */
2288
2248
  interface avsc extends Integration {}
2289
2249
 
2250
+ /**
2251
+ * This plugin automatically instruments the
2252
+ * [aws-durable-execution-sdk-js](https://github.com/aws/aws-durable-execution-sdk-js) module.
2253
+ */
2254
+ interface aws_durable_execution_sdk_js extends Integration {}
2255
+
2290
2256
  /**
2291
2257
  * This plugin automatically instruments the
2292
2258
  * [aws-sdk](https://github.com/aws/aws-sdk-js) module.
2293
2259
  */
2294
2260
  interface aws_sdk extends Instrumentation {
2261
+ /**
2262
+ * The service name to be used for this plugin. When a function is used it is called with the AWS
2263
+ * request parameters (e.g. `{ TableName }` for DynamoDB, `{ Bucket }` for S3) and its return value
2264
+ * is used as the service name. Returning a nullish value falls back to the default service name, so
2265
+ * individual resources can be mapped without renaming every call to the service.
2266
+ */
2267
+ service?: string | ((params: anyObject) => string | undefined | null);
2268
+
2295
2269
  /**
2296
2270
  * Whether to inject all messages during batch AWS SQS, Kinesis, and SNS send operations. Normal
2297
2271
  * behavior is to inject the first message in batch send operations.
@@ -2319,6 +2293,12 @@ declare namespace tracer {
2319
2293
  [key: string]: boolean | Object | undefined;
2320
2294
  }
2321
2295
 
2296
+ /**
2297
+ * This plugin automatically instruments the
2298
+ * @azure/cosmos module
2299
+ */
2300
+ interface azure_cosmos extends Integration {}
2301
+
2322
2302
  /**
2323
2303
  * This plugin automatically instruments the
2324
2304
  * @azure/event-hubs module
@@ -2358,7 +2338,21 @@ declare namespace tracer {
2358
2338
  * This plugin automatically instruments the
2359
2339
  * [bullmq](https://github.com/npmjs/package/bullmq) message queue library.
2360
2340
  */
2361
- interface bullmq extends Instrumentation {}
2341
+ interface bullmq extends Instrumentation {
2342
+ /**
2343
+ * Filter applied to BullMQ producer operations (`Queue.add`, `Queue.addBulk`,
2344
+ * `FlowProducer.add`). Return `false` to skip span creation, trace context
2345
+ * injection, and DSM checkpoint handling for the matching job. Consumer-side
2346
+ * (`Worker`) instrumentation is unaffected.
2347
+ *
2348
+ * @param job.name - The BullMQ job name.
2349
+ * @param job.data - The BullMQ job data.
2350
+ * @param job.opts - The BullMQ job options.
2351
+ * @param job.queueName - The name of the queue the job is being added to.
2352
+ * @returns true to instrument the producer operation, false to skip it.
2353
+ */
2354
+ producerFilter?: (job: { name?: string; data?: unknown; opts?: unknown; queueName?: string }) => boolean;
2355
+ }
2362
2356
 
2363
2357
  interface bunyan extends Integration {}
2364
2358
 
@@ -2426,6 +2420,26 @@ declare namespace tracer {
2426
2420
  };
2427
2421
  }
2428
2422
 
2423
+ /**
2424
+ * This plugin automatically instruments the
2425
+ * [electron](https://github.com/electron/electron) module.
2426
+ */
2427
+ interface electron extends Instrumentation {
2428
+ /**
2429
+ * Whether to enable instrumentation of ipc spans
2430
+ *
2431
+ * @default true
2432
+ */
2433
+ ipc?: boolean;
2434
+
2435
+ /**
2436
+ * Whether to enable instrumentation of net spans
2437
+ *
2438
+ * @default true
2439
+ */
2440
+ net?: boolean;
2441
+ }
2442
+
2429
2443
  /**
2430
2444
  * This plugin automatically instruments the
2431
2445
  * [express](http://expressjs.com/) module.
@@ -2454,12 +2468,6 @@ declare namespace tracer {
2454
2468
  */
2455
2469
  interface fs extends Instrumentation {}
2456
2470
 
2457
- /**
2458
- * This plugin patches the [generic-pool](https://github.com/coopernurse/node-pool)
2459
- * module to bind the callbacks the the caller context.
2460
- */
2461
- interface generic_pool extends Integration {}
2462
-
2463
2471
  /**
2464
2472
  * This plugin automatically instruments the
2465
2473
  * [@google-cloud/pubsub](https://github.com/googleapis/nodejs-pubsub) module.
@@ -2470,30 +2478,49 @@ declare namespace tracer {
2470
2478
  * This plugin automatically instruments the
2471
2479
  * [@google-cloud/vertexai](https://github.com/googleapis/nodejs-vertexai) module.
2472
2480
  */
2473
- interface google_cloud_vertexai extends Integration {}
2481
+ interface google_cloud_vertexai extends Integration {}
2474
2482
 
2475
- /**
2483
+ /**
2476
2484
  * This plugin automatically instruments the
2477
2485
  * [@google-genai](https://github.com/googleapis/js-genai) module.
2478
2486
  */
2479
- interface google_genai extends Integration {}
2487
+ interface google_genai extends Integration {}
2480
2488
 
2481
- /** @hidden */
2482
- interface ExecutionArgs {
2483
- schema: any,
2484
- document: any,
2485
- rootValue?: any,
2486
- contextValue?: any,
2487
- variableValues?: any,
2488
- operationName?: string,
2489
- fieldResolver?: any,
2490
- typeResolver?: any,
2489
+ /** @hidden */
2490
+ interface ExecutionArgs {
2491
+ schema: any,
2492
+ document: any,
2493
+ rootValue?: any,
2494
+ contextValue?: any,
2495
+ variableValues?: any,
2496
+ operationName?: string,
2497
+ fieldResolver?: any,
2498
+ typeResolver?: any,
2499
+ }
2500
+
2501
+ /** Context object passed to the `hooks.resolve` callback for each instrumented field. */
2502
+ interface FieldContext {
2503
+ /** The field name being resolved */
2504
+ fieldName: string;
2505
+ /** The dot-separated field path (e.g. `'user.address.city'`) */
2506
+ path: string;
2507
+ /** The error from the resolver, or `null` if it succeeded */
2508
+ error: Error | null;
2509
+ /** The value returned by the resolver (sync resolvers only; `undefined` for async) */
2510
+ result: unknown;
2491
2511
  }
2492
2512
 
2493
2513
  /**
2494
2514
  * This plugin automatically instruments the
2495
2515
  * [graphql](https://github.com/graphql/graphql-js) module.
2496
2516
  *
2517
+ * It also instruments [mercurius](https://github.com/mercurius-js/mercurius)
2518
+ * (the Fastify GraphQL adapter): every request through `app.graphql` /
2519
+ * `reply.graphql` opens a top-level `graphql.request` span that parents the
2520
+ * `graphql.parse`/`graphql.validate`/`graphql.execute` spans and carries the
2521
+ * request text. This span is produced even when mercurius serves the query
2522
+ * from its JIT-compiled path, where `graphql.execute` does not run.
2523
+ *
2497
2524
  * The `graphql` integration uses the operation name as the span resource name.
2498
2525
  * If no operation name is set, the resource name will always be just `query`,
2499
2526
  * `mutation` or `subscription`.
@@ -2518,8 +2545,11 @@ declare namespace tracer {
2518
2545
  /**
2519
2546
  * The maximum depth of fields/resolvers to instrument. Set to `0` to only
2520
2547
  * instrument the operation or to `-1` to instrument all fields/resolvers.
2548
+ * Counts selection-set nesting (named fields) only; list indices do not
2549
+ * count toward the limit, regardless of `collapse`.
2521
2550
  *
2522
2551
  * @default -1
2552
+ * @env DD_TRACE_GRAPHQL_DEPTH
2523
2553
  */
2524
2554
  depth?: number;
2525
2555
 
@@ -2536,7 +2566,10 @@ declare namespace tracer {
2536
2566
  /**
2537
2567
  * An array of variable names to record. Can also be a callback that returns
2538
2568
  * the key/value pairs to record. For example, using
2539
- * `variables => variables` would record all variables.
2569
+ * `variables => variables` would record all variables. The environment
2570
+ * variable only accepts the array form (comma-separated variable names).
2571
+ *
2572
+ * @env DD_TRACE_GRAPHQL_VARIABLES
2540
2573
  */
2541
2574
  variables?: string[] | ((variables: { [key: string]: any }) => { [key: string]: any });
2542
2575
 
@@ -2545,9 +2578,18 @@ declare namespace tracer {
2545
2578
  * `users.*.name` span instead of `users.0.name`, `users.1.name`, etc)
2546
2579
  *
2547
2580
  * @default true
2581
+ * @env DD_TRACE_GRAPHQL_COLLAPSE
2548
2582
  */
2549
2583
  collapse?: boolean;
2550
2584
 
2585
+ /**
2586
+ * An array of error `extensions` keys to attach to the span error event
2587
+ * for each GraphQL error.
2588
+ *
2589
+ * @env DD_TRACE_GRAPHQL_ERROR_EXTENSIONS
2590
+ */
2591
+ errorExtensions?: string[];
2592
+
2551
2593
  /**
2552
2594
  * Whether to enable signature calculation for the resource name. This can
2553
2595
  * be disabled if your GraphQL operations always have a name. Note that when
@@ -2568,6 +2610,7 @@ declare namespace tracer {
2568
2610
  execute?: (span?: Span, args?: ExecutionArgs, res?: any) => void;
2569
2611
  validate?: (span?: Span, document?: any, errors?: any) => void;
2570
2612
  parse?: (span?: Span, source?: any, document?: any) => void;
2613
+ resolve?: (span?: Span, field?: FieldContext) => void;
2571
2614
  }
2572
2615
  }
2573
2616
 
@@ -2666,14 +2709,6 @@ declare namespace tracer {
2666
2709
  */
2667
2710
  allowlist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2668
2711
 
2669
- /**
2670
- * Deprecated in favor of `allowlist`.
2671
- *
2672
- * @deprecated
2673
- * @hidden
2674
- */
2675
- whitelist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2676
-
2677
2712
  /**
2678
2713
  * List of commands that should not be instrumented. Takes precedence over
2679
2714
  * allowlist if a command matches an entry in both. Commands must be in
@@ -2683,14 +2718,6 @@ declare namespace tracer {
2683
2718
  */
2684
2719
  blocklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2685
2720
 
2686
- /**
2687
- * Deprecated in favor of `blocklist`.
2688
- *
2689
- * @deprecated
2690
- * @hidden
2691
- */
2692
- blacklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2693
-
2694
2721
  /**
2695
2722
  * Custom filter function used to decide whether a Redis command should be instrumented.
2696
2723
  * When provided, this takes precedence over allowlist/blocklist configuration.
@@ -2723,14 +2750,6 @@ declare namespace tracer {
2723
2750
  */
2724
2751
  allowlist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2725
2752
 
2726
- /**
2727
- * Deprecated in favor of `allowlist`.
2728
- *
2729
- * @deprecated
2730
- * @hidden
2731
- */
2732
- whitelist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2733
-
2734
2753
  /**
2735
2754
  * List of commands that should not be instrumented. Takes precedence over
2736
2755
  * allowlist if a command matches an entry in both. Commands must be in
@@ -2740,14 +2759,6 @@ declare namespace tracer {
2740
2759
  */
2741
2760
  blocklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2742
2761
 
2743
- /**
2744
- * Deprecated in favor of `blocklist`.
2745
- *
2746
- * @deprecated
2747
- * @hidden
2748
- */
2749
- blacklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2750
-
2751
2762
  /**
2752
2763
  * Custom filter function used to decide whether a Valkey command should be instrumented.
2753
2764
  * When provided, this takes precedence over allowlist/blocklist configuration.
@@ -2773,12 +2784,6 @@ declare namespace tracer {
2773
2784
  */
2774
2785
  interface jest extends Integration {}
2775
2786
 
2776
- /**
2777
- * This plugin patches the [knex](https://knexjs.org/)
2778
- * module to bind the promise callback the the caller context.
2779
- */
2780
- interface knex extends Integration {}
2781
-
2782
2787
  /**
2783
2788
  * This plugin automatically instruments the
2784
2789
  * [koa](https://koajs.com/) module.
@@ -2833,10 +2838,17 @@ declare namespace tracer {
2833
2838
  */
2834
2839
  interface mocha extends Integration {}
2835
2840
 
2841
+ /**
2842
+ * This plugin automatically instruments the
2843
+ * [modelcontextprotocol-sdk](https://github.com/npmjs/package/@modelcontextprotocol/sdk) library.
2844
+ */
2845
+ interface modelcontextprotocol_sdk extends Instrumentation {}
2846
+
2836
2847
  /**
2837
2848
  * This plugin automatically instruments the
2838
2849
  * [moleculer](https://moleculer.services/) module.
2839
2850
  */
2851
+
2840
2852
  interface moleculer extends Moleculer {
2841
2853
  /**
2842
2854
  * Configuration for Moleculer clients. Set to false to disable client
@@ -2863,6 +2875,24 @@ declare namespace tracer {
2863
2875
  */
2864
2876
  heartbeatEnabled?: boolean;
2865
2877
 
2878
+ /**
2879
+ * How to mask primitive query values in the `mongodb.query` tag and the
2880
+ * resource name (when `queryInResourceName` is also enabled). Keys,
2881
+ * operator names, and array / pipeline shape are preserved so the masked
2882
+ * query is still a usable query signature.
2883
+ *
2884
+ * - `'types'`: replace each primitive leaf with its `typeof` name
2885
+ * (`'string'`, `'number'`, `'boolean'`, `'bigint'`, `'object'`,
2886
+ * `'null'`). Keeps the same redaction guarantee as `'redact'` but
2887
+ * preserves the value types so the rendered query can still be used
2888
+ * to design indexes.
2889
+ * - `'redact'`: replace each primitive leaf with `'?'`. Strictest masking.
2890
+ * - `'none'`: do not mask. Values land verbatim on the span.
2891
+ *
2892
+ * @default 'none'
2893
+ */
2894
+ obfuscateQuery?: 'none' | 'types' | 'redact';
2895
+
2866
2896
  /**
2867
2897
  * Whether to include the query contents in the resource name.
2868
2898
  */
@@ -2889,6 +2919,13 @@ declare namespace tracer {
2889
2919
  */
2890
2920
  interface mysql2 extends mysql {}
2891
2921
 
2922
+ /**
2923
+ * This plugin automatically instruments the
2924
+ * [@nats-io/transport-node](https://github.com/nats-io/nats.js) and
2925
+ * [@nats-io/nats-core](https://github.com/nats-io/nats.js) modules.
2926
+ */
2927
+ interface nats extends Instrumentation {}
2928
+
2892
2929
  /**
2893
2930
  * This plugin automatically instruments the
2894
2931
  * [net](https://nodejs.org/api/net.html) module.
@@ -2958,7 +2995,7 @@ declare namespace tracer {
2958
2995
  * This plugin automatically instruments the
2959
2996
  * [pg](https://node-postgres.com/) module.
2960
2997
  */
2961
- interface pg extends Instrumentation {
2998
+ interface pg extends DatabaseInstrumentation {
2962
2999
  /**
2963
3000
  * The service name to be used for this plugin. If a function is used, it will be passed the connection parameters and its return value will be used as the service name.
2964
3001
  */
@@ -3015,14 +3052,6 @@ declare namespace tracer {
3015
3052
  */
3016
3053
  allowlist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
3017
3054
 
3018
- /**
3019
- * Deprecated in favor of `allowlist`.
3020
- *
3021
- * deprecated
3022
- * @hidden
3023
- */
3024
- whitelist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
3025
-
3026
3055
  /**
3027
3056
  * List of commands that should not be instrumented. Takes precedence over
3028
3057
  * allowlist if a command matches an entry in both.
@@ -3031,14 +3060,6 @@ declare namespace tracer {
3031
3060
  */
3032
3061
  blocklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
3033
3062
 
3034
- /**
3035
- * Deprecated in favor of `blocklist`.
3036
- *
3037
- * @deprecated
3038
- * @hidden
3039
- */
3040
- blacklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
3041
-
3042
3063
  /**
3043
3064
  * Custom filter function used to decide whether a Redis command should be instrumented.
3044
3065
  * When provided, this takes precedence over allowlist/blocklist configuration.
@@ -3048,6 +3069,14 @@ declare namespace tracer {
3048
3069
  * @returns true to instrument the command, false to skip it
3049
3070
  */
3050
3071
  filter?: (command: string) => boolean;
3072
+
3073
+ /**
3074
+ * Whether to use a different service name for each Redis instance based
3075
+ * on the configured connection name of the client.
3076
+ *
3077
+ * @default false
3078
+ */
3079
+ splitByInstance?: boolean;
3051
3080
  }
3052
3081
 
3053
3082
  /**
@@ -3066,7 +3095,16 @@ declare namespace tracer {
3066
3095
  * This plugin automatically instruments the
3067
3096
  * [router](https://github.com/pillarjs/router) module.
3068
3097
  */
3069
- interface router extends Integration {}
3098
+ interface router extends Integration {
3099
+ /**
3100
+ * Whether to enable instrumentation of router.middleware spans.
3101
+ * When set to `false`, middleware spans are suppressed but route
3102
+ * tracking (resource name, `http.route` tag) is still performed.
3103
+ *
3104
+ * @default true
3105
+ */
3106
+ middleware?: boolean;
3107
+ }
3070
3108
 
3071
3109
  /**
3072
3110
  * This plugin automatically instruments the
@@ -3342,16 +3380,6 @@ declare namespace tracer {
3342
3380
  */
3343
3381
  recordException(exception: Exception, time?: TimeInput): void;
3344
3382
 
3345
- /**
3346
- * Causally links another span to the current span
3347
- *
3348
- * @deprecated In favor of addLink(link: otel.Link). This will be removed in the next major version.
3349
- * @param {otel.SpanContext} context The context of the span to link to.
3350
- * @param {SpanAttributes} attributes An optional key value pair of arbitrary values.
3351
- * @returns {void}
3352
- */
3353
- addLink(context: otel.SpanContext, attributes?: SpanAttributes): void;
3354
-
3355
3383
  /**
3356
3384
  * Adds a single link to the span.
3357
3385
  *
@@ -3512,16 +3540,6 @@ declare namespace tracer {
3512
3540
  */
3513
3541
  redactionValuePattern?: string,
3514
3542
 
3515
- /**
3516
- * Allows to enable security controls. This option is not supported when
3517
- * using ESM.
3518
- * @deprecated Please use the DD_IAST_SECURITY_CONTROLS_CONFIGURATION
3519
- * environment variable instead. This option will be removed in the next major version.
3520
- * @env DD_IAST_SECURITY_CONTROLS_CONFIGURATION
3521
- * Programmatic configuration takes precedence over the environment variables listed above.
3522
- */
3523
- securityControlsConfiguration?: string,
3524
-
3525
3543
  /**
3526
3544
  * Specifies the verbosity of the sent telemetry. Default 'INFORMATION'
3527
3545
  * @env DD_IAST_TELEMETRY_VERBOSITY
@@ -3550,13 +3568,23 @@ declare namespace tracer {
3550
3568
  */
3551
3569
  enabled: boolean,
3552
3570
 
3571
+ /**
3572
+ * Datasets & Experiments API. Requires LLM Observability to be enabled and
3573
+ * `DD_API_KEY` / `DD_APP_KEY` to be set.
3574
+ */
3575
+ experiments: Experiments,
3576
+
3553
3577
  /**
3554
3578
  * Enable LLM Observability tracing.
3579
+ *
3580
+ * @deprecated Enabling LLM Observability via `llmobs.enable()` is deprecated and will be removed in dd-trace@7.0.0. Please instantiate LLM Observability via DD_LLMOBS_ENABLED or `tracer.init({ llmobs: ...options })`.
3555
3581
  */
3556
3582
  enable (options: LLMObsEnableOptions): void,
3557
3583
 
3558
3584
  /**
3559
3585
  * Disable LLM Observability tracing.
3586
+ *
3587
+ * @deprecated Disabling LLM Observability via `llmobs.disable()` is deprecated and will be removed in dd-trace@7.0.0. Set DD_LLMOBS_ENABLED=false to disable LLM Observability.
3560
3588
  */
3561
3589
  disable (): void,
3562
3590
 
@@ -3630,13 +3658,22 @@ declare namespace tracer {
3630
3658
  * outputData: { content: 'response', role: 'ai' },
3631
3659
  * metadata: { temperature: 0.7 },
3632
3660
  * tags: { host: 'localhost' },
3633
- * metrics: { inputTokens: 10, outputTokens: 20, totalTokens: 30 }
3661
+ * metrics: { inputTokens: 10, outputTokens: 20, totalTokens: 30 },
3662
+ * toolDefinitions: [
3663
+ * {
3664
+ * name: 'get_weather',
3665
+ * description: 'Returns the current weather for a given location.',
3666
+ * schema: { type: 'object', properties: { location: { type: 'string' } }, required: ['location'] },
3667
+ * version: '1.0.0'
3668
+ * },
3669
+ * { name: 'get_time' }
3670
+ * ]
3634
3671
  * })
3635
3672
  * })
3636
3673
  * ```
3637
3674
  *
3638
3675
  * @param span The span to annotate (defaults to the current LLM Observability span if not provided)
3639
- * @param options An object containing the inputs, outputs, tags, metadata, and metrics to set on the span.
3676
+ * @param options An object containing the inputs, outputs, tags, metadata, tool definitions, and metrics to set on the span.
3640
3677
  */
3641
3678
  annotate (options: llmobs.AnnotationOptions): void
3642
3679
  annotate (span: tracer.Span | undefined, options: llmobs.AnnotationOptions): void
@@ -3690,7 +3727,99 @@ declare namespace tracer {
3690
3727
  flush (): void
3691
3728
  }
3692
3729
 
3730
+ /**
3731
+ * A task run over each dataset record during an experiment.
3732
+ */
3733
+ type ExperimentTask = (input: any, config: Record<string, any>) => any | Promise<any>
3734
+
3735
+ /**
3736
+ * Scores a single task output. The return type selects the metric:
3737
+ * `boolean` -> boolean, `number` -> score, anything else -> categorical.
3738
+ */
3739
+ type ExperimentEvaluator = (input: any, output: any, expectedOutput: any) => any | Promise<any>
3740
+
3741
+ interface ExperimentOptions {
3742
+ name: string
3743
+ dataset: Dataset
3744
+ task: ExperimentTask
3745
+ /** Evaluators keyed by metric label. */
3746
+ evaluators?: Record<string, ExperimentEvaluator>
3747
+ description?: string
3748
+ config?: Record<string, any>
3749
+ tags?: Record<string, string>
3750
+ }
3751
+
3752
+ interface PullDatasetOptions {
3753
+ /** Wait until at least this many records are readable (absorbs write lag). */
3754
+ expectedRecordCount?: number
3755
+ /** Maximum total time to wait, in ms. Default 30000. */
3756
+ maxWaitMs?: number
3757
+ }
3758
+
3759
+ interface ExperimentResultRow {
3760
+ index: number
3761
+ spanId: string
3762
+ traceId: string
3763
+ startNs: number
3764
+ durationNs: number
3765
+ input: any
3766
+ output: any
3767
+ expectedOutput: any
3768
+ readonly isError: boolean
3769
+ errorType: string | null
3770
+ errorMessage: string | null
3771
+ evaluations: Record<string, any>
3772
+ evaluationErrors: Record<string, string>
3773
+ }
3774
+
3775
+ interface ExperimentResult {
3776
+ experimentId: string
3777
+ rows: ExperimentResultRow[]
3778
+ /** Dashboard URL for the experiment. */
3779
+ url: string
3780
+ }
3781
+
3782
+ interface DatasetPushResult {
3783
+ /** Number of records from this push that were confirmed with a record id. */
3784
+ pushedCount: number
3785
+ /** Number of records attempted in this push. */
3786
+ totalCount: number
3787
+ }
3788
+
3789
+ interface Dataset {
3790
+ addRecord (input: any, expectedOutput?: any, metadata?: Record<string, any>): Dataset
3791
+ /** Creates the dataset remotely if needed and pushes any unpushed records. */
3792
+ push (): Promise<DatasetPushResult>
3793
+ name (): string
3794
+ id (): string | null
3795
+ projectId (): string | null
3796
+ records (): Array<{ input: any, expectedOutput: any, metadata: Record<string, any> }>
3797
+ /** Dashboard URL for the dataset, or null until pushed. */
3798
+ url (): string | null
3799
+ }
3800
+
3801
+ interface Experiment {
3802
+ name (): string
3803
+ experimentId (): string | null
3804
+ url (): string | null
3805
+ run (): Promise<ExperimentResult>
3806
+ }
3807
+
3808
+ interface Experiments {
3809
+ /** Create a local dataset buffer; pushed on the first experiment run. */
3810
+ createDataset (name: string, description?: string): Dataset
3811
+ /** Pull an existing dataset (with records) by name. */
3812
+ pullDataset (name: string, options?: PullDatasetOptions): Promise<Dataset>
3813
+ /** Build an experiment to run over a dataset. */
3814
+ experiment (options: ExperimentOptions): Experiment
3815
+ }
3816
+
3693
3817
  interface LLMObservabilitySpan {
3818
+ /**
3819
+ * The span kind
3820
+ */
3821
+ kind: spanKind,
3822
+
3694
3823
  /**
3695
3824
  * The input content associated with the span.
3696
3825
  */
@@ -3797,6 +3926,26 @@ declare namespace tracer {
3797
3926
  * Tool calls of the message
3798
3927
  */
3799
3928
  toolCalls?: ToolCall[],
3929
+
3930
+ /**
3931
+ * Audio segments attached to the message (e.g. speech input/output)
3932
+ */
3933
+ audioParts?: AudioPart[],
3934
+ }
3935
+
3936
+ /**
3937
+ * Represents an audio segment attached to an LLM chat model message.
3938
+ */
3939
+ interface AudioPart {
3940
+ /**
3941
+ * The MIME type of the audio (e.g. "audio/wav", "audio/mpeg")
3942
+ */
3943
+ mimeType: string,
3944
+
3945
+ /**
3946
+ * The audio content as a base64-encoded string
3947
+ */
3948
+ content: string,
3800
3949
  }
3801
3950
 
3802
3951
  /**
@@ -3867,6 +4016,13 @@ declare namespace tracer {
3867
4016
  template?: string | Message[]
3868
4017
  }
3869
4018
 
4019
+ interface ToolDefinition {
4020
+ name : string,
4021
+ description? : string,
4022
+ schema? : {[key : string] : any}
4023
+ version? : string
4024
+ }
4025
+
3870
4026
  /**
3871
4027
  * Annotation options for LLM Observability spans.
3872
4028
  */
@@ -3902,10 +4058,22 @@ declare namespace tracer {
3902
4058
  */
3903
4059
  tags?: { [key: string]: any },
3904
4060
 
4061
+ /**
4062
+ * List of tag keys to propagate to LLM Observability cost and token metrics emitted from this span.
4063
+ * Each key must already be present in `tags` from this call or from a previous annotation on the
4064
+ * same span.
4065
+ */
4066
+ costTags?: string[],
4067
+
3905
4068
  /**
3906
4069
  * A Prompt object that represents the prompt used for an LLM call. Only used on `llm` spans.
3907
4070
  */
3908
4071
  prompt?: Prompt,
4072
+ /**
4073
+ * A list of ToolDefinition object that represents the tools available to the LLM for this span
4074
+ * Each definition requires a `name` and optionally accepts `description`, `schema`, and `version`.
4075
+ * */
4076
+ toolDefinitions?: ToolDefinition[]
3909
4077
  }
3910
4078
 
3911
4079
  interface AnnotationContextOptions {
@@ -3914,6 +4082,13 @@ declare namespace tracer {
3914
4082
  */
3915
4083
  tags?: { [key: string]: any },
3916
4084
 
4085
+ /**
4086
+ * List of tag keys to propagate to LLM Observability cost and token metrics emitted from each span
4087
+ * in the context.
4088
+ * Each key must already be present in `tags` on the span when it starts.
4089
+ */
4090
+ costTags?: string[],
4091
+
3917
4092
  /**
3918
4093
  * Set to override the span name for any spans annotated within the returned context.
3919
4094
  */
@@ -4013,6 +4188,15 @@ declare namespace tracer {
4013
4188
  * Programmatic configuration takes precedence over the environment variables listed above.
4014
4189
  */
4015
4190
  agentlessEnabled?: boolean,
4191
+
4192
+ /**
4193
+ * The proportion of LLM Observability traces to sample, between `0` and `1` (inclusive).
4194
+ * The decision is computed once per trace, propagated across services, and recorded on every
4195
+ * span; spans are always sent and the decision is honored at ingestion time. Defaults to `1`.
4196
+ * @env DD_LLMOBS_SAMPLE_RATE
4197
+ * Programmatic configuration takes precedence over the environment variables listed above.
4198
+ */
4199
+ sampleRate?: number,
4016
4200
  }
4017
4201
 
4018
4202
  /** @hidden */