@depup/dd-trace 5.96.0-depup.0 → 6.4.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 (646) hide show
  1. package/LICENSE-3rdparty.csv +89 -104
  2. package/README.md +9 -3
  3. package/changes.json +8 -3
  4. package/ci/init.js +25 -5
  5. package/ci/vitest-no-worker-init-setup.mjs +430 -0
  6. package/ext/exporters.js +1 -0
  7. package/ext/tags.js +3 -0
  8. package/index.d.ts +349 -244
  9. package/index.electron.js +3 -0
  10. package/initialize.mjs +9 -8
  11. package/loader-hook.mjs +154 -47
  12. package/package.json +121 -79
  13. package/packages/datadog-core/src/storage.js +47 -48
  14. package/packages/datadog-esbuild/index.js +52 -10
  15. package/packages/datadog-esbuild/src/utils.js +46 -3
  16. package/packages/datadog-instrumentations/src/aerospike.js +3 -3
  17. package/packages/datadog-instrumentations/src/ai.js +131 -76
  18. package/packages/datadog-instrumentations/src/amqplib.js +6 -7
  19. package/packages/datadog-instrumentations/src/anthropic.js +10 -10
  20. package/packages/datadog-instrumentations/src/apollo-server-core.js +3 -3
  21. package/packages/datadog-instrumentations/src/apollo-server.js +10 -18
  22. package/packages/datadog-instrumentations/src/avsc.js +6 -6
  23. package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js-context-methods.js +18 -0
  24. package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js.js +111 -0
  25. package/packages/datadog-instrumentations/src/aws-sdk.js +172 -72
  26. package/packages/datadog-instrumentations/src/azure-cosmos.js +7 -0
  27. package/packages/datadog-instrumentations/src/azure-durable-functions.js +8 -8
  28. package/packages/datadog-instrumentations/src/azure-functions.js +3 -0
  29. package/packages/datadog-instrumentations/src/bluebird.js +2 -2
  30. package/packages/datadog-instrumentations/src/body-parser.js +5 -2
  31. package/packages/datadog-instrumentations/src/cassandra-driver.js +12 -9
  32. package/packages/datadog-instrumentations/src/child_process.js +22 -32
  33. package/packages/datadog-instrumentations/src/claude-agent-sdk.js +587 -0
  34. package/packages/datadog-instrumentations/src/confluentinc-kafka-javascript.js +41 -24
  35. package/packages/datadog-instrumentations/src/connect.js +14 -12
  36. package/packages/datadog-instrumentations/src/cookie-parser.js +5 -4
  37. package/packages/datadog-instrumentations/src/cookie.js +9 -3
  38. package/packages/datadog-instrumentations/src/couchbase.js +73 -238
  39. package/packages/datadog-instrumentations/src/crypto.js +50 -6
  40. package/packages/datadog-instrumentations/src/cucumber-worker-threads.js +19 -0
  41. package/packages/datadog-instrumentations/src/cucumber.js +751 -188
  42. package/packages/datadog-instrumentations/src/cypress-config.js +432 -0
  43. package/packages/datadog-instrumentations/src/cypress.js +88 -4
  44. package/packages/datadog-instrumentations/src/dns.js +61 -61
  45. package/packages/datadog-instrumentations/src/elasticsearch.js +9 -12
  46. package/packages/datadog-instrumentations/src/electron/preload.js +42 -0
  47. package/packages/datadog-instrumentations/src/electron.js +240 -0
  48. package/packages/datadog-instrumentations/src/express-mongo-sanitize.js +11 -9
  49. package/packages/datadog-instrumentations/src/express-session.js +14 -13
  50. package/packages/datadog-instrumentations/src/express.js +56 -34
  51. package/packages/datadog-instrumentations/src/fastify.js +169 -86
  52. package/packages/datadog-instrumentations/src/fetch.js +5 -5
  53. package/packages/datadog-instrumentations/src/fs.js +47 -47
  54. package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +5 -7
  55. package/packages/datadog-instrumentations/src/google-genai.js +4 -4
  56. package/packages/datadog-instrumentations/src/graphql.js +26 -362
  57. package/packages/datadog-instrumentations/src/grpc/client.js +48 -32
  58. package/packages/datadog-instrumentations/src/grpc/server.js +20 -2
  59. package/packages/datadog-instrumentations/src/hapi.js +2 -2
  60. package/packages/datadog-instrumentations/src/helpers/bundler-register.js +41 -13
  61. package/packages/datadog-instrumentations/src/helpers/callback-instrumentor.js +74 -0
  62. package/packages/datadog-instrumentations/src/helpers/check-require-cache.js +85 -9
  63. package/packages/datadog-instrumentations/src/helpers/hook.js +34 -6
  64. package/packages/datadog-instrumentations/src/helpers/hooks.js +24 -19
  65. package/packages/datadog-instrumentations/src/helpers/instrument.js +61 -14
  66. package/packages/datadog-instrumentations/src/helpers/kafka.js +58 -0
  67. package/packages/datadog-instrumentations/src/helpers/optional-peer-bundler.js +65 -0
  68. package/packages/datadog-instrumentations/src/helpers/promise-instrumentor.js +42 -0
  69. package/packages/datadog-instrumentations/src/helpers/promise.js +2 -2
  70. package/packages/datadog-instrumentations/src/helpers/register.js +109 -146
  71. package/packages/datadog-instrumentations/src/helpers/require-optional-peer.js +17 -0
  72. package/packages/datadog-instrumentations/src/helpers/rewriter/compiler.js +13 -5
  73. package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +24 -7
  74. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/ai.js +6 -6
  75. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/aws-durable-execution-sdk-js.js +31 -0
  76. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/azure-cosmos.js +50 -0
  77. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/claude-agent-sdk.js +17 -0
  78. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql.js +201 -0
  79. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +7 -0
  80. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/langgraph.js +4 -2
  81. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/mercurius.js +31 -0
  82. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/modelcontextprotocol-sdk.js +35 -0
  83. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/playwright.js +85 -0
  84. package/packages/datadog-instrumentations/src/helpers/rewriter/loader.mjs +18 -2
  85. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +49 -224
  86. package/packages/datadog-instrumentations/src/helpers/router-helper.js +8 -8
  87. package/packages/datadog-instrumentations/src/hono.js +71 -9
  88. package/packages/datadog-instrumentations/src/http/client.js +50 -27
  89. package/packages/datadog-instrumentations/src/http/server.js +77 -34
  90. package/packages/datadog-instrumentations/src/http2/client.js +16 -15
  91. package/packages/datadog-instrumentations/src/http2/server.js +156 -25
  92. package/packages/datadog-instrumentations/src/ioredis.js +17 -14
  93. package/packages/datadog-instrumentations/src/iovalkey.js +1 -2
  94. package/packages/datadog-instrumentations/src/jest/bail-reporter.js +42 -0
  95. package/packages/datadog-instrumentations/src/jest/coverage-backfill.js +163 -0
  96. package/packages/datadog-instrumentations/src/jest.js +1795 -404
  97. package/packages/datadog-instrumentations/src/kafkajs.js +284 -170
  98. package/packages/datadog-instrumentations/src/knex.js +17 -17
  99. package/packages/datadog-instrumentations/src/koa.js +15 -14
  100. package/packages/datadog-instrumentations/src/ldapjs.js +5 -5
  101. package/packages/datadog-instrumentations/src/light-my-request.js +2 -2
  102. package/packages/datadog-instrumentations/src/limitd-client.js +5 -5
  103. package/packages/datadog-instrumentations/src/lodash.js +4 -4
  104. package/packages/datadog-instrumentations/src/mariadb.js +18 -16
  105. package/packages/datadog-instrumentations/src/memcached.js +4 -3
  106. package/packages/datadog-instrumentations/src/mercurius.js +11 -0
  107. package/packages/datadog-instrumentations/src/microgateway-core.js +2 -2
  108. package/packages/datadog-instrumentations/src/mocha/common.js +7 -4
  109. package/packages/datadog-instrumentations/src/mocha/main.js +557 -118
  110. package/packages/datadog-instrumentations/src/mocha/utils.js +531 -128
  111. package/packages/datadog-instrumentations/src/mocha/worker.js +27 -9
  112. package/packages/datadog-instrumentations/src/modelcontextprotocol-sdk.js +254 -0
  113. package/packages/datadog-instrumentations/src/mongodb-core.js +43 -31
  114. package/packages/datadog-instrumentations/src/mongodb.js +79 -5
  115. package/packages/datadog-instrumentations/src/mongoose.js +43 -34
  116. package/packages/datadog-instrumentations/src/mquery.js +5 -5
  117. package/packages/datadog-instrumentations/src/multer.js +5 -4
  118. package/packages/datadog-instrumentations/src/mysql.js +17 -17
  119. package/packages/datadog-instrumentations/src/mysql2.js +39 -5
  120. package/packages/datadog-instrumentations/src/nats.js +182 -0
  121. package/packages/datadog-instrumentations/src/net.js +21 -19
  122. package/packages/datadog-instrumentations/src/next.js +44 -10
  123. package/packages/datadog-instrumentations/src/nyc.js +43 -6
  124. package/packages/datadog-instrumentations/src/openai.js +124 -38
  125. package/packages/datadog-instrumentations/src/oracledb.js +12 -7
  126. package/packages/datadog-instrumentations/src/otel-sdk-trace.js +27 -6
  127. package/packages/datadog-instrumentations/src/passport-utils.js +5 -5
  128. package/packages/datadog-instrumentations/src/path-to-regexp.js +44 -0
  129. package/packages/datadog-instrumentations/src/pg.js +58 -25
  130. package/packages/datadog-instrumentations/src/pino.js +26 -42
  131. package/packages/datadog-instrumentations/src/playwright-browser-scripts.js +27 -0
  132. package/packages/datadog-instrumentations/src/playwright.js +1090 -351
  133. package/packages/datadog-instrumentations/src/prisma.js +1 -2
  134. package/packages/datadog-instrumentations/src/protobufjs.js +16 -16
  135. package/packages/datadog-instrumentations/src/redis.js +28 -15
  136. package/packages/datadog-instrumentations/src/restify.js +6 -5
  137. package/packages/datadog-instrumentations/src/router.js +243 -87
  138. package/packages/datadog-instrumentations/src/selenium.js +5 -3
  139. package/packages/datadog-instrumentations/src/sequelize.js +1 -1
  140. package/packages/datadog-instrumentations/src/stripe.js +47 -33
  141. package/packages/datadog-instrumentations/src/tedious.js +28 -0
  142. package/packages/datadog-instrumentations/src/url.js +1 -3
  143. package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +1297 -0
  144. package/packages/datadog-instrumentations/src/vitest-main.js +1592 -0
  145. package/packages/datadog-instrumentations/src/vitest-util.js +251 -0
  146. package/packages/datadog-instrumentations/src/vitest-worker.js +822 -0
  147. package/packages/datadog-instrumentations/src/vitest.js +11 -1258
  148. package/packages/datadog-instrumentations/src/vm.js +1 -3
  149. package/packages/datadog-instrumentations/src/winston.js +4 -4
  150. package/packages/datadog-instrumentations/src/ws.js +7 -7
  151. package/packages/datadog-instrumentations/src/zlib.js +29 -0
  152. package/packages/datadog-plugin-ai/src/index.js +1 -1
  153. package/packages/datadog-plugin-ai/src/tracing.js +66 -3
  154. package/packages/datadog-plugin-ai/src/utils.js +17 -4
  155. package/packages/datadog-plugin-apollo/src/gateway/request.js +1 -21
  156. package/packages/datadog-plugin-avsc/src/schema_iterator.js +3 -3
  157. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/checkpoint.js +31 -0
  158. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/client.js +55 -0
  159. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/context.js +123 -0
  160. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/handler.js +129 -0
  161. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/index.js +19 -0
  162. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/trace-checkpoint.js +224 -0
  163. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/util.js +79 -0
  164. package/packages/datadog-plugin-aws-sdk/src/base.js +90 -53
  165. package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/tracing.js +1 -1
  166. package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +218 -4
  167. package/packages/datadog-plugin-aws-sdk/src/services/cloudwatchlogs.js +1 -1
  168. package/packages/datadog-plugin-aws-sdk/src/services/dynamodb.js +2 -1
  169. package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +59 -14
  170. package/packages/datadog-plugin-aws-sdk/src/services/kinesis.js +174 -75
  171. package/packages/datadog-plugin-aws-sdk/src/services/lambda.js +34 -23
  172. package/packages/datadog-plugin-aws-sdk/src/services/redshift.js +2 -1
  173. package/packages/datadog-plugin-aws-sdk/src/services/s3.js +1 -1
  174. package/packages/datadog-plugin-aws-sdk/src/services/sns.js +26 -26
  175. package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +187 -101
  176. package/packages/datadog-plugin-aws-sdk/src/services/stepfunctions.js +20 -18
  177. package/packages/datadog-plugin-azure-cosmos/src/index.js +144 -0
  178. package/packages/datadog-plugin-azure-event-hubs/src/producer.js +8 -15
  179. package/packages/datadog-plugin-azure-functions/src/index.js +7 -3
  180. package/packages/datadog-plugin-azure-service-bus/src/producer.js +5 -10
  181. package/packages/datadog-plugin-bullmq/src/consumer.js +5 -4
  182. package/packages/datadog-plugin-bullmq/src/filter.js +35 -0
  183. package/packages/datadog-plugin-bullmq/src/producer.js +121 -33
  184. package/packages/datadog-plugin-bunyan/src/index.js +28 -0
  185. package/packages/datadog-plugin-child_process/src/index.js +13 -2
  186. package/packages/datadog-plugin-child_process/src/scrub-cmd-params.js +6 -6
  187. package/packages/datadog-plugin-claude-agent-sdk/src/index.js +31 -0
  188. package/packages/datadog-plugin-claude-agent-sdk/src/tracing.js +107 -0
  189. package/packages/datadog-plugin-claude-agent-sdk/src/util.js +15 -0
  190. package/packages/datadog-plugin-couchbase/src/index.js +58 -52
  191. package/packages/datadog-plugin-cucumber/src/index.js +46 -24
  192. package/packages/datadog-plugin-cypress/src/cypress-plugin.js +1018 -97
  193. package/packages/datadog-plugin-cypress/src/index.js +104 -2
  194. package/packages/datadog-plugin-cypress/src/plugin.js +6 -14
  195. package/packages/datadog-plugin-cypress/src/source-map-utils.js +48 -1
  196. package/packages/datadog-plugin-cypress/src/support.js +180 -25
  197. package/packages/datadog-plugin-dd-trace-api/src/index.js +1 -1
  198. package/packages/datadog-plugin-dns/src/lookup.js +8 -6
  199. package/packages/datadog-plugin-elasticsearch/src/index.js +28 -8
  200. package/packages/datadog-plugin-electron/src/index.js +17 -0
  201. package/packages/datadog-plugin-electron/src/ipc.js +143 -0
  202. package/packages/datadog-plugin-electron/src/net.js +82 -0
  203. package/packages/datadog-plugin-express/src/code_origin.js +1 -1
  204. package/packages/datadog-plugin-fastify/src/code_origin.js +1 -1
  205. package/packages/datadog-plugin-fs/src/index.js +2 -1
  206. package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +2 -5
  207. package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +27 -18
  208. package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-push-subscription.js +5 -8
  209. package/packages/datadog-plugin-graphql/src/execute.js +706 -34
  210. package/packages/datadog-plugin-graphql/src/index.js +43 -9
  211. package/packages/datadog-plugin-graphql/src/parse.js +45 -4
  212. package/packages/datadog-plugin-graphql/src/request.js +135 -0
  213. package/packages/datadog-plugin-graphql/src/tools/signature.js +32 -7
  214. package/packages/datadog-plugin-graphql/src/tools/transforms.js +118 -100
  215. package/packages/datadog-plugin-graphql/src/utils.js +261 -3
  216. package/packages/datadog-plugin-graphql/src/validate.js +53 -7
  217. package/packages/datadog-plugin-grpc/src/client.js +7 -8
  218. package/packages/datadog-plugin-grpc/src/server.js +1 -1
  219. package/packages/datadog-plugin-grpc/src/util.js +57 -22
  220. package/packages/datadog-plugin-http/src/client.js +12 -14
  221. package/packages/datadog-plugin-http/src/index.js +6 -8
  222. package/packages/datadog-plugin-http/src/server.js +63 -20
  223. package/packages/datadog-plugin-http2/src/client.js +6 -3
  224. package/packages/datadog-plugin-http2/src/server.js +48 -8
  225. package/packages/datadog-plugin-jest/src/index.js +136 -68
  226. package/packages/datadog-plugin-jest/src/util.js +37 -16
  227. package/packages/datadog-plugin-kafkajs/src/batch-consumer.js +31 -4
  228. package/packages/datadog-plugin-kafkajs/src/consumer.js +2 -9
  229. package/packages/datadog-plugin-kafkajs/src/producer.js +37 -8
  230. package/packages/datadog-plugin-langgraph/src/stream.js +1 -1
  231. package/packages/datadog-plugin-memcached/src/index.js +1 -1
  232. package/packages/datadog-plugin-mocha/src/index.js +66 -17
  233. package/packages/datadog-plugin-modelcontextprotocol-sdk/src/index.js +24 -0
  234. package/packages/datadog-plugin-modelcontextprotocol-sdk/src/tracing.js +173 -0
  235. package/packages/datadog-plugin-modelcontextprotocol-sdk/src/utils.js +30 -0
  236. package/packages/datadog-plugin-mongodb-core/src/bulk-write.js +43 -0
  237. package/packages/datadog-plugin-mongodb-core/src/index.js +8 -206
  238. package/packages/datadog-plugin-mongodb-core/src/query.js +452 -0
  239. package/packages/datadog-plugin-mysql/src/index.js +9 -4
  240. package/packages/datadog-plugin-nats/src/consumer.js +43 -0
  241. package/packages/datadog-plugin-nats/src/index.js +20 -0
  242. package/packages/datadog-plugin-nats/src/producer.js +62 -0
  243. package/packages/datadog-plugin-nats/src/util.js +33 -0
  244. package/packages/datadog-plugin-next/src/index.js +14 -18
  245. package/packages/datadog-plugin-openai/src/services.js +5 -3
  246. package/packages/datadog-plugin-openai/src/tracing.js +27 -25
  247. package/packages/datadog-plugin-oracledb/src/index.js +13 -2
  248. package/packages/datadog-plugin-pg/src/index.js +13 -3
  249. package/packages/datadog-plugin-pino/src/index.js +42 -0
  250. package/packages/datadog-plugin-playwright/src/index.js +21 -11
  251. package/packages/datadog-plugin-protobufjs/src/schema_iterator.js +3 -3
  252. package/packages/datadog-plugin-redis/src/index.js +54 -25
  253. package/packages/datadog-plugin-rhea/src/producer.js +1 -1
  254. package/packages/datadog-plugin-router/src/index.js +46 -44
  255. package/packages/datadog-plugin-selenium/src/index.js +1 -1
  256. package/packages/datadog-plugin-tedious/src/index.js +1 -1
  257. package/packages/datadog-plugin-undici/src/index.js +24 -2
  258. package/packages/datadog-plugin-vitest/src/index.js +160 -90
  259. package/packages/datadog-plugin-winston/src/index.js +30 -0
  260. package/packages/datadog-plugin-ws/src/close.js +3 -1
  261. package/packages/datadog-plugin-ws/src/producer.js +2 -0
  262. package/packages/datadog-plugin-ws/src/receiver.js +2 -1
  263. package/packages/datadog-shimmer/src/shimmer.js +101 -39
  264. package/packages/datadog-webpack/index.js +20 -4
  265. package/packages/datadog-webpack/src/optional-peer-loader.js +17 -0
  266. package/packages/dd-trace/index.electron.js +3 -0
  267. package/packages/dd-trace/index.js +2 -34
  268. package/packages/dd-trace/src/aiguard/channels.js +7 -0
  269. package/packages/dd-trace/src/aiguard/index.js +16 -34
  270. package/packages/dd-trace/src/aiguard/integrations/evaluate.js +46 -0
  271. package/packages/dd-trace/src/aiguard/integrations/index.js +34 -0
  272. package/packages/dd-trace/src/aiguard/integrations/openai.js +80 -0
  273. package/packages/dd-trace/src/aiguard/integrations/vercel-ai.js +92 -0
  274. package/packages/dd-trace/src/aiguard/messages/openai.js +382 -0
  275. package/packages/{datadog-instrumentations/src/helpers/ai-messages.js → dd-trace/src/aiguard/messages/vercel-ai.js} +30 -27
  276. package/packages/dd-trace/src/aiguard/sdk.js +151 -54
  277. package/packages/dd-trace/src/aiguard/tags.js +26 -10
  278. package/packages/dd-trace/src/appsec/api_security/index.js +55 -0
  279. package/packages/dd-trace/src/appsec/api_security/sampler.js +147 -0
  280. package/packages/dd-trace/src/appsec/blocked_templates.js +4 -3
  281. package/packages/dd-trace/src/appsec/blocking.js +84 -41
  282. package/packages/dd-trace/src/appsec/channels.js +5 -1
  283. package/packages/dd-trace/src/appsec/downstream_requests.js +116 -62
  284. package/packages/dd-trace/src/appsec/graphql.js +20 -17
  285. package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-password-rules.js +1 -1
  286. package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-secret-rules.js +81 -81
  287. package/packages/dd-trace/src/appsec/iast/analyzers/nosql-injection-mongodb-analyzer.js +23 -23
  288. package/packages/dd-trace/src/appsec/iast/iast-plugin.js +1 -1
  289. package/packages/dd-trace/src/appsec/iast/index.js +3 -2
  290. package/packages/dd-trace/src/appsec/iast/security-controls/index.js +4 -4
  291. package/packages/dd-trace/src/appsec/iast/taint-tracking/plugins/kafka.js +2 -2
  292. package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +4 -4
  293. package/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js +2 -2
  294. package/packages/dd-trace/src/appsec/iast/telemetry/index.js +2 -1
  295. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/ldap-sensitive-analyzer.js +54 -12
  296. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/url-sensitive-analyzer.js +5 -1
  297. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +32 -5
  298. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/index.js +1 -3
  299. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +84 -49
  300. package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +1 -1
  301. package/packages/dd-trace/src/appsec/index.js +65 -47
  302. package/packages/dd-trace/src/appsec/lambda.js +135 -0
  303. package/packages/dd-trace/src/appsec/rasp/command_injection.js +4 -5
  304. package/packages/dd-trace/src/appsec/rasp/lfi.js +8 -4
  305. package/packages/dd-trace/src/appsec/rasp/sql_injection.js +5 -10
  306. package/packages/dd-trace/src/appsec/rasp/ssrf.js +26 -18
  307. package/packages/dd-trace/src/appsec/recommended.json +2438 -13
  308. package/packages/dd-trace/src/appsec/remote_config.js +1 -0
  309. package/packages/dd-trace/src/appsec/reporter.js +87 -28
  310. package/packages/dd-trace/src/appsec/rule_manager.js +4 -2
  311. package/packages/dd-trace/src/appsec/sdk/index.js +4 -0
  312. package/packages/dd-trace/src/appsec/sdk/set_user.js +1 -1
  313. package/packages/dd-trace/src/appsec/sdk/track_event.js +5 -5
  314. package/packages/dd-trace/src/appsec/sdk/user_blocking.js +7 -11
  315. package/packages/dd-trace/src/appsec/sdk/utils.js +5 -3
  316. package/packages/dd-trace/src/appsec/store.js +50 -0
  317. package/packages/dd-trace/src/appsec/telemetry/api_security.js +34 -0
  318. package/packages/dd-trace/src/appsec/telemetry/index.js +27 -1
  319. package/packages/dd-trace/src/appsec/user_tracking.js +5 -4
  320. package/packages/dd-trace/src/appsec/waf/index.js +19 -9
  321. package/packages/dd-trace/src/appsec/waf/waf_context_wrapper.js +35 -20
  322. package/packages/dd-trace/src/appsec/waf/waf_manager.js +1 -1
  323. package/packages/dd-trace/src/azure_metadata.js +17 -6
  324. package/packages/dd-trace/src/baggage.js +32 -13
  325. package/packages/dd-trace/src/bootstrap.js +39 -0
  326. package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/index.js +36 -6
  327. package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +122 -24
  328. package/packages/dd-trace/src/ci-visibility/early-flake-detection/get-known-tests.js +22 -7
  329. package/packages/dd-trace/src/ci-visibility/exporters/agent-proxy/index.js +5 -2
  330. package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +2 -2
  331. package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +2 -2
  332. package/packages/dd-trace/src/ci-visibility/exporters/agentless/index.js +6 -2
  333. package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +2 -2
  334. package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +148 -25
  335. package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +3 -4
  336. package/packages/dd-trace/src/ci-visibility/exporters/test-worker/index.js +28 -10
  337. package/packages/dd-trace/src/ci-visibility/exporters/test-worker/writer.js +22 -0
  338. package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +105 -22
  339. package/packages/dd-trace/src/ci-visibility/lage.js +2 -1
  340. package/packages/dd-trace/src/ci-visibility/log-submission/log-submission-plugin.js +4 -5
  341. package/packages/dd-trace/src/ci-visibility/requests/fs-cache.js +4 -5
  342. package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +73 -55
  343. package/packages/dd-trace/src/ci-visibility/requests/request.js +14 -50
  344. package/packages/dd-trace/src/ci-visibility/requests/upload-coverage-report.js +4 -4
  345. package/packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js +156 -0
  346. package/packages/dd-trace/src/ci-visibility/test-api-manual/test-api-manual-plugin.js +9 -3
  347. package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +24 -6
  348. package/packages/dd-trace/src/ci-visibility/test-optimization-cache.js +70 -6
  349. package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache-schema.js +128 -0
  350. package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache.js +291 -0
  351. package/packages/dd-trace/src/config/config-types.d.ts +8 -6
  352. package/packages/dd-trace/src/config/defaults.js +341 -144
  353. package/packages/dd-trace/src/config/generated-config-types.d.ts +679 -131
  354. package/packages/dd-trace/src/config/git_properties.js +2 -2
  355. package/packages/dd-trace/src/config/helper.js +183 -28
  356. package/packages/dd-trace/src/config/index.js +565 -1515
  357. package/packages/dd-trace/src/config/major-overrides.js +100 -0
  358. package/packages/dd-trace/src/config/normalize-service.js +31 -0
  359. package/packages/dd-trace/src/config/parsers.js +384 -0
  360. package/packages/dd-trace/src/config/remote_config.js +59 -2
  361. package/packages/dd-trace/src/config/supported-configurations.json +638 -530
  362. package/packages/dd-trace/src/constants.js +15 -0
  363. package/packages/dd-trace/src/crashtracking/crashtracker.js +25 -7
  364. package/packages/dd-trace/src/crashtracking/index.js +1 -7
  365. package/packages/dd-trace/src/datastreams/checkpointer.js +6 -12
  366. package/packages/dd-trace/src/datastreams/context.js +4 -2
  367. package/packages/dd-trace/src/datastreams/encoding.js +39 -28
  368. package/packages/dd-trace/src/datastreams/index.js +2 -1
  369. package/packages/dd-trace/src/datastreams/manager.js +1 -1
  370. package/packages/dd-trace/src/datastreams/pathway.js +35 -30
  371. package/packages/dd-trace/src/datastreams/processor.js +31 -22
  372. package/packages/dd-trace/src/datastreams/size.js +6 -2
  373. package/packages/dd-trace/src/datastreams/writer.js +15 -6
  374. package/packages/dd-trace/src/debugger/config.js +9 -4
  375. package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +49 -35
  376. package/packages/dd-trace/src/debugger/devtools_client/condition.js +5 -8
  377. package/packages/dd-trace/src/debugger/devtools_client/config.js +3 -2
  378. package/packages/dd-trace/src/debugger/devtools_client/index.js +33 -71
  379. package/packages/dd-trace/src/debugger/devtools_client/probe_sampler.js +83 -0
  380. package/packages/dd-trace/src/debugger/devtools_client/send.js +27 -6
  381. package/packages/dd-trace/src/debugger/devtools_client/snapshot/collector.js +2 -2
  382. package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +5 -2
  383. package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +1 -0
  384. package/packages/dd-trace/src/debugger/devtools_client/source-maps.js +1 -1
  385. package/packages/dd-trace/src/debugger/devtools_client/state.js +3 -1
  386. package/packages/dd-trace/src/debugger/index.js +14 -10
  387. package/packages/dd-trace/src/debugger/probe_sampler.js +112 -0
  388. package/packages/dd-trace/src/debugger/probe_sampler_constants.js +19 -0
  389. package/packages/dd-trace/src/dogstatsd.js +45 -36
  390. package/packages/dd-trace/src/encode/0.4.js +830 -269
  391. package/packages/dd-trace/src/encode/0.5.js +158 -22
  392. package/packages/dd-trace/src/encode/agentless-ci-visibility.js +141 -65
  393. package/packages/dd-trace/src/encode/agentless-json.js +12 -6
  394. package/packages/dd-trace/src/encode/coverage-ci-visibility.js +52 -15
  395. package/packages/dd-trace/src/encode/span-stats.js +19 -16
  396. package/packages/dd-trace/src/encode/tags-processors.js +30 -25
  397. package/packages/dd-trace/src/exporter.js +3 -1
  398. package/packages/dd-trace/src/exporters/agent/index.js +4 -5
  399. package/packages/dd-trace/src/exporters/agent/writer.js +8 -3
  400. package/packages/dd-trace/src/exporters/agentless/index.js +12 -13
  401. package/packages/dd-trace/src/exporters/agentless/intake.js +43 -0
  402. package/packages/dd-trace/src/exporters/agentless/writer.js +12 -11
  403. package/packages/dd-trace/src/exporters/common/agents.js +3 -1
  404. package/packages/dd-trace/src/exporters/common/buffering-exporter.js +3 -3
  405. package/packages/dd-trace/src/exporters/common/request.js +55 -26
  406. package/packages/dd-trace/src/exporters/common/retry.js +104 -0
  407. package/packages/dd-trace/src/exporters/common/url.js +34 -0
  408. package/packages/dd-trace/src/exporters/common/util.js +2 -2
  409. package/packages/dd-trace/src/exporters/common/writer.js +29 -3
  410. package/packages/dd-trace/src/exporters/electron/index.js +49 -0
  411. package/packages/dd-trace/src/exporters/span-stats/index.js +1 -2
  412. package/packages/dd-trace/src/exporters/span-stats/writer.js +1 -3
  413. package/packages/dd-trace/src/external-logger/src/index.js +2 -1
  414. package/packages/dd-trace/src/feature-registry.js +22 -0
  415. package/packages/dd-trace/src/git_metadata.js +68 -0
  416. package/packages/dd-trace/src/git_metadata_tagger.js +13 -5
  417. package/packages/dd-trace/src/guardrails/index.js +11 -6
  418. package/packages/dd-trace/src/guardrails/telemetry.js +40 -3
  419. package/packages/dd-trace/src/heap_snapshots.js +7 -4
  420. package/packages/dd-trace/src/id.js +46 -27
  421. package/packages/dd-trace/src/index.js +6 -4
  422. package/packages/dd-trace/src/lambda/handler-paths.js +52 -0
  423. package/packages/dd-trace/src/lambda/handler.js +2 -6
  424. package/packages/dd-trace/src/lambda/index.js +62 -14
  425. package/packages/dd-trace/src/lambda/runtime/patch.js +21 -46
  426. package/packages/dd-trace/src/llmobs/constants/tags.js +13 -0
  427. package/packages/dd-trace/src/llmobs/index.js +41 -8
  428. package/packages/dd-trace/src/llmobs/plugins/ai/ddTelemetry.js +403 -0
  429. package/packages/dd-trace/src/llmobs/plugins/ai/index.js +8 -391
  430. package/packages/dd-trace/src/llmobs/plugins/ai/util.js +178 -18
  431. package/packages/dd-trace/src/llmobs/plugins/ai/vercelTelemetry.js +363 -0
  432. package/packages/dd-trace/src/llmobs/plugins/{anthropic.js → anthropic/index.js} +32 -79
  433. package/packages/dd-trace/src/llmobs/plugins/anthropic/util.js +109 -0
  434. package/packages/dd-trace/src/llmobs/plugins/base.js +4 -4
  435. package/packages/dd-trace/src/llmobs/plugins/bedrockruntime.js +92 -38
  436. package/packages/dd-trace/src/llmobs/plugins/claude-agent-sdk/index.js +270 -0
  437. package/packages/dd-trace/src/llmobs/plugins/claude-agent-sdk/utils.js +10 -0
  438. package/packages/dd-trace/src/llmobs/plugins/genai/index.js +5 -1
  439. package/packages/dd-trace/src/llmobs/plugins/genai/util.js +81 -16
  440. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chain.js +3 -2
  441. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chat_model.js +3 -2
  442. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/embedding.js +2 -1
  443. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/index.js +1 -50
  444. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/vectorstore.js +2 -1
  445. package/packages/dd-trace/src/llmobs/plugins/langchain/index.js +14 -8
  446. package/packages/dd-trace/src/llmobs/plugins/langchain/messages.js +76 -0
  447. package/packages/dd-trace/src/llmobs/plugins/langgraph/index.js +3 -28
  448. package/packages/dd-trace/src/llmobs/plugins/modelcontextprotocol-sdk/index.js +68 -0
  449. package/packages/dd-trace/src/llmobs/plugins/modelcontextprotocol-sdk/utils.js +57 -0
  450. package/packages/dd-trace/src/llmobs/plugins/openai/index.js +21 -51
  451. package/packages/dd-trace/src/llmobs/sdk.js +66 -41
  452. package/packages/dd-trace/src/llmobs/span_processor.js +91 -12
  453. package/packages/dd-trace/src/llmobs/tagger.js +135 -7
  454. package/packages/dd-trace/src/llmobs/telemetry.js +31 -1
  455. package/packages/dd-trace/src/llmobs/util.js +202 -9
  456. package/packages/dd-trace/src/llmobs/writers/base.js +13 -5
  457. package/packages/dd-trace/src/llmobs/writers/spans.js +1 -1
  458. package/packages/dd-trace/src/llmobs/writers/util.js +4 -2
  459. package/packages/dd-trace/src/log/index.js +28 -69
  460. package/packages/dd-trace/src/log/writer.js +10 -20
  461. package/packages/dd-trace/src/msgpack/chunk.js +430 -11
  462. package/packages/dd-trace/src/msgpack/index.js +101 -2
  463. package/packages/dd-trace/src/noop/proxy.js +13 -4
  464. package/packages/dd-trace/src/noop/span.js +3 -1
  465. package/packages/dd-trace/src/openfeature/encoding.js +70 -0
  466. package/packages/dd-trace/src/openfeature/eval-metrics-hook.js +103 -0
  467. package/packages/dd-trace/src/openfeature/flagging_provider.js +26 -1
  468. package/packages/dd-trace/src/openfeature/noop.js +40 -36
  469. package/packages/dd-trace/src/openfeature/register.js +46 -0
  470. package/packages/dd-trace/src/openfeature/remote_config.js +6 -1
  471. package/packages/dd-trace/src/openfeature/span-enrichment-hook.js +143 -0
  472. package/packages/dd-trace/src/openfeature/span-enrichment.js +149 -0
  473. package/packages/dd-trace/src/openfeature/writers/base.js +3 -11
  474. package/packages/dd-trace/src/openfeature/writers/exposures.js +82 -70
  475. package/packages/dd-trace/src/openfeature/writers/util.js +1 -2
  476. package/packages/dd-trace/src/opentelemetry/active-span-proxy.js +42 -0
  477. package/packages/dd-trace/src/opentelemetry/bridge-span-base.js +107 -0
  478. package/packages/dd-trace/src/opentelemetry/context_manager.js +27 -13
  479. package/packages/dd-trace/src/opentelemetry/logs/index.js +7 -7
  480. package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +3 -2
  481. package/packages/dd-trace/src/opentelemetry/metrics/index.js +62 -13
  482. package/packages/dd-trace/src/opentelemetry/metrics/instruments.js +28 -14
  483. package/packages/dd-trace/src/opentelemetry/metrics/meter.js +7 -10
  484. package/packages/dd-trace/src/opentelemetry/metrics/otlp_http_metric_exporter.js +3 -2
  485. package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_exporter.js +40 -0
  486. package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_transformer.js +169 -0
  487. package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +99 -5
  488. package/packages/dd-trace/src/opentelemetry/metrics/time.js +19 -0
  489. package/packages/dd-trace/src/opentelemetry/otlp/common.proto +2 -2
  490. package/packages/dd-trace/src/opentelemetry/otlp/logs.proto +1 -1
  491. package/packages/dd-trace/src/opentelemetry/otlp/logs_service.proto +1 -1
  492. package/packages/dd-trace/src/opentelemetry/otlp/metrics.proto +1 -1
  493. package/packages/dd-trace/src/opentelemetry/otlp/metrics_service.proto +1 -1
  494. package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +56 -82
  495. package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +1 -2
  496. package/packages/dd-trace/src/opentelemetry/otlp/protobuf_loader.js +14 -2
  497. package/packages/dd-trace/src/opentelemetry/otlp/trace.proto +358 -0
  498. package/packages/dd-trace/src/opentelemetry/otlp/trace_service.proto +78 -0
  499. package/packages/dd-trace/src/opentelemetry/span-helpers.js +325 -0
  500. package/packages/dd-trace/src/opentelemetry/span.js +59 -109
  501. package/packages/dd-trace/src/opentelemetry/span_context.js +1 -0
  502. package/packages/dd-trace/src/opentelemetry/span_processor.js +7 -5
  503. package/packages/dd-trace/src/opentelemetry/trace/index.js +75 -0
  504. package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +75 -0
  505. package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +375 -0
  506. package/packages/dd-trace/src/opentelemetry/tracer.js +20 -69
  507. package/packages/dd-trace/src/opentelemetry/tracer_provider.js +33 -17
  508. package/packages/dd-trace/src/opentracing/propagation/log.js +28 -8
  509. package/packages/dd-trace/src/opentracing/propagation/text_map.js +280 -145
  510. package/packages/dd-trace/src/opentracing/propagation/text_map_dsm.js +11 -11
  511. package/packages/dd-trace/src/opentracing/propagation/tracestate.js +98 -32
  512. package/packages/dd-trace/src/opentracing/span.js +127 -73
  513. package/packages/dd-trace/src/opentracing/span_context.js +68 -3
  514. package/packages/dd-trace/src/opentracing/tracer.js +46 -19
  515. package/packages/dd-trace/src/payload-tagging/config/index.js +8 -7
  516. package/packages/dd-trace/src/plugin_manager.js +44 -20
  517. package/packages/dd-trace/src/plugins/apollo.js +3 -1
  518. package/packages/dd-trace/src/plugins/ci_plugin.js +391 -85
  519. package/packages/dd-trace/src/plugins/database.js +61 -18
  520. package/packages/dd-trace/src/plugins/index.js +14 -0
  521. package/packages/dd-trace/src/plugins/log_injection.js +56 -0
  522. package/packages/dd-trace/src/plugins/log_plugin.js +4 -44
  523. package/packages/dd-trace/src/plugins/outbound.js +1 -1
  524. package/packages/dd-trace/src/plugins/plugin.js +22 -28
  525. package/packages/dd-trace/src/plugins/storage.js +2 -2
  526. package/packages/dd-trace/src/plugins/tracing.js +70 -13
  527. package/packages/dd-trace/src/plugins/util/ci.js +127 -40
  528. package/packages/dd-trace/src/plugins/util/git-cache.js +23 -23
  529. package/packages/dd-trace/src/plugins/util/git.js +3 -1
  530. package/packages/dd-trace/src/plugins/util/http-otel-semantics.js +276 -0
  531. package/packages/dd-trace/src/plugins/util/llm.js +6 -1
  532. package/packages/dd-trace/src/plugins/util/stacktrace.js +2 -2
  533. package/packages/dd-trace/src/plugins/util/test.js +894 -65
  534. package/packages/dd-trace/src/plugins/util/url.js +71 -5
  535. package/packages/dd-trace/src/plugins/util/user-provided-git.js +18 -16
  536. package/packages/dd-trace/src/plugins/util/web.js +116 -180
  537. package/packages/dd-trace/src/priority_sampler.js +12 -21
  538. package/packages/dd-trace/src/process-tags/index.js +3 -0
  539. package/packages/dd-trace/src/profiler.js +27 -2
  540. package/packages/dd-trace/src/profiling/config.js +145 -393
  541. package/packages/dd-trace/src/profiling/constants.js +4 -7
  542. package/packages/dd-trace/src/profiling/exporter_cli.js +10 -13
  543. package/packages/dd-trace/src/profiling/exporters/agent.js +61 -28
  544. package/packages/dd-trace/src/profiling/exporters/event_serializer.js +50 -15
  545. package/packages/dd-trace/src/profiling/exporters/file.js +16 -5
  546. package/packages/dd-trace/src/profiling/oom.js +71 -0
  547. package/packages/dd-trace/src/profiling/profiler.js +123 -132
  548. package/packages/dd-trace/src/profiling/profilers/event_plugins/crypto.js +32 -0
  549. package/packages/dd-trace/src/profiling/profilers/event_plugins/zlib.js +19 -0
  550. package/packages/dd-trace/src/profiling/profilers/events.js +57 -14
  551. package/packages/dd-trace/src/profiling/profilers/space.js +27 -16
  552. package/packages/dd-trace/src/profiling/profilers/wall.js +136 -39
  553. package/packages/dd-trace/src/profiling/ssi-heuristics.js +7 -4
  554. package/packages/dd-trace/src/propagation-hash/index.js +3 -2
  555. package/packages/dd-trace/src/proxy.js +82 -39
  556. package/packages/dd-trace/src/rate_limiter.js +1 -1
  557. package/packages/dd-trace/src/remote_config/index.js +9 -5
  558. package/packages/dd-trace/src/remote_config/scheduler.js +1 -1
  559. package/packages/dd-trace/src/require-package-json.js +8 -4
  560. package/packages/dd-trace/src/ritm.js +63 -28
  561. package/packages/dd-trace/src/runtime_metrics/client.js +30 -0
  562. package/packages/dd-trace/src/runtime_metrics/index.js +17 -4
  563. package/packages/dd-trace/src/runtime_metrics/otlp_runtime_metrics.js +284 -0
  564. package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +45 -41
  565. package/packages/dd-trace/src/sampler.js +1 -1
  566. package/packages/dd-trace/src/sampling_rule.js +7 -7
  567. package/packages/dd-trace/src/scope.js +10 -15
  568. package/packages/dd-trace/src/serverless.js +6 -7
  569. package/packages/dd-trace/src/service-naming/extra-services.js +14 -0
  570. package/packages/dd-trace/src/service-naming/index.js +1 -1
  571. package/packages/dd-trace/src/service-naming/schemas/definition.js +4 -1
  572. package/packages/dd-trace/src/service-naming/schemas/util.js +48 -3
  573. package/packages/dd-trace/src/service-naming/schemas/v0/graphql.js +6 -0
  574. package/packages/dd-trace/src/service-naming/schemas/v0/messaging.js +61 -2
  575. package/packages/dd-trace/src/service-naming/schemas/v0/serverless.js +12 -0
  576. package/packages/dd-trace/src/service-naming/schemas/v0/storage.js +60 -0
  577. package/packages/dd-trace/src/service-naming/schemas/v0/web.js +25 -1
  578. package/packages/dd-trace/src/service-naming/schemas/v0/websocket.js +5 -0
  579. package/packages/dd-trace/src/service-naming/schemas/v1/graphql.js +8 -0
  580. package/packages/dd-trace/src/service-naming/schemas/v1/messaging.js +32 -0
  581. package/packages/dd-trace/src/service-naming/schemas/v1/serverless.js +12 -0
  582. package/packages/dd-trace/src/service-naming/schemas/v1/storage.js +17 -0
  583. package/packages/dd-trace/src/service-naming/schemas/v1/web.js +23 -3
  584. package/packages/dd-trace/src/service-naming/schemas/v1/websocket.js +6 -0
  585. package/packages/dd-trace/src/service-naming/source-resolver.js +50 -0
  586. package/packages/dd-trace/src/span_format.js +269 -81
  587. package/packages/dd-trace/src/span_processor.js +13 -13
  588. package/packages/dd-trace/src/span_stats.js +101 -79
  589. package/packages/dd-trace/src/spanleak.js +1 -2
  590. package/packages/dd-trace/src/standalone/index.js +6 -25
  591. package/packages/dd-trace/src/startup-log.js +3 -3
  592. package/packages/dd-trace/src/tagger.js +2 -4
  593. package/packages/dd-trace/src/telemetry/dependencies.js +2 -2
  594. package/packages/dd-trace/src/telemetry/endpoints.js +7 -5
  595. package/packages/dd-trace/src/telemetry/index.js +2 -3
  596. package/packages/dd-trace/src/telemetry/logs/index.js +1 -1
  597. package/packages/dd-trace/src/telemetry/send-data.js +25 -39
  598. package/packages/dd-trace/src/telemetry/session-propagation.js +20 -45
  599. package/packages/dd-trace/src/telemetry/telemetry.js +42 -183
  600. package/packages/dd-trace/src/tracer.js +23 -9
  601. package/packages/dd-trace/src/tracer_metadata.js +1 -1
  602. package/packages/dd-trace/src/util.js +31 -9
  603. package/register.js +58 -1
  604. package/vendor/dist/@apm-js-collab/code-transformer/index.js +94 -42
  605. package/vendor/dist/@datadog/sketches-js/LICENSE +10 -36
  606. package/vendor/dist/@datadog/sketches-js/index.js +1 -1
  607. package/vendor/dist/pprof-format/index.js +1 -1
  608. package/vendor/dist/protobufjs/index.js +1 -1
  609. package/vendor/dist/protobufjs/minimal/index.js +1 -1
  610. package/vendor/dist/shell-quote/index.js +1 -1
  611. package/packages/datadog-plugin-graphql/src/resolve.js +0 -178
  612. package/packages/dd-trace/src/agent/url.js +0 -28
  613. package/packages/dd-trace/src/appsec/api_security_sampler.js +0 -117
  614. package/packages/dd-trace/src/lambda/runtime/ritm.js +0 -133
  615. package/packages/dd-trace/src/log/utils.js +0 -16
  616. package/packages/dd-trace/src/msgpack/encoder.js +0 -308
  617. package/packages/dd-trace/src/plugins/structured_log_plugin.js +0 -9
  618. package/scripts/preinstall.js +0 -34
  619. package/vendor/dist/ignore/LICENSE +0 -21
  620. package/vendor/dist/ignore/index.js +0 -1
  621. package/vendor/dist/opentracing/LICENSE +0 -201
  622. package/vendor/dist/opentracing/binary_carrier.d.ts +0 -11
  623. package/vendor/dist/opentracing/constants.d.ts +0 -61
  624. package/vendor/dist/opentracing/examples/demo/demo.d.ts +0 -2
  625. package/vendor/dist/opentracing/ext/tags.d.ts +0 -90
  626. package/vendor/dist/opentracing/functions.d.ts +0 -20
  627. package/vendor/dist/opentracing/global_tracer.d.ts +0 -14
  628. package/vendor/dist/opentracing/index.d.ts +0 -12
  629. package/vendor/dist/opentracing/index.js +0 -1
  630. package/vendor/dist/opentracing/mock_tracer/index.d.ts +0 -5
  631. package/vendor/dist/opentracing/mock_tracer/mock_context.d.ts +0 -13
  632. package/vendor/dist/opentracing/mock_tracer/mock_report.d.ts +0 -16
  633. package/vendor/dist/opentracing/mock_tracer/mock_span.d.ts +0 -50
  634. package/vendor/dist/opentracing/mock_tracer/mock_tracer.d.ts +0 -26
  635. package/vendor/dist/opentracing/noop.d.ts +0 -8
  636. package/vendor/dist/opentracing/reference.d.ts +0 -33
  637. package/vendor/dist/opentracing/span.d.ts +0 -147
  638. package/vendor/dist/opentracing/span_context.d.ts +0 -26
  639. package/vendor/dist/opentracing/test/api_compatibility.d.ts +0 -16
  640. package/vendor/dist/opentracing/test/mocktracer_implemenation.d.ts +0 -3
  641. package/vendor/dist/opentracing/test/noop_implementation.d.ts +0 -4
  642. package/vendor/dist/opentracing/test/opentracing_api.d.ts +0 -3
  643. package/vendor/dist/opentracing/test/unittest.d.ts +0 -2
  644. package/vendor/dist/opentracing/tracer.d.ts +0 -127
  645. package/vendor/dist/path-to-regexp/LICENSE +0 -21
  646. 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.
@@ -130,6 +136,11 @@ interface Tracer extends opentracing.Tracer {
130
136
 
131
137
  appsec: tracer.Appsec;
132
138
 
139
+ /**
140
+ * Profiling API for attaching custom labels to profiler samples.
141
+ */
142
+ profiling: tracer.Profiling;
143
+
133
144
  TracerProvider: tracer.opentelemetry.TracerProvider;
134
145
 
135
146
  dogstatsd: tracer.DogStatsD;
@@ -213,8 +224,8 @@ interface Tracer extends opentracing.Tracer {
213
224
  removeAllBaggageItems (): Record<string, string>;
214
225
  }
215
226
 
216
- // left out of the namespace, so it
217
- // 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.
218
229
  /** @hidden */
219
230
  interface Plugins {
220
231
  "aerospike": tracer.plugins.aerospike;
@@ -222,9 +233,12 @@ interface Plugins {
222
233
  "amqp10": tracer.plugins.amqp10;
223
234
  "amqplib": tracer.plugins.amqplib;
224
235
  "anthropic": tracer.plugins.anthropic;
236
+ "claude-agent-sdk": tracer.plugins.claude_agent_sdk;
225
237
  "apollo": tracer.plugins.apollo;
226
238
  "avsc": tracer.plugins.avsc;
239
+ "aws-durable-execution-sdk-js": tracer.plugins.aws_durable_execution_sdk_js;
227
240
  "aws-sdk": tracer.plugins.aws_sdk;
241
+ "azure-cosmos": tracer.plugins.azure_cosmos;
228
242
  "azure-event-hubs": tracer.plugins.azure_event_hubs;
229
243
  "azure-functions": tracer.plugins.azure_functions;
230
244
  "azure-service-bus": tracer.plugins.azure_service_bus;
@@ -240,12 +254,12 @@ interface Plugins {
240
254
  "cypress": tracer.plugins.cypress;
241
255
  "dns": tracer.plugins.dns;
242
256
  "elasticsearch": tracer.plugins.elasticsearch;
257
+ "electron": tracer.plugins.electron;
243
258
  "express": tracer.plugins.express;
244
259
  "fastify": tracer.plugins.fastify;
245
260
  "fetch": tracer.plugins.fetch;
246
261
  "find-my-way": tracer.plugins.find_my_way;
247
262
  "fs": tracer.plugins.fs;
248
- "generic-pool": tracer.plugins.generic_pool;
249
263
  "google-cloud-pubsub": tracer.plugins.google_cloud_pubsub;
250
264
  "google-cloud-vertexai": tracer.plugins.google_cloud_vertexai;
251
265
  "google-genai": tracer.plugins.google_genai;
@@ -259,7 +273,6 @@ interface Plugins {
259
273
  "iovalkey": tracer.plugins.iovalkey;
260
274
  "jest": tracer.plugins.jest;
261
275
  "kafkajs": tracer.plugins.kafkajs;
262
- "knex": tracer.plugins.knex;
263
276
  "koa": tracer.plugins.koa;
264
277
  "langchain": tracer.plugins.langchain;
265
278
  "langgraph": tracer.plugins.langgraph;
@@ -267,11 +280,13 @@ interface Plugins {
267
280
  "memcached": tracer.plugins.memcached;
268
281
  "microgateway-core": tracer.plugins.microgateway_core;
269
282
  "mocha": tracer.plugins.mocha;
283
+ "modelcontextprotocol-sdk": tracer.plugins.modelcontextprotocol_sdk;
270
284
  "moleculer": tracer.plugins.moleculer;
271
285
  "mongodb-core": tracer.plugins.mongodb_core;
272
286
  "mongoose": tracer.plugins.mongoose;
273
287
  "mysql": tracer.plugins.mysql;
274
288
  "mysql2": tracer.plugins.mysql2;
289
+ "nats": tracer.plugins.nats;
275
290
  "net": tracer.plugins.net;
276
291
  "next": tracer.plugins.next;
277
292
  "nyc": tracer.plugins.nyc;
@@ -346,17 +361,6 @@ declare namespace tracer {
346
361
  export interface Span extends opentracing.Span {
347
362
  context (): SpanContext;
348
363
 
349
- /**
350
- * Causally links another span to the current span
351
- *
352
- * @deprecated In favor of addLink(link: { context: SpanContext, attributes?: Object }).
353
- * This will be removed in the next major version.
354
- * @param {SpanContext} context The context of the span to link to.
355
- * @param {Object} attributes An optional key value pair of arbitrary values.
356
- * @returns {void}
357
- */
358
- addLink (context: SpanContext, attributes?: Object): void;
359
-
360
364
  /**
361
365
  * Adds a single link to the span.
362
366
  *
@@ -410,7 +414,7 @@ declare namespace tracer {
410
414
  */
411
415
  export interface SamplingRule {
412
416
  /**
413
- * Sampling rate for this rule.
417
+ * Sampling rate for this rule. A range between 0 and 1 representing the percent of traces sampled.
414
418
  */
415
419
  sampleRate: number
416
420
 
@@ -423,6 +427,22 @@ declare namespace tracer {
423
427
  * Operation name on which to apply this rule. The rule will apply to all operation names if not provided.
424
428
  */
425
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
426
446
  }
427
447
 
428
448
  /**
@@ -604,10 +624,10 @@ declare namespace tracer {
604
624
  rateLimit?: number,
605
625
 
606
626
  /**
607
- * Sampling rules to apply to priority sampling. Each rule is a JSON,
608
- * consisting of `service` and `name`, which are regexes to match against
609
- * a trace's `service` and `name`, and a corresponding `sampleRate`. If not
610
- * 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.
611
631
  * @default []
612
632
  * @env DD_TRACE_SAMPLING_RULES
613
633
  * Programmatic configuration takes precedence over the environment variables listed above.
@@ -644,23 +664,31 @@ declare namespace tracer {
644
664
  */
645
665
  runtimeMetrics?: boolean | {
646
666
 
647
- /**
667
+ /**
648
668
  * @env DD_RUNTIME_METRICS_ENABLED
649
669
  * Programmatic configuration takes precedence over the environment variables listed above.
650
670
  */
651
671
  enabled?: boolean,
652
672
 
653
- /**
673
+ /**
654
674
  * @env DD_RUNTIME_METRICS_GC_ENABLED
655
675
  * Programmatic configuration takes precedence over the environment variables listed above.
656
676
  */
657
677
  gc?: boolean,
658
678
 
659
- /**
679
+ /**
660
680
  * @env DD_RUNTIME_METRICS_EVENT_LOOP_ENABLED
661
681
  * Programmatic configuration takes precedence over the environment variables listed above.
662
682
  */
663
- 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
664
692
  }
665
693
 
666
694
  /**
@@ -685,28 +713,6 @@ declare namespace tracer {
685
713
  */
686
714
  protocolVersion?: string
687
715
 
688
- /**
689
- * Deprecated in favor of the global versions of the variables provided under this option
690
- *
691
- * @deprecated
692
- * @hidden
693
- */
694
- ingestion?: {
695
- /**
696
- * Controls the ingestion sample rate (between 0 and 1) between the agent and the backend.
697
- * @env DD_TRACE_SAMPLE_RATE
698
- * Programmatic configuration takes precedence over the environment variables listed above.
699
- */
700
- sampleRate?: number
701
-
702
- /**
703
- * Controls the ingestion rate limit between the agent and the backend. Defaults to deferring the decision to the agent.
704
- * @env DD_TRACE_RATE_LIMIT
705
- * Programmatic configuration takes precedence over the environment variables listed above.
706
- */
707
- rateLimit?: number
708
- };
709
-
710
716
  /**
711
717
  * Whether to enable inferred proxy services.
712
718
  * @default false
@@ -729,19 +735,12 @@ declare namespace tracer {
729
735
  */
730
736
  experimental?: {
731
737
 
732
- /**
733
- * @default false
734
- * @env DD_TRACE_EXPERIMENTAL_B3_ENABLED
735
- * Programmatic configuration takes precedence over the environment variables listed above.
736
- */
737
- b3?: boolean
738
-
739
738
  /**
740
739
  * Whether to write traces to log output or agentless, rather than send to an agent
741
740
  * @env DD_TRACE_EXPERIMENTAL_EXPORTER
742
741
  * Programmatic configuration takes precedence over the environment variables listed above.
743
742
  */
744
- exporter?: 'log' | 'agent' | 'datadog'
743
+ exporter?: 'log' | 'agent' | 'datadog' | 'electron'
745
744
 
746
745
  /**
747
746
  * Whether to enable the experimental `getRumData` method.
@@ -751,34 +750,6 @@ declare namespace tracer {
751
750
  */
752
751
  enableGetRumData?: boolean
753
752
 
754
- /**
755
- * Configuration of the IAST. Can be a boolean as an alias to `iast.enabled`.
756
- * @deprecated Please use the non-experimental `iast` option instead.
757
- */
758
- iast?: boolean | IastOptions
759
-
760
- /**
761
- * Configuration of the AppSec. Can be a boolean as an alias to `appsec.enabled`.
762
- * @deprecated Please use the non-experimental `appsec` option instead.
763
- */
764
- appsec?: boolean | {
765
- /**
766
- * Configuration of Standalone ASM mode
767
- * Deprecated in favor of `apmTracingEnabled`.
768
- *
769
- * @deprecated Please use `apmTracingEnabled` instead.
770
- */
771
- standalone?: {
772
- /**
773
- * Whether to enable Standalone ASM.
774
- * @default false
775
- * @env DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED
776
- * Programmatic configuration takes precedence over the environment variables listed above.
777
- */
778
- enabled?: boolean
779
- }
780
- } | TracerOptions['appsec'],
781
-
782
753
  aiguard?: {
783
754
  /**
784
755
  * Set to `true` to enable the SDK.
@@ -790,7 +761,7 @@ declare namespace tracer {
790
761
  * Whether to request blocking mode when evaluating prompts via auto-instrumentation.
791
762
  * When `true`, AI Guard will block requests that violate security policies.
792
763
  * When `false`, AI Guard evaluates but never blocks (monitor-only mode).
793
- * @default false
764
+ * @default true
794
765
  * @env DD_AI_GUARD_BLOCK
795
766
  * Programmatic configuration takes precedence over the environment variables listed above.
796
767
  */
@@ -847,6 +818,21 @@ declare namespace tracer {
847
818
  * Programmatic configuration takes precedence over the environment variables listed above.
848
819
  */
849
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
+ }
850
836
  }
851
837
  };
852
838
 
@@ -894,11 +880,20 @@ declare namespace tracer {
894
880
 
895
881
  /**
896
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
+ *
897
892
  * @default 'disabled'
898
893
  * @env DD_DBM_PROPAGATION_MODE
899
894
  * Programmatic configuration takes precedence over the environment variables listed above.
900
895
  */
901
- dbmPropagationMode?: 'disabled' | 'service' | 'full'
896
+ dbmPropagationMode?: 'disabled' | 'service' | 'full' | 'dynamic_service'
902
897
 
903
898
  /**
904
899
  * Whether to enable Data Streams Monitoring.
@@ -1056,15 +1051,6 @@ declare namespace tracer {
1056
1051
  * Programmatic configuration takes precedence over the environment variables listed above.
1057
1052
  */
1058
1053
  enabled?: boolean,
1059
-
1060
- /** Whether to enable request body collection on RASP event
1061
- * @default false
1062
- *
1063
- * @deprecated Use UI and Remote Configuration to enable extended data collection
1064
- * @env DD_APPSEC_RASP_COLLECT_REQUEST_BODY
1065
- * Programmatic configuration takes precedence over the environment variables listed above.
1066
- */
1067
- bodyCollection?: boolean
1068
1054
  },
1069
1055
  /**
1070
1056
  * Configuration for stack trace reporting
@@ -1091,39 +1077,6 @@ declare namespace tracer {
1091
1077
  */
1092
1078
  maxDepth?: number,
1093
1079
  },
1094
- /**
1095
- * Configuration for extended headers collection tied to security events
1096
- *
1097
- * @deprecated Use UI and Remote Configuration to enable extended data collection
1098
- */
1099
- extendedHeadersCollection?: {
1100
- /** Whether to enable extended headers collection
1101
- * @default false
1102
- *
1103
- * @deprecated Use UI and Remote Configuration to enable extended data collection
1104
- * @env DD_APPSEC_COLLECT_ALL_HEADERS
1105
- * Programmatic configuration takes precedence over the environment variables listed above.
1106
- */
1107
- enabled: boolean,
1108
-
1109
- /** Whether to redact collected headers
1110
- * @default true
1111
- *
1112
- * @deprecated Use UI and Remote Configuration to enable extended data collection
1113
- * @env DD_APPSEC_HEADER_COLLECTION_REDACTION_ENABLED
1114
- * Programmatic configuration takes precedence over the environment variables listed above.
1115
- */
1116
- redaction: boolean,
1117
-
1118
- /** Specifies the maximum number of headers collected.
1119
- * @default 50
1120
- *
1121
- * @deprecated Use UI and Remote Configuration to enable extended data collection
1122
- * @env DD_APPSEC_MAX_COLLECTED_HEADERS
1123
- * Programmatic configuration takes precedence over the environment variables listed above.
1124
- */
1125
- maxHeaders: number,
1126
- }
1127
1080
  }
1128
1081
 
1129
1082
  /**
@@ -1310,7 +1263,7 @@ declare namespace tracer {
1310
1263
 
1311
1264
  /**
1312
1265
  * Whether to use Datadog legacy baggage extraction and injection behavior.
1313
- * @default false
1266
+ * @default true
1314
1267
  * @env DD_TRACE_LEGACY_BAGGAGE_ENABLED
1315
1268
  * Programmatic configuration takes precedence over the environment variables listed above.
1316
1269
  */
@@ -1570,6 +1523,35 @@ declare namespace tracer {
1570
1523
  trackUserLoginFailure(login: string, metadata?: any): void;
1571
1524
  }
1572
1525
 
1526
+ export interface Profiling {
1527
+ /**
1528
+ * Declares the set of custom label keys that will be used with
1529
+ * {@link runWithLabels}. This is used for profile upload metadata
1530
+ * (so the Datadog UI knows which keys to index for filtering) and
1531
+ * for pprof serialization optimization.
1532
+ *
1533
+ * @param keys Custom label key names.
1534
+ */
1535
+ setCustomLabelKeys(keys: Iterable<string>): void;
1536
+
1537
+ /**
1538
+ * Runs a function with custom profiling labels attached to all wall profiler
1539
+ * samples taken during its execution. Labels are key-value pairs that appear
1540
+ * in the pprof output and can be used to filter flame graphs in the Datadog UI.
1541
+ *
1542
+ * Requires AsyncContextFrame (ACF) to be enabled. Supports nesting: inner
1543
+ * calls merge labels with outer calls, with inner values taking precedence.
1544
+ *
1545
+ * When profiling is not enabled or ACF is not active, the function is still
1546
+ * called but labels are silently dropped.
1547
+ *
1548
+ * @param labels Custom labels to attach to profiler samples.
1549
+ * @param fn Function to execute with the labels.
1550
+ * @returns The return value of fn.
1551
+ */
1552
+ runWithLabels<T>(labels: Record<string, string | number>, fn: () => T): T;
1553
+ }
1554
+
1573
1555
  export interface Appsec {
1574
1556
  /**
1575
1557
  * Links a successful login event to the current trace. Will link the passed user to the current trace with Appsec.setUser() internally.
@@ -1813,6 +1795,10 @@ declare namespace tracer {
1813
1795
  * List of tags associated with the evaluation (e.g. indirect-prompt-injection)
1814
1796
  */
1815
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 }
1816
1802
  /**
1817
1803
  * Sensitive Data Scanner findings from the evaluation.
1818
1804
  */
@@ -1832,6 +1818,10 @@ declare namespace tracer {
1832
1818
  * List of tags associated with the evaluation (e.g. indirect-prompt-injection)
1833
1819
  */
1834
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 }
1835
1825
  /**
1836
1826
  * Sensitive Data Scanner findings from the evaluation.
1837
1827
  */
@@ -1946,6 +1936,20 @@ declare namespace tracer {
1946
1936
  /** @hidden */
1947
1937
  interface Instrumentation extends Integration, Analyzable {}
1948
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
+
1949
1953
  /** @hidden */
1950
1954
  interface Http extends Instrumentation {
1951
1955
  /**
@@ -1959,14 +1963,6 @@ declare namespace tracer {
1959
1963
  */
1960
1964
  allowlist?: string | RegExp | ((urlOrPath: string) => boolean) | (string | RegExp | ((urlOrPath: string) => boolean))[];
1961
1965
 
1962
- /**
1963
- * Deprecated in favor of `allowlist`.
1964
- *
1965
- * @deprecated
1966
- * @hidden
1967
- */
1968
- whitelist?: string | RegExp | ((urlOrPath: string) => boolean) | (string | RegExp | ((urlOrPath: string) => boolean))[];
1969
-
1970
1966
  /**
1971
1967
  * List of URLs/paths that should not be instrumented. Takes precedence over
1972
1968
  * allowlist if a URL matches an entry in both.
@@ -1979,14 +1975,6 @@ declare namespace tracer {
1979
1975
  */
1980
1976
  blocklist?: string | RegExp | ((urlOrPath: string) => boolean) | (string | RegExp | ((urlOrPath: string) => boolean))[];
1981
1977
 
1982
- /**
1983
- * Deprecated in favor of `blocklist`.
1984
- *
1985
- * @deprecated
1986
- * @hidden
1987
- */
1988
- blacklist?: string | RegExp | ((urlOrPath: string) => boolean) | (string | RegExp | ((urlOrPath: string) => boolean))[];
1989
-
1990
1978
  /**
1991
1979
  * Custom filter function used to decide whether a URL/path is allowed.
1992
1980
  * When provided, this takes precedence over allowlist/blocklist configuration.
@@ -2166,7 +2154,7 @@ declare namespace tracer {
2166
2154
  }
2167
2155
 
2168
2156
  /** @hidden */
2169
- interface Prisma extends Instrumentation {}
2157
+ interface Prisma extends DatabaseInstrumentation {}
2170
2158
 
2171
2159
  /** @hidden */
2172
2160
  interface PrismaClient extends Prisma {}
@@ -2204,6 +2192,12 @@ declare namespace tracer {
2204
2192
  */
2205
2193
  interface anthropic extends Instrumentation {}
2206
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
+
2207
2201
  /**
2208
2202
  * Currently this plugin automatically instruments
2209
2203
  * [@apollo/gateway](https://github.com/apollographql/federation) for module versions >= v2.3.0.
@@ -2253,11 +2247,25 @@ declare namespace tracer {
2253
2247
  */
2254
2248
  interface avsc extends Integration {}
2255
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
+
2256
2256
  /**
2257
2257
  * This plugin automatically instruments the
2258
2258
  * [aws-sdk](https://github.com/aws/aws-sdk-js) module.
2259
2259
  */
2260
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
+
2261
2269
  /**
2262
2270
  * Whether to inject all messages during batch AWS SQS, Kinesis, and SNS send operations. Normal
2263
2271
  * behavior is to inject the first message in batch send operations.
@@ -2285,6 +2293,12 @@ declare namespace tracer {
2285
2293
  [key: string]: boolean | Object | undefined;
2286
2294
  }
2287
2295
 
2296
+ /**
2297
+ * This plugin automatically instruments the
2298
+ * @azure/cosmos module
2299
+ */
2300
+ interface azure_cosmos extends Integration {}
2301
+
2288
2302
  /**
2289
2303
  * This plugin automatically instruments the
2290
2304
  * @azure/event-hubs module
@@ -2324,7 +2338,21 @@ declare namespace tracer {
2324
2338
  * This plugin automatically instruments the
2325
2339
  * [bullmq](https://github.com/npmjs/package/bullmq) message queue library.
2326
2340
  */
2327
- 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
+ }
2328
2356
 
2329
2357
  interface bunyan extends Integration {}
2330
2358
 
@@ -2392,6 +2420,26 @@ declare namespace tracer {
2392
2420
  };
2393
2421
  }
2394
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
+
2395
2443
  /**
2396
2444
  * This plugin automatically instruments the
2397
2445
  * [express](http://expressjs.com/) module.
@@ -2420,12 +2468,6 @@ declare namespace tracer {
2420
2468
  */
2421
2469
  interface fs extends Instrumentation {}
2422
2470
 
2423
- /**
2424
- * This plugin patches the [generic-pool](https://github.com/coopernurse/node-pool)
2425
- * module to bind the callbacks the the caller context.
2426
- */
2427
- interface generic_pool extends Integration {}
2428
-
2429
2471
  /**
2430
2472
  * This plugin automatically instruments the
2431
2473
  * [@google-cloud/pubsub](https://github.com/googleapis/nodejs-pubsub) module.
@@ -2436,30 +2478,49 @@ declare namespace tracer {
2436
2478
  * This plugin automatically instruments the
2437
2479
  * [@google-cloud/vertexai](https://github.com/googleapis/nodejs-vertexai) module.
2438
2480
  */
2439
- interface google_cloud_vertexai extends Integration {}
2481
+ interface google_cloud_vertexai extends Integration {}
2440
2482
 
2441
- /**
2483
+ /**
2442
2484
  * This plugin automatically instruments the
2443
2485
  * [@google-genai](https://github.com/googleapis/js-genai) module.
2444
2486
  */
2445
- interface google_genai extends Integration {}
2487
+ interface google_genai extends Integration {}
2488
+
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
+ }
2446
2500
 
2447
- /** @hidden */
2448
- interface ExecutionArgs {
2449
- schema: any,
2450
- document: any,
2451
- rootValue?: any,
2452
- contextValue?: any,
2453
- variableValues?: any,
2454
- operationName?: string,
2455
- fieldResolver?: any,
2456
- typeResolver?: any,
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;
2457
2511
  }
2458
2512
 
2459
2513
  /**
2460
2514
  * This plugin automatically instruments the
2461
2515
  * [graphql](https://github.com/graphql/graphql-js) module.
2462
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
+ *
2463
2524
  * The `graphql` integration uses the operation name as the span resource name.
2464
2525
  * If no operation name is set, the resource name will always be just `query`,
2465
2526
  * `mutation` or `subscription`.
@@ -2484,8 +2545,11 @@ declare namespace tracer {
2484
2545
  /**
2485
2546
  * The maximum depth of fields/resolvers to instrument. Set to `0` to only
2486
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`.
2487
2550
  *
2488
2551
  * @default -1
2552
+ * @env DD_TRACE_GRAPHQL_DEPTH
2489
2553
  */
2490
2554
  depth?: number;
2491
2555
 
@@ -2502,7 +2566,10 @@ declare namespace tracer {
2502
2566
  /**
2503
2567
  * An array of variable names to record. Can also be a callback that returns
2504
2568
  * the key/value pairs to record. For example, using
2505
- * `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
2506
2573
  */
2507
2574
  variables?: string[] | ((variables: { [key: string]: any }) => { [key: string]: any });
2508
2575
 
@@ -2511,9 +2578,18 @@ declare namespace tracer {
2511
2578
  * `users.*.name` span instead of `users.0.name`, `users.1.name`, etc)
2512
2579
  *
2513
2580
  * @default true
2581
+ * @env DD_TRACE_GRAPHQL_COLLAPSE
2514
2582
  */
2515
2583
  collapse?: boolean;
2516
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
+
2517
2593
  /**
2518
2594
  * Whether to enable signature calculation for the resource name. This can
2519
2595
  * be disabled if your GraphQL operations always have a name. Note that when
@@ -2534,6 +2610,7 @@ declare namespace tracer {
2534
2610
  execute?: (span?: Span, args?: ExecutionArgs, res?: any) => void;
2535
2611
  validate?: (span?: Span, document?: any, errors?: any) => void;
2536
2612
  parse?: (span?: Span, source?: any, document?: any) => void;
2613
+ resolve?: (span?: Span, field?: FieldContext) => void;
2537
2614
  }
2538
2615
  }
2539
2616
 
@@ -2632,14 +2709,6 @@ declare namespace tracer {
2632
2709
  */
2633
2710
  allowlist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2634
2711
 
2635
- /**
2636
- * Deprecated in favor of `allowlist`.
2637
- *
2638
- * @deprecated
2639
- * @hidden
2640
- */
2641
- whitelist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2642
-
2643
2712
  /**
2644
2713
  * List of commands that should not be instrumented. Takes precedence over
2645
2714
  * allowlist if a command matches an entry in both. Commands must be in
@@ -2649,14 +2718,6 @@ declare namespace tracer {
2649
2718
  */
2650
2719
  blocklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2651
2720
 
2652
- /**
2653
- * Deprecated in favor of `blocklist`.
2654
- *
2655
- * @deprecated
2656
- * @hidden
2657
- */
2658
- blacklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2659
-
2660
2721
  /**
2661
2722
  * Custom filter function used to decide whether a Redis command should be instrumented.
2662
2723
  * When provided, this takes precedence over allowlist/blocklist configuration.
@@ -2689,14 +2750,6 @@ declare namespace tracer {
2689
2750
  */
2690
2751
  allowlist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2691
2752
 
2692
- /**
2693
- * Deprecated in favor of `allowlist`.
2694
- *
2695
- * @deprecated
2696
- * @hidden
2697
- */
2698
- whitelist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2699
-
2700
2753
  /**
2701
2754
  * List of commands that should not be instrumented. Takes precedence over
2702
2755
  * allowlist if a command matches an entry in both. Commands must be in
@@ -2706,14 +2759,6 @@ declare namespace tracer {
2706
2759
  */
2707
2760
  blocklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2708
2761
 
2709
- /**
2710
- * Deprecated in favor of `blocklist`.
2711
- *
2712
- * @deprecated
2713
- * @hidden
2714
- */
2715
- blacklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2716
-
2717
2762
  /**
2718
2763
  * Custom filter function used to decide whether a Valkey command should be instrumented.
2719
2764
  * When provided, this takes precedence over allowlist/blocklist configuration.
@@ -2739,12 +2784,6 @@ declare namespace tracer {
2739
2784
  */
2740
2785
  interface jest extends Integration {}
2741
2786
 
2742
- /**
2743
- * This plugin patches the [knex](https://knexjs.org/)
2744
- * module to bind the promise callback the the caller context.
2745
- */
2746
- interface knex extends Integration {}
2747
-
2748
2787
  /**
2749
2788
  * This plugin automatically instruments the
2750
2789
  * [koa](https://koajs.com/) module.
@@ -2799,10 +2838,17 @@ declare namespace tracer {
2799
2838
  */
2800
2839
  interface mocha extends Integration {}
2801
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
+
2802
2847
  /**
2803
2848
  * This plugin automatically instruments the
2804
2849
  * [moleculer](https://moleculer.services/) module.
2805
2850
  */
2851
+
2806
2852
  interface moleculer extends Moleculer {
2807
2853
  /**
2808
2854
  * Configuration for Moleculer clients. Set to false to disable client
@@ -2829,6 +2875,24 @@ declare namespace tracer {
2829
2875
  */
2830
2876
  heartbeatEnabled?: boolean;
2831
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
+
2832
2896
  /**
2833
2897
  * Whether to include the query contents in the resource name.
2834
2898
  */
@@ -2855,6 +2919,13 @@ declare namespace tracer {
2855
2919
  */
2856
2920
  interface mysql2 extends mysql {}
2857
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
+
2858
2929
  /**
2859
2930
  * This plugin automatically instruments the
2860
2931
  * [net](https://nodejs.org/api/net.html) module.
@@ -2924,7 +2995,7 @@ declare namespace tracer {
2924
2995
  * This plugin automatically instruments the
2925
2996
  * [pg](https://node-postgres.com/) module.
2926
2997
  */
2927
- interface pg extends Instrumentation {
2998
+ interface pg extends DatabaseInstrumentation {
2928
2999
  /**
2929
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.
2930
3001
  */
@@ -2981,14 +3052,6 @@ declare namespace tracer {
2981
3052
  */
2982
3053
  allowlist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2983
3054
 
2984
- /**
2985
- * Deprecated in favor of `allowlist`.
2986
- *
2987
- * deprecated
2988
- * @hidden
2989
- */
2990
- whitelist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2991
-
2992
3055
  /**
2993
3056
  * List of commands that should not be instrumented. Takes precedence over
2994
3057
  * allowlist if a command matches an entry in both.
@@ -2997,14 +3060,6 @@ declare namespace tracer {
2997
3060
  */
2998
3061
  blocklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
2999
3062
 
3000
- /**
3001
- * Deprecated in favor of `blocklist`.
3002
- *
3003
- * @deprecated
3004
- * @hidden
3005
- */
3006
- blacklist?: string | RegExp | ((command: string) => boolean) | (string | RegExp | ((command: string) => boolean))[];
3007
-
3008
3063
  /**
3009
3064
  * Custom filter function used to decide whether a Redis command should be instrumented.
3010
3065
  * When provided, this takes precedence over allowlist/blocklist configuration.
@@ -3014,6 +3069,14 @@ declare namespace tracer {
3014
3069
  * @returns true to instrument the command, false to skip it
3015
3070
  */
3016
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;
3017
3080
  }
3018
3081
 
3019
3082
  /**
@@ -3032,7 +3095,16 @@ declare namespace tracer {
3032
3095
  * This plugin automatically instruments the
3033
3096
  * [router](https://github.com/pillarjs/router) module.
3034
3097
  */
3035
- 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
+ }
3036
3108
 
3037
3109
  /**
3038
3110
  * This plugin automatically instruments the
@@ -3308,16 +3380,6 @@ declare namespace tracer {
3308
3380
  */
3309
3381
  recordException(exception: Exception, time?: TimeInput): void;
3310
3382
 
3311
- /**
3312
- * Causally links another span to the current span
3313
- *
3314
- * @deprecated In favor of addLink(link: otel.Link). This will be removed in the next major version.
3315
- * @param {otel.SpanContext} context The context of the span to link to.
3316
- * @param {SpanAttributes} attributes An optional key value pair of arbitrary values.
3317
- * @returns {void}
3318
- */
3319
- addLink(context: otel.SpanContext, attributes?: SpanAttributes): void;
3320
-
3321
3383
  /**
3322
3384
  * Adds a single link to the span.
3323
3385
  *
@@ -3478,16 +3540,6 @@ declare namespace tracer {
3478
3540
  */
3479
3541
  redactionValuePattern?: string,
3480
3542
 
3481
- /**
3482
- * Allows to enable security controls. This option is not supported when
3483
- * using ESM.
3484
- * @deprecated Please use the DD_IAST_SECURITY_CONTROLS_CONFIGURATION
3485
- * environment variable instead. This option will be removed in the next major version.
3486
- * @env DD_IAST_SECURITY_CONTROLS_CONFIGURATION
3487
- * Programmatic configuration takes precedence over the environment variables listed above.
3488
- */
3489
- securityControlsConfiguration?: string,
3490
-
3491
3543
  /**
3492
3544
  * Specifies the verbosity of the sent telemetry. Default 'INFORMATION'
3493
3545
  * @env DD_IAST_TELEMETRY_VERBOSITY
@@ -3518,11 +3570,15 @@ declare namespace tracer {
3518
3570
 
3519
3571
  /**
3520
3572
  * Enable LLM Observability tracing.
3573
+ *
3574
+ * @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 })`.
3521
3575
  */
3522
3576
  enable (options: LLMObsEnableOptions): void,
3523
3577
 
3524
3578
  /**
3525
3579
  * Disable LLM Observability tracing.
3580
+ *
3581
+ * @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.
3526
3582
  */
3527
3583
  disable (): void,
3528
3584
 
@@ -3596,13 +3652,22 @@ declare namespace tracer {
3596
3652
  * outputData: { content: 'response', role: 'ai' },
3597
3653
  * metadata: { temperature: 0.7 },
3598
3654
  * tags: { host: 'localhost' },
3599
- * metrics: { inputTokens: 10, outputTokens: 20, totalTokens: 30 }
3655
+ * metrics: { inputTokens: 10, outputTokens: 20, totalTokens: 30 },
3656
+ * toolDefinitions: [
3657
+ * {
3658
+ * name: 'get_weather',
3659
+ * description: 'Returns the current weather for a given location.',
3660
+ * schema: { type: 'object', properties: { location: { type: 'string' } }, required: ['location'] },
3661
+ * version: '1.0.0'
3662
+ * },
3663
+ * { name: 'get_time' }
3664
+ * ]
3600
3665
  * })
3601
3666
  * })
3602
3667
  * ```
3603
3668
  *
3604
3669
  * @param span The span to annotate (defaults to the current LLM Observability span if not provided)
3605
- * @param options An object containing the inputs, outputs, tags, metadata, and metrics to set on the span.
3670
+ * @param options An object containing the inputs, outputs, tags, metadata, tool definitions, and metrics to set on the span.
3606
3671
  */
3607
3672
  annotate (options: llmobs.AnnotationOptions): void
3608
3673
  annotate (span: tracer.Span | undefined, options: llmobs.AnnotationOptions): void
@@ -3657,6 +3722,11 @@ declare namespace tracer {
3657
3722
  }
3658
3723
 
3659
3724
  interface LLMObservabilitySpan {
3725
+ /**
3726
+ * The span kind
3727
+ */
3728
+ kind: spanKind,
3729
+
3660
3730
  /**
3661
3731
  * The input content associated with the span.
3662
3732
  */
@@ -3833,6 +3903,13 @@ declare namespace tracer {
3833
3903
  template?: string | Message[]
3834
3904
  }
3835
3905
 
3906
+ interface ToolDefinition {
3907
+ name : string,
3908
+ description? : string,
3909
+ schema? : {[key : string] : any}
3910
+ version? : string
3911
+ }
3912
+
3836
3913
  /**
3837
3914
  * Annotation options for LLM Observability spans.
3838
3915
  */
@@ -3868,10 +3945,22 @@ declare namespace tracer {
3868
3945
  */
3869
3946
  tags?: { [key: string]: any },
3870
3947
 
3948
+ /**
3949
+ * List of tag keys to propagate to LLM Observability cost and token metrics emitted from this span.
3950
+ * Each key must already be present in `tags` from this call or from a previous annotation on the
3951
+ * same span.
3952
+ */
3953
+ costTags?: string[],
3954
+
3871
3955
  /**
3872
3956
  * A Prompt object that represents the prompt used for an LLM call. Only used on `llm` spans.
3873
3957
  */
3874
3958
  prompt?: Prompt,
3959
+ /**
3960
+ * A list of ToolDefinition object that represents the tools available to the LLM for this span
3961
+ * Each definition requires a `name` and optionally accepts `description`, `schema`, and `version`.
3962
+ * */
3963
+ toolDefinitions?: ToolDefinition[]
3875
3964
  }
3876
3965
 
3877
3966
  interface AnnotationContextOptions {
@@ -3880,6 +3969,13 @@ declare namespace tracer {
3880
3969
  */
3881
3970
  tags?: { [key: string]: any },
3882
3971
 
3972
+ /**
3973
+ * List of tag keys to propagate to LLM Observability cost and token metrics emitted from each span
3974
+ * in the context.
3975
+ * Each key must already be present in `tags` on the span when it starts.
3976
+ */
3977
+ costTags?: string[],
3978
+
3883
3979
  /**
3884
3980
  * Set to override the span name for any spans annotated within the returned context.
3885
3981
  */
@@ -3979,6 +4075,15 @@ declare namespace tracer {
3979
4075
  * Programmatic configuration takes precedence over the environment variables listed above.
3980
4076
  */
3981
4077
  agentlessEnabled?: boolean,
4078
+
4079
+ /**
4080
+ * The proportion of LLM Observability traces to sample, between `0` and `1` (inclusive).
4081
+ * The decision is computed once per trace, propagated across services, and recorded on every
4082
+ * span; spans are always sent and the decision is honored at ingestion time. Defaults to `1`.
4083
+ * @env DD_LLMOBS_SAMPLE_RATE
4084
+ * Programmatic configuration takes precedence over the environment variables listed above.
4085
+ */
4086
+ sampleRate?: number,
3982
4087
  }
3983
4088
 
3984
4089
  /** @hidden */