dd-trace 5.80.0 → 5.81.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 (213) hide show
  1. package/LICENSE-3rdparty.csv +79 -88
  2. package/ext/tags.d.ts +1 -0
  3. package/ext/tags.js +1 -0
  4. package/index.d.ts +35 -35
  5. package/loader-hook.mjs +10 -3
  6. package/package.json +22 -40
  7. package/packages/datadog-esbuild/index.js +36 -19
  8. package/packages/datadog-instrumentations/index.js +1 -0
  9. package/packages/datadog-instrumentations/src/anthropic.js +12 -0
  10. package/packages/datadog-instrumentations/src/aws-sdk.js +5 -1
  11. package/packages/datadog-instrumentations/src/cucumber.js +2 -2
  12. package/packages/datadog-instrumentations/src/find-my-way.js +6 -5
  13. package/packages/datadog-instrumentations/src/google-genai.js +120 -0
  14. package/packages/datadog-instrumentations/src/graphql.js +20 -0
  15. package/packages/datadog-instrumentations/src/helpers/hooks.js +1 -0
  16. package/packages/datadog-instrumentations/src/helpers/instrument.js +10 -0
  17. package/packages/datadog-instrumentations/src/helpers/register.js +6 -1
  18. package/packages/datadog-instrumentations/src/helpers/rewriter/compiler.js +27 -0
  19. package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +152 -0
  20. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +5 -0
  21. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/langchain.js +237 -0
  22. package/packages/datadog-instrumentations/src/helpers/rewriter/loader.js +9 -0
  23. package/packages/datadog-instrumentations/src/helpers/rewriter/loader.mjs +11 -0
  24. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +139 -0
  25. package/packages/datadog-instrumentations/src/langchain.js +3 -109
  26. package/packages/datadog-instrumentations/src/mocha/main.js +1 -1
  27. package/packages/datadog-instrumentations/src/mysql2.js +1 -1
  28. package/packages/datadog-instrumentations/src/playwright.js +45 -16
  29. package/packages/datadog-instrumentations/src/router.js +1 -1
  30. package/packages/datadog-instrumentations/src/selenium.js +3 -1
  31. package/packages/datadog-instrumentations/src/ws.js +35 -17
  32. package/packages/datadog-plugin-child_process/src/scrub-cmd-params.js +1 -1
  33. package/packages/datadog-plugin-cypress/src/cypress-plugin.js +23 -2
  34. package/packages/datadog-plugin-cypress/src/plugin.js +1 -1
  35. package/packages/datadog-plugin-cypress/src/support.js +73 -31
  36. package/packages/datadog-plugin-google-genai/src/index.js +17 -0
  37. package/packages/datadog-plugin-google-genai/src/tracing.js +41 -0
  38. package/packages/datadog-plugin-graphql/src/tools/transforms.js +5 -4
  39. package/packages/datadog-plugin-jest/src/util.js +1 -1
  40. package/packages/datadog-plugin-langchain/src/tracing.js +7 -3
  41. package/packages/datadog-plugin-next/src/index.js +11 -3
  42. package/packages/dd-trace/src/aiguard/sdk.js +18 -10
  43. package/packages/dd-trace/src/appsec/api_security_sampler.js +1 -1
  44. package/packages/dd-trace/src/appsec/iast/overhead-controller.js +1 -1
  45. package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter-esm.mjs +1 -1
  46. package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +1 -2
  47. package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +1 -1
  48. package/packages/dd-trace/src/appsec/reporter.js +0 -4
  49. package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +4 -8
  50. package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +4 -2
  51. package/packages/dd-trace/src/config.js +81 -7
  52. package/packages/dd-trace/src/config_defaults.js +14 -2
  53. package/packages/dd-trace/src/datastreams/encoding.js +23 -6
  54. package/packages/dd-trace/src/datastreams/pathway.js +40 -1
  55. package/packages/dd-trace/src/datastreams/processor.js +1 -1
  56. package/packages/dd-trace/src/datastreams/schemas/schema_builder.js +1 -1
  57. package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +15 -5
  58. package/packages/dd-trace/src/debugger/devtools_client/condition.js +1 -1
  59. package/packages/dd-trace/src/debugger/devtools_client/config.js +2 -0
  60. package/packages/dd-trace/src/debugger/devtools_client/index.js +30 -15
  61. package/packages/dd-trace/src/debugger/devtools_client/inspector_promises_polyfill.js +2 -0
  62. package/packages/dd-trace/src/debugger/devtools_client/json-buffer.js +24 -18
  63. package/packages/dd-trace/src/debugger/devtools_client/send.js +18 -8
  64. package/packages/dd-trace/src/debugger/devtools_client/snapshot/collector.js +103 -15
  65. package/packages/dd-trace/src/debugger/devtools_client/snapshot/constants.js +25 -0
  66. package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +56 -25
  67. package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +64 -23
  68. package/packages/dd-trace/src/debugger/devtools_client/snapshot/symbols.js +3 -1
  69. package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +404 -0
  70. package/packages/dd-trace/src/debugger/devtools_client/source-maps.js +1 -1
  71. package/packages/dd-trace/src/debugger/devtools_client/state.js +7 -2
  72. package/packages/dd-trace/src/debugger/devtools_client/status.js +1 -1
  73. package/packages/dd-trace/src/debugger/index.js +1 -1
  74. package/packages/dd-trace/src/encode/span-stats.js +7 -1
  75. package/packages/dd-trace/src/histogram.js +1 -1
  76. package/packages/dd-trace/src/id.js +60 -0
  77. package/packages/dd-trace/src/lambda/runtime/ritm.js +1 -1
  78. package/packages/dd-trace/src/llmobs/constants/tags.js +1 -0
  79. package/packages/dd-trace/src/llmobs/plugins/genai/index.js +104 -0
  80. package/packages/dd-trace/src/llmobs/plugins/genai/util.js +486 -0
  81. package/packages/dd-trace/src/llmobs/plugins/langchain/index.js +2 -2
  82. package/packages/dd-trace/src/llmobs/plugins/{openai.js → openai/index.js} +48 -6
  83. package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +114 -0
  84. package/packages/dd-trace/src/llmobs/sdk.js +5 -0
  85. package/packages/dd-trace/src/llmobs/span_processor.js +6 -1
  86. package/packages/dd-trace/src/llmobs/tagger.js +4 -0
  87. package/packages/dd-trace/src/opentelemetry/logs/index.js +2 -2
  88. package/packages/dd-trace/src/opentelemetry/logs/logger.js +3 -2
  89. package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +5 -3
  90. package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +8 -8
  91. package/packages/dd-trace/src/opentelemetry/metrics/constants.js +34 -0
  92. package/packages/dd-trace/src/opentelemetry/metrics/index.js +81 -0
  93. package/packages/dd-trace/src/opentelemetry/metrics/instruments.js +225 -0
  94. package/packages/dd-trace/src/opentelemetry/metrics/meter.js +171 -0
  95. package/packages/dd-trace/src/opentelemetry/metrics/meter_provider.js +54 -0
  96. package/packages/dd-trace/src/opentelemetry/metrics/otlp_http_metric_exporter.js +62 -0
  97. package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +251 -0
  98. package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +532 -0
  99. package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +10 -18
  100. package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +36 -22
  101. package/packages/dd-trace/src/opentelemetry/otlp/protobuf_loader.js +1 -1
  102. package/packages/dd-trace/src/opentelemetry/span.js +1 -1
  103. package/packages/dd-trace/src/opentelemetry/tracer.js +1 -1
  104. package/packages/dd-trace/src/opentelemetry/tracer_provider.js +1 -1
  105. package/packages/dd-trace/src/payload-tagging/index.js +2 -2
  106. package/packages/dd-trace/src/plugin_manager.js +4 -2
  107. package/packages/dd-trace/src/plugins/index.js +1 -0
  108. package/packages/dd-trace/src/plugins/util/test.js +3 -3
  109. package/packages/dd-trace/src/plugins/util/url.js +119 -1
  110. package/packages/dd-trace/src/plugins/util/web.js +10 -41
  111. package/packages/dd-trace/src/process-tags/index.js +81 -0
  112. package/packages/dd-trace/src/profiling/config.js +1 -1
  113. package/packages/dd-trace/src/profiling/exporters/agent.js +1 -1
  114. package/packages/dd-trace/src/profiling/profilers/events.js +10 -1
  115. package/packages/dd-trace/src/proxy.js +5 -0
  116. package/packages/dd-trace/src/rate_limiter.js +1 -1
  117. package/packages/dd-trace/src/remote_config/manager.js +1 -1
  118. package/packages/dd-trace/src/ritm.js +1 -1
  119. package/packages/dd-trace/src/service-naming/schemas/v0/web.js +4 -0
  120. package/packages/dd-trace/src/service-naming/schemas/v1/web.js +4 -0
  121. package/packages/dd-trace/src/span_format.js +9 -4
  122. package/packages/dd-trace/src/span_processor.js +8 -3
  123. package/packages/dd-trace/src/span_stats.js +15 -4
  124. package/packages/dd-trace/src/spanleak.js +1 -1
  125. package/packages/dd-trace/src/supported-configurations.json +13 -0
  126. package/packages/dd-trace/src/telemetry/dependencies.js +1 -1
  127. package/packages/dd-trace/src/telemetry/telemetry.js +11 -2
  128. package/vendor/dist/@datadog/sketches-js/LICENSE +39 -0
  129. package/vendor/dist/@datadog/sketches-js/index.js +1 -0
  130. package/vendor/dist/@datadog/source-map/LICENSE +28 -0
  131. package/vendor/dist/@datadog/source-map/index.js +1 -0
  132. package/vendor/dist/@isaacs/ttlcache/LICENSE +55 -0
  133. package/vendor/dist/@isaacs/ttlcache/index.js +1 -0
  134. package/vendor/dist/@opentelemetry/core/LICENSE +201 -0
  135. package/vendor/dist/@opentelemetry/core/index.js +1 -0
  136. package/vendor/dist/@opentelemetry/resources/LICENSE +201 -0
  137. package/vendor/dist/@opentelemetry/resources/index.js +1 -0
  138. package/vendor/dist/astring/LICENSE +19 -0
  139. package/vendor/dist/astring/index.js +1 -0
  140. package/vendor/dist/crypto-randomuuid/index.js +1 -0
  141. package/vendor/dist/escape-string-regexp/LICENSE +9 -0
  142. package/vendor/dist/escape-string-regexp/index.js +1 -0
  143. package/vendor/dist/esquery/LICENSE +24 -0
  144. package/vendor/dist/esquery/index.js +1 -0
  145. package/vendor/dist/ignore/LICENSE +21 -0
  146. package/vendor/dist/ignore/index.js +1 -0
  147. package/vendor/dist/istanbul-lib-coverage/LICENSE +24 -0
  148. package/vendor/dist/istanbul-lib-coverage/index.js +1 -0
  149. package/vendor/dist/jest-docblock/LICENSE +21 -0
  150. package/vendor/dist/jest-docblock/index.js +1 -0
  151. package/vendor/dist/jsonpath-plus/LICENSE +22 -0
  152. package/vendor/dist/jsonpath-plus/index.js +1 -0
  153. package/vendor/dist/limiter/LICENSE +19 -0
  154. package/vendor/dist/limiter/index.js +1 -0
  155. package/vendor/dist/lodash.sortby/LICENSE +47 -0
  156. package/vendor/dist/lodash.sortby/index.js +1 -0
  157. package/vendor/dist/lru-cache/LICENSE +15 -0
  158. package/vendor/dist/lru-cache/index.js +1 -0
  159. package/vendor/dist/meriyah/LICENSE +7 -0
  160. package/vendor/dist/meriyah/index.js +1 -0
  161. package/vendor/dist/module-details-from-path/LICENSE +21 -0
  162. package/vendor/dist/module-details-from-path/index.js +1 -0
  163. package/vendor/dist/mutexify/promise/LICENSE +21 -0
  164. package/vendor/dist/mutexify/promise/index.js +1 -0
  165. package/vendor/dist/opentracing/LICENSE +201 -0
  166. package/vendor/dist/opentracing/binary_carrier.d.ts +11 -0
  167. package/vendor/dist/opentracing/constants.d.ts +61 -0
  168. package/vendor/dist/opentracing/examples/demo/demo.d.ts +2 -0
  169. package/vendor/dist/opentracing/ext/tags.d.ts +90 -0
  170. package/vendor/dist/opentracing/functions.d.ts +20 -0
  171. package/vendor/dist/opentracing/global_tracer.d.ts +14 -0
  172. package/vendor/dist/opentracing/index.d.ts +12 -0
  173. package/vendor/dist/opentracing/index.js +1 -0
  174. package/vendor/dist/opentracing/mock_tracer/index.d.ts +5 -0
  175. package/vendor/dist/opentracing/mock_tracer/mock_context.d.ts +13 -0
  176. package/vendor/dist/opentracing/mock_tracer/mock_report.d.ts +16 -0
  177. package/vendor/dist/opentracing/mock_tracer/mock_span.d.ts +50 -0
  178. package/vendor/dist/opentracing/mock_tracer/mock_tracer.d.ts +26 -0
  179. package/vendor/dist/opentracing/noop.d.ts +8 -0
  180. package/vendor/dist/opentracing/reference.d.ts +33 -0
  181. package/vendor/dist/opentracing/span.d.ts +147 -0
  182. package/vendor/dist/opentracing/span_context.d.ts +26 -0
  183. package/vendor/dist/opentracing/test/api_compatibility.d.ts +16 -0
  184. package/vendor/dist/opentracing/test/mocktracer_implemenation.d.ts +3 -0
  185. package/vendor/dist/opentracing/test/noop_implementation.d.ts +4 -0
  186. package/vendor/dist/opentracing/test/opentracing_api.d.ts +3 -0
  187. package/vendor/dist/opentracing/test/unittest.d.ts +2 -0
  188. package/vendor/dist/opentracing/tracer.d.ts +127 -0
  189. package/vendor/dist/path-to-regexp/LICENSE +21 -0
  190. package/vendor/dist/path-to-regexp/index.js +1 -0
  191. package/vendor/dist/pprof-format/LICENSE +8 -0
  192. package/vendor/dist/pprof-format/index.js +1 -0
  193. package/vendor/dist/protobufjs/LICENSE +39 -0
  194. package/vendor/dist/protobufjs/index.js +1 -0
  195. package/vendor/dist/protobufjs/minimal/LICENSE +39 -0
  196. package/vendor/dist/protobufjs/minimal/index.js +1 -0
  197. package/vendor/dist/retry/LICENSE +21 -0
  198. package/vendor/dist/retry/index.js +1 -0
  199. package/vendor/dist/rfdc/LICENSE +15 -0
  200. package/vendor/dist/rfdc/index.js +1 -0
  201. package/vendor/dist/semifies/LICENSE +201 -0
  202. package/vendor/dist/semifies/index.js +1 -0
  203. package/vendor/dist/shell-quote/LICENSE +24 -0
  204. package/vendor/dist/shell-quote/index.js +1 -0
  205. package/vendor/dist/source-map/LICENSE +28 -0
  206. package/vendor/dist/source-map/index.js +1 -0
  207. package/vendor/dist/source-map/lib/util/LICENSE +28 -0
  208. package/vendor/dist/source-map/lib/util/index.js +1 -0
  209. package/vendor/dist/source-map/mappings.wasm +0 -0
  210. package/vendor/dist/tlhunter-sorted-set/LICENSE +21 -0
  211. package/vendor/dist/tlhunter-sorted-set/index.js +1 -0
  212. package/vendor/dist/ttl-set/LICENSE +21 -0
  213. package/vendor/dist/ttl-set/index.js +1 -0
@@ -1,88 +1,79 @@
1
- Component,Origin,License,Copyright
2
- require,@datadog/libdatadog,Apache license 2.0,Copyright 2024 Datadog Inc.
3
- require,@datadog/native-appsec,Apache license 2.0,Copyright 2018 Datadog Inc.
4
- require,@datadog/native-metrics,Apache license 2.0,Copyright 2018 Datadog Inc.
5
- require,@datadog/native-iast-taint-tracking,Apache license 2.0,Copyright 2018 Datadog Inc.
6
- require,@datadog/openfeature-node-server,Apache license 2.0,Copyright 2024 Datadog Inc.
7
- require,@datadog/pprof,Apache license 2.0,Copyright 2019 Google Inc.
8
- require,@datadog/sketches-js,Apache license 2.0,Copyright 2020 Datadog Inc.
9
- require,@datadog/wasm-js-rewriter,Apache license 2.0,Copyright 2018 Datadog Inc.
10
- require,@opentelemetry/api,Apache license 2.0,Copyright OpenTelemetry Authors
11
- require,@opentelemetry/api-logs,Apache license 2.0,Copyright OpenTelemetry Authors
12
- require,@opentelemetry/core,Apache license 2.0,Copyright OpenTelemetry Authors
13
- require,@opentelemetry/resources,Apache license 2.0,Copyright OpenTelemetry Authors
14
- require,@isaacs/ttlcache,Blue Oak,Copyright Isaac Z. Schlueter and Contributors
15
- require,crypto-randomuuid,MIT,Copyright 2021 Node.js Foundation and contributors
16
- require,dc-polyfill,MIT,Copyright 2023 Datadog Inc.
17
- require,escape-string-regexp,MIT,Copyright Sindre Sorhus
18
- require,ignore,MIT,Copyright 2013 Kael Zhang and contributors
19
- require,import-in-the-middle,Apache license 2.0,Copyright 2021 Datadog Inc.
20
- require,istanbul-lib-coverage,BSD-3-Clause,Copyright 2012-2015 Yahoo! Inc.
21
- require,jest-docblock,MIT,Copyright Meta Platforms, Inc. and affiliates.
22
- require,jsonpath-plus,MIT,Copyright (c) 2011-2019 Stefan Goessner, Subbu Allamaraju, Mike Brevoort, Robert Krahn, Brett Zamir, Richard Schneider
23
- require,limiter,MIT,Copyright 2011 John Hurliman
24
- require,lodash.sortby,MIT,Copyright JS Foundation and other contributors
25
- require,lru-cache,ISC,Copyright (c) 2010-2022 Isaac Z. Schlueter and Contributors
26
- require,module-details-from-path,MIT,Copyright 2016 Thomas Watson Steen
27
- require,mutexify,MIT,Copyright (c) 2014 Mathias Buus
28
- require,opentracing,MIT,Copyright 2016 Resonance Labs Inc
29
- require,path-to-regexp,MIT,Copyright 2014 Blake Embrey
30
- require,pprof-format,MIT,Copyright 2022 Stephen Belanger
31
- require,protobufjs,BSD-3-Clause,Copyright 2016 Daniel Wirtz
32
- require,tlhunter-sorted-set,MIT,Copyright (c) 2023 Datadog Inc.
33
- require,retry,MIT,Copyright 2011 Tim Koschützki Felix Geisendörfer
34
- require,rfdc,MIT,Copyright 2019 David Mark Clements
35
- require,semifies,Apache license 2.0,Copyright Authors
36
- require,shell-quote,mit,Copyright (c) 2013 James Halliday
37
- require,source-map,BSD-3-Clause,Copyright (c) 2009-2011, Mozilla Foundation and contributors
38
- require,ttl-set,MIT,Copyright (c) 2024 Thomas Watson
39
- dev,@babel/helpers,MIT,Copyright (c) 2014-present Sebastian McKenzie and other contributors
40
- dev,@types/chai,MIT,Copyright (c) Microsoft Corp.
41
- dev,@types/mocha,MIT,Copyright (c) Microsoft Corp.
42
- dev,@types/node,MIT,Copyright (c) Microsoft Corp.
43
- dev,@types/sinon,MIT,Copyright (c) Microsoft Corp.
44
- dev,@types/tap,MIT,Copyright (c) Microsoft Corp.
45
- dev,@eslint/eslintrc,MIT,Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
46
- dev,@eslint/js,MIT,Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
47
- dev,@msgpack/msgpack,ISC,Copyright 2019 The MessagePack Community
48
- dev,@openfeature/core,Apache-2.0,Copyright OpenFeature Authors
49
- dev,@openfeature/server-sdk,Apache-2.0,Copyright OpenFeature Authors
50
- dev,@stylistic/eslint-plugin,MIT,Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
51
- dev,axios,MIT,Copyright 2014-present Matt Zabriskie
52
- dev,benchmark,MIT,Copyright 2010-2016 Mathias Bynens Robert Kieffer John-David Dalton
53
- dev,body-parser,MIT,Copyright 2014 Jonathan Ong 2014-2015 Douglas Christopher Wilson
54
- dev,bun,MIT,Copyright contributors
55
- dev,chai,MIT,Copyright 2017 Chai.js Assertion Library
56
- dev,eslint,MIT,Copyright JS Foundation and other contributors https://js.foundation
57
- dev,eslint-plugin-cypress,MIT,Copyright (c) 2019 Cypress.io
58
- dev,eslint-plugin-import,MIT,Copyright 2015 Ben Mosher
59
- dev,eslint-plugin-jsdoc,BSD-3-Clause,Copyright Gajus Kuizinas
60
- dev,eslint-plugin-mocha,MIT,Copyright 2014 Mathias Schreck
61
- dev,eslint-plugin-n,MIT,Copyright 2015 Toru Nagashima
62
- dev,eslint-plugin-promise,ISC,jden and other contributors
63
- dev,eslint-plugin-unicorn,MIT,Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
64
- dev,express,MIT,Copyright 2009-2014 TJ Holowaychuk 2013-2014 Roman Shtylman 2014-2015 Douglas Christopher Wilson
65
- dev,glob,ISC,Copyright Isaac Z. Schlueter and Contributors
66
- dev,globals,MIT,Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
67
- dev,graphql,MIT,Copyright 2015 Facebook Inc.
68
- dev,jszip,MIT,Copyright 2015-2016 Stuart Knightley and contributors
69
- dev,mocha,MIT,Copyright 2011-2018 JS Foundation and contributors https://js.foundation
70
- dev,mocha-multi-reporters,MIT,Copyright 2015-2019 Yousaf Nabi and Stanley Ng
71
- dev,mocha-junit-reporter,MIT, Copyright 2015 Michael Allen
72
- dev,multer,MIT,Copyright 2014 Hage Yaapa
73
- dev,nock,MIT,Copyright 2017 Pedro Teixeira and other contributors
74
- dev,nyc,ISC,Copyright 2015 Contributors
75
- dev,octokit,MIT,Copyright 2023 Octokit contributors
76
- dev,proxyquire,MIT,Copyright 2013 Thorsten Lorenz
77
- dev,semver,ISC,Copyright Isaac Z. Schlueter and Contributors
78
- dev,sinon,BSD-3-Clause,Copyright 2010-2017 Christian Johansen
79
- dev,sinon-chai,WTFPL and BSD-2-Clause,Copyright 2004 Sam Hocevar 2012–2017 Domenic Denicola
80
- dev,tap,ISC,Copyright 2011-2022 Isaac Z. Schlueter and Contributors
81
- dev,tiktoken,MIT,Copyright (c) 2022 OpenAI, Shantanu Jain
82
- dev,typescript,Apache license 2.0,Copyright Microsoft Corp.
83
- dev,workerpool,Apache license 2.0,Copyright (C) 2014-2024 Jos de Jong wjosdejong@gmail.com
84
- dev,yaml,ISC,Copyright Eemeli Aro <eemeli@gmail.com>
85
- dev,yarn-deduplicate,Apache license 2.0,Copyright [yyyy] [name of copyright owner]
86
- file,aws-lambda-nodejs-runtime-interface-client,Apache 2.0,Copyright 2019 Amazon.com Inc. or its affiliates. All Rights Reserved.
87
- file,profile.proto,Apache license 2.0,Copyright 2016 Google Inc.
88
- file,is-git-url,MIT,Copyright (c) 2017 Jon Schlinkert.
1
+ "component","origin","license","copyright"
2
+ "@datadog/flagging-core","https://github.com/DataDog/openfeature-js-client","['Apache-2.0']","['DataDog']"
3
+ "@datadog/libdatadog","https://github.com/DataDog/libdatadog-nodejs","['Apache-2.0']","['Datadog Inc.']"
4
+ "@datadog/native-appsec","https://github.com/DataDog/dd-native-appsec-js","['Apache-2.0']","['Datadog Inc.']"
5
+ "@datadog/native-iast-taint-tracking","https://github.com/DataDog/dd-native-iast-taint-tracking-js","['Apache-2.0']","['Datadog Inc.']"
6
+ "@datadog/native-metrics","https://github.com/DataDog/dd-native-metrics-js","['Apache-2.0']","['Datadog Inc.']"
7
+ "@datadog/openfeature-node-server","https://github.com/DataDog/openfeature-js-client","['Apache-2.0']","['DataDog']"
8
+ "@datadog/pprof","https://github.com/DataDog/pprof-nodejs","['Apache-2.0']","['Google Inc.']"
9
+ "@datadog/sketches-js","https://github.com/DataDog/sketches-js","['Apache-2.0']","['DataDog']"
10
+ "@datadog/source-map","npm:@datadog/source-map","[]","[]"
11
+ "@datadog/wasm-js-rewriter","https://github.com/DataDog/dd-wasm-js-rewriter","['Apache-2.0']","['Datadog Inc.']"
12
+ "@isaacs/ttlcache","https://github.com/isaacs/ttlcache","['BlueOak-1.0.0']","['Isaac Z. Schlueter']"
13
+ "@jsep-plugin/assignment","https://github.com/EricSmekens/jsep","['MIT']","['Shelly']"
14
+ "@jsep-plugin/regex","https://github.com/EricSmekens/jsep","['MIT']","['Shelly']"
15
+ "@openfeature/server-sdk","https://github.com/open-feature/js-sdk","['Apache-2.0']","['open-feature']"
16
+ "@opentelemetry/api","https://github.com/open-telemetry/opentelemetry-js","['Apache-2.0']","['OpenTelemetry Authors']"
17
+ "@opentelemetry/api-logs","https://github.com/open-telemetry/opentelemetry-js","['Apache-2.0']","['OpenTelemetry Authors']"
18
+ "@opentelemetry/core","https://github.com/open-telemetry/opentelemetry-js","['Apache-2.0']","['OpenTelemetry Authors']"
19
+ "@opentelemetry/resources","https://github.com/open-telemetry/opentelemetry-js","['Apache-2.0']","['OpenTelemetry Authors']"
20
+ "@opentelemetry/semantic-conventions","https://github.com/open-telemetry/opentelemetry-js","['Apache-2.0']","['OpenTelemetry Authors']"
21
+ "@protobufjs/aspromise","https://github.com/protobufjs/protobuf.js","['BSD-3-Clause']","['Daniel Wirtz']"
22
+ "@protobufjs/base64","https://github.com/protobufjs/protobuf.js","['BSD-3-Clause']","['Daniel Wirtz']"
23
+ "@protobufjs/codegen","https://github.com/protobufjs/protobuf.js","['BSD-3-Clause']","['Daniel Wirtz']"
24
+ "@protobufjs/eventemitter","https://github.com/protobufjs/protobuf.js","['BSD-3-Clause']","['Daniel Wirtz']"
25
+ "@protobufjs/fetch","https://github.com/protobufjs/protobuf.js","['BSD-3-Clause']","['Daniel Wirtz']"
26
+ "@protobufjs/float","https://github.com/protobufjs/protobuf.js","['BSD-3-Clause']","['Daniel Wirtz']"
27
+ "@protobufjs/inquire","https://github.com/protobufjs/protobuf.js","['BSD-3-Clause']","['Daniel Wirtz']"
28
+ "@protobufjs/path","https://github.com/protobufjs/protobuf.js","['BSD-3-Clause']","['Daniel Wirtz']"
29
+ "@protobufjs/pool","https://github.com/protobufjs/protobuf.js","['BSD-3-Clause']","['Daniel Wirtz']"
30
+ "@protobufjs/utf8","https://github.com/protobufjs/protobuf.js","['BSD-3-Clause']","['Daniel Wirtz']"
31
+ "@types/node","https://github.com/DefinitelyTyped/DefinitelyTyped","['MIT']","['DefinitelyTyped']"
32
+ "acorn","https://github.com/acornjs/acorn","['MIT']","['acornjs']"
33
+ "acorn-import-attributes","https://github.com/xtuc/acorn-import-attributes","['MIT']","['Sven Sauleau']"
34
+ "argparse","https://github.com/nodeca/argparse","['Python-2.0']","['nodeca']"
35
+ "astring","https://github.com/davidbonnet/astring","['MIT']","['David Bonnet']"
36
+ "cjs-module-lexer","https://github.com/nodejs/cjs-module-lexer","['MIT']","['Guy Bedford']"
37
+ "crypto-randomuuid","npm:crypto-randomuuid","['MIT']","['Stephen Belanger']"
38
+ "dc-polyfill","https://github.com/DataDog/dc-polyfill","['MIT']","['Thomas Hunter II']"
39
+ "dd-trace","https://github.com/DataDog/dd-trace-js","['(Apache-2.0 OR BSD-3-Clause)']","['Datadog Inc. <info@datadoghq.com>']"
40
+ "delay","https://github.com/sindresorhus/delay","['MIT']","['Sindre Sorhus']"
41
+ "detect-newline","https://github.com/sindresorhus/detect-newline","['MIT']","['Sindre Sorhus']"
42
+ "escape-string-regexp","https://github.com/sindresorhus/escape-string-regexp","['MIT']","['Sindre Sorhus']"
43
+ "esquery","https://github.com/estools/esquery","['BSD-3-Clause']","['Joel Feenstra']"
44
+ "estraverse","https://github.com/estools/estraverse","['BSD-2-Clause']","['estools']"
45
+ "fast-fifo","https://github.com/mafintosh/fast-fifo","['MIT']","['Mathias Buus']"
46
+ "ignore","https://github.com/kaelzhang/node-ignore","['MIT']","['kael']"
47
+ "import-in-the-middle","https://github.com/nodejs/import-in-the-middle","['Apache-2.0']","['Bryan English']"
48
+ "istanbul-lib-coverage","https://github.com/istanbuljs/istanbuljs","['BSD-3-Clause']","['Krishnan Anantheswaran']"
49
+ "jest-docblock","https://github.com/jestjs/jest","['MIT']","['jestjs']"
50
+ "js-yaml","https://github.com/nodeca/js-yaml","['MIT']","['Vladimir Zapparov']"
51
+ "jsep","https://github.com/EricSmekens/jsep","['MIT']","['Stephen Oney']"
52
+ "jsonpath-plus","https://github.com/JSONPath-Plus/JSONPath","['MIT']","['Stefan Goessner']"
53
+ "limiter","https://github.com/jhurliman/node-rate-limiter","['MIT']","['John Hurliman']"
54
+ "lodash.sortby","https://github.com/lodash/lodash","['MIT']","['John-David Dalton']"
55
+ "long","https://github.com/dcodeIO/long.js","['Apache-2.0']","['Daniel Wirtz']"
56
+ "lru-cache","https://github.com/isaacs/node-lru-cache","['ISC']","['Isaac Z. Schlueter']"
57
+ "meriyah","https://github.com/meriyah/meriyah","['ISC']","['Kenny F.']"
58
+ "module-details-from-path","https://github.com/watson/module-details-from-path","['MIT']","['Thomas Watson']"
59
+ "mutexify","https://github.com/mafintosh/mutexify","['MIT']","['Mathias Buus']"
60
+ "node-addon-api","https://github.com/nodejs/node-addon-api","['MIT']","['nodejs']"
61
+ "node-gyp-build","https://github.com/prebuild/node-gyp-build","['MIT']","['Mathias Buus']"
62
+ "opentracing","https://github.com/opentracing/opentracing-javascript","['Apache-2.0']","['opentracing']"
63
+ "p-limit","https://github.com/sindresorhus/p-limit","['MIT']","['Sindre Sorhus']"
64
+ "path-to-regexp","https://github.com/pillarjs/path-to-regexp","['MIT']","['pillarjs']"
65
+ "pprof-format","https://github.com/DataDog/pprof-format","['MIT']","['Datadog Inc.']"
66
+ "protobufjs","https://github.com/protobufjs/protobuf.js","['BSD-3-Clause']","['Daniel Wirtz']"
67
+ "queue-tick","https://github.com/mafintosh/queue-tick","['MIT']","['Mathias Buus']"
68
+ "retry","https://github.com/tim-kos/node-retry","['MIT']","['Tim Koschützki']"
69
+ "rfdc","https://github.com/davidmarkclements/rfdc","['MIT']","['David Mark Clements']"
70
+ "semifies","https://github.com/holepunchto/semifies","['Apache-2.0']","['Holepunch Inc']"
71
+ "shell-quote","https://github.com/ljharb/shell-quote","['MIT']","['James Halliday']"
72
+ "source-map","https://github.com/mozilla/source-map","['BSD-3-Clause']","['Nick Fitzgerald']"
73
+ "spark-md5","https://github.com/satazor/js-spark-md5","['(WTFPL OR MIT)']","['André Cruz']"
74
+ "tlhunter-sorted-set","https://github.com/tlhunter/node-sorted-set","['MIT']","['Thomas Hunter II']"
75
+ "ttl-set","https://github.com/watson/ttl-set","['MIT']","['Thomas Watson']"
76
+ "undici-types","https://github.com/nodejs/undici","['MIT']","['nodejs']"
77
+ "yocto-queue","https://github.com/sindresorhus/yocto-queue","['MIT']","['Sindre Sorhus']"
78
+ "aws-lambda-nodejs-runtime-interface-client","https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/blob/v2.1.0/src/utils/UserFunction.ts","['Apache-2.0']","['Amazon.com Inc. or its affiliates']"
79
+ "is-git-url","https://github.com/jonschlinkert/is-git-url/blob/396965ffabf2f46656c8af4c47bef1d69f09292e/index.js#L9C15-L9C87","['MIT']","['Jon Schlinkert']"
package/ext/tags.d.ts CHANGED
@@ -15,6 +15,7 @@ declare const tags: {
15
15
  HTTP_METHOD: 'http.method'
16
16
  HTTP_STATUS_CODE: 'http.status_code'
17
17
  HTTP_ROUTE: 'http.route'
18
+ HTTP_ENDPOINT: 'http.endpoint'
18
19
  HTTP_REQUEST_HEADERS: 'http.request.headers'
19
20
  HTTP_RESPONSE_HEADERS: 'http.response.headers'
20
21
  HTTP_USERAGENT: 'http.useragent',
package/ext/tags.js CHANGED
@@ -20,6 +20,7 @@ const tags = {
20
20
  HTTP_METHOD: 'http.method',
21
21
  HTTP_STATUS_CODE: 'http.status_code',
22
22
  HTTP_ROUTE: 'http.route',
23
+ HTTP_ENDPOINT: 'http.endpoint',
23
24
  HTTP_REQUEST_HEADERS: 'http.request.headers',
24
25
  HTTP_RESPONSE_HEADERS: 'http.response.headers',
25
26
  HTTP_USERAGENT: 'http.useragent',
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 "opentracing";
3
+ import * as opentracing from "./vendor/dist/opentracing";
4
4
  import * as otel from "@opentelemetry/api";
5
5
 
6
6
  /**
@@ -207,6 +207,7 @@ interface Plugins {
207
207
  "generic-pool": tracer.plugins.generic_pool;
208
208
  "google-cloud-pubsub": tracer.plugins.google_cloud_pubsub;
209
209
  "google-cloud-vertexai": tracer.plugins.google_cloud_vertexai;
210
+ "google-genai": tracer.plugins.google_genai;
210
211
  "graphql": tracer.plugins.graphql;
211
212
  "grpc": tracer.plugins.grpc;
212
213
  "hapi": tracer.plugins.hapi;
@@ -541,6 +542,12 @@ declare namespace tracer {
541
542
  eventLoop?: boolean
542
543
  }
543
544
 
545
+ /**
546
+ * Whether to add an auto-generated `runtime-id` tag to metrics.
547
+ * @default false
548
+ */
549
+ runtimeMetricsRuntimeId?: boolean
550
+
544
551
  /**
545
552
  * Custom function for DNS lookups when sending requests to the agent.
546
553
  * @default dns.lookup()
@@ -577,13 +584,6 @@ declare namespace tracer {
577
584
  */
578
585
  experimental?: {
579
586
  b3?: boolean
580
- traceparent?: boolean
581
-
582
- /**
583
- * Whether to add an auto-generated `runtime-id` tag to metrics.
584
- * @default false
585
- */
586
- runtimeId?: boolean
587
587
 
588
588
  /**
589
589
  * Whether to write traces to log output or agentless, rather than send to an agent
@@ -687,13 +687,6 @@ declare namespace tracer {
687
687
  */
688
688
  tags?: { [key: string]: any };
689
689
 
690
- /**
691
- * Specifies which scope implementation to use. The default is to use the best
692
- * implementation for the runtime. Only change this if you know what you are
693
- * doing.
694
- */
695
- scope?: 'async_hooks' | 'async_local_storage' | 'async_resource' | 'sync' | 'noop'
696
-
697
690
  /**
698
691
  * Whether to report the hostname of the service host. This is used when the agent is deployed on a different host and cannot determine the hostname automatically.
699
692
  * @default false
@@ -706,13 +699,6 @@ declare namespace tracer {
706
699
  */
707
700
  logLevel?: 'error' | 'debug'
708
701
 
709
- /**
710
- * If false, require a parent in order to trace.
711
- * @default true
712
- * @deprecated since version 4.0
713
- */
714
- orphanable?: boolean
715
-
716
702
  /**
717
703
  * Enables DBM to APM link using tag injection.
718
704
  * @default 'disabled'
@@ -919,7 +905,7 @@ declare namespace tracer {
919
905
  /**
920
906
  * The selection and priority order of context propagation injection and extraction mechanisms.
921
907
  */
922
- propagationStyle?: string[] | PropagationStyle
908
+ tracePropagationStyle?: string[] | PropagationStyle
923
909
 
924
910
  /**
925
911
  * Cloud payload report as tags
@@ -1334,6 +1320,10 @@ declare namespace tracer {
1334
1320
  * Human-readable explanation for why this action was chosen.
1335
1321
  */
1336
1322
  reason: string;
1323
+ /**
1324
+ * List of tags associated with the evaluation (e.g. indirect-prompt-injection)
1325
+ */
1326
+ tags: string[];
1337
1327
  }
1338
1328
 
1339
1329
  /**
@@ -1345,6 +1335,10 @@ declare namespace tracer {
1345
1335
  * Human-readable explanation from AI Guard describing why the conversation was blocked.
1346
1336
  */
1347
1337
  reason: string;
1338
+ /**
1339
+ * List of tags associated with the evaluation (e.g. indirect-prompt-injection)
1340
+ */
1341
+ tags: string[];
1348
1342
  }
1349
1343
 
1350
1344
  /**
@@ -1862,19 +1856,25 @@ declare namespace tracer {
1862
1856
  /**
1863
1857
  * This plugin automatically instruments the
1864
1858
  * [@google-cloud/vertexai](https://github.com/googleapis/nodejs-vertexai) module.
1865
- */
1866
- interface google_cloud_vertexai extends Integration {}
1859
+ */
1860
+ interface google_cloud_vertexai extends Integration {}
1867
1861
 
1868
- /** @hidden */
1869
- interface ExecutionArgs {
1870
- schema: any,
1871
- document: any,
1872
- rootValue?: any,
1873
- contextValue?: any,
1874
- variableValues?: any,
1875
- operationName?: string,
1876
- fieldResolver?: any,
1877
- typeResolver?: any,
1862
+ /**
1863
+ * This plugin automatically instruments the
1864
+ * [@google-genai](https://github.com/googleapis/js-genai) module.
1865
+ */
1866
+ interface google_genai extends Integration {}
1867
+
1868
+ /** @hidden */
1869
+ interface ExecutionArgs {
1870
+ schema: any,
1871
+ document: any,
1872
+ rootValue?: any,
1873
+ contextValue?: any,
1874
+ variableValues?: any,
1875
+ operationName?: string,
1876
+ fieldResolver?: any,
1877
+ typeResolver?: any,
1878
1878
  }
1879
1879
 
1880
1880
  /**
package/loader-hook.mjs CHANGED
@@ -1,7 +1,10 @@
1
- import regexpEscape from 'escape-string-regexp'
1
+ import regexpEscapeModule from './vendor/dist/escape-string-regexp/index.js'
2
2
  import * as iitm from 'import-in-the-middle/hook.mjs'
3
3
  import hooks from './packages/datadog-instrumentations/src/helpers/hooks.js'
4
4
  import configHelper from './packages/dd-trace/src/config-helper.js'
5
+ import * as rewriterLoader from './packages/datadog-instrumentations/src/helpers/rewriter/loader.mjs'
6
+
7
+ const regexpEscape = regexpEscapeModule.default
5
8
 
6
9
  // For some reason `getEnvironmentVariable` is not otherwise available to ESM.
7
10
  const env = configHelper.getEnvironmentVariable
@@ -17,6 +20,10 @@ function initialize (data = {}) {
17
20
  return iitm.initialize(data)
18
21
  }
19
22
 
23
+ function load (url, context, nextLoad) {
24
+ return rewriterLoader.load(url, context, (url, context) => iitm.load(url, context, nextLoad))
25
+ }
26
+
20
27
  function addInstrumentations (data) {
21
28
  const instrumentations = Object.keys(hooks)
22
29
 
@@ -48,5 +55,5 @@ function addExclusions (data) {
48
55
  )
49
56
  }
50
57
 
51
- export { initialize }
52
- export { load, getFormat, resolve, getSource } from 'import-in-the-middle/hook.mjs'
58
+ export { initialize, load }
59
+ export { getFormat, resolve, getSource } from 'import-in-the-middle/hook.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dd-trace",
3
- "version": "5.80.0",
3
+ "version": "5.81.0",
4
4
  "description": "Datadog APM tracing client for JavaScript",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -10,9 +10,9 @@
10
10
  "bench": "node benchmark/index.js",
11
11
  "bench:e2e:test-optimization": "node benchmark/e2e-test-optimization/benchmark-run.js",
12
12
  "dependencies:dedupe": "yarn-deduplicate yarn.lock",
13
- "type:check": "tsc --noEmit -p tsconfig.json",
14
- "type:doc": "cd docs && yarn && yarn build",
15
- "type:test": "cd docs && yarn && yarn test",
13
+ "type:check": "tsc --noEmit -p tsconfig.dev.json",
14
+ "type:doc:build": "cd docs && yarn && yarn build",
15
+ "type:doc:test": "cd docs && yarn && yarn test",
16
16
  "lint": "node scripts/check_licenses.js && eslint . --concurrency=auto --max-warnings 0",
17
17
  "lint:fix": "node scripts/check_licenses.js && eslint . --concurrency=auto --max-warnings 0 --fix",
18
18
  "lint:inspect": "npx @eslint/config-inspector@latest",
@@ -67,7 +67,7 @@
67
67
  "test:integration:playwright": "mocha --timeout 60000 -r \"packages/dd-trace/test/setup/core.js\" \"integration-tests/playwright/*.spec.js\"",
68
68
  "test:integration:selenium": "mocha --timeout 60000 -r \"packages/dd-trace/test/setup/core.js\" \"integration-tests/selenium/*.spec.js\"",
69
69
  "test:integration:vitest": "mocha --timeout 60000 -r \"packages/dd-trace/test/setup/core.js\" \"integration-tests/vitest/*.spec.js\"",
70
- "test:integration:testopt": "mocha --timeout 90000 -r \"packages/dd-trace/test/setup/core.js\" \"integration-tests/ci-visibility/*.spec.js\"",
70
+ "test:integration:testopt": "mocha --timeout 120000 -r \"packages/dd-trace/test/setup/core.js\" \"integration-tests/ci-visibility/*.spec.js\"",
71
71
  "test:integration:profiler": "mocha --timeout 180000 -r \"packages/dd-trace/test/setup/core.js\" \"integration-tests/profiler/*.spec.js\"",
72
72
  "test:integration:plugins": "mocha -r \"packages/dd-trace/test/setup/mocha.js\" \"packages/datadog-plugin-@($(echo $PLUGINS))/test/integration-test/**/*.spec.js\"",
73
73
  "test:unit:plugins": "mocha -r \"packages/dd-trace/test/setup/mocha.js\" \"packages/datadog-instrumentations/test/@($(echo $PLUGINS)).spec.js\" \"packages/datadog-plugin-@($(echo $PLUGINS))/test/**/*.spec.js\" --exclude \"packages/datadog-plugin-@($(echo $PLUGINS))/test/integration-test/**/*.spec.js\"",
@@ -98,6 +98,7 @@
98
98
  "node": ">=18"
99
99
  },
100
100
  "files": [
101
+ "/package.json",
101
102
  "ci/**/*",
102
103
  "cypress/**/*",
103
104
  "esbuild.js",
@@ -111,7 +112,6 @@
111
112
  "LICENSE.Apache",
112
113
  "LICENSE.BSD3",
113
114
  "loader-hook.mjs",
114
- "package.json",
115
115
  "packages/*/index.js",
116
116
  "packages/*/lib/**/*",
117
117
  "packages/*/src/**/*",
@@ -119,65 +119,44 @@
119
119
  "README.md",
120
120
  "register.js",
121
121
  "scripts/preinstall.js",
122
- "vendor/**/*",
122
+ "vendor/dist/**/*.d.ts",
123
+ "vendor/dist/**/*.js",
124
+ "vendor/dist/**/*.wasm",
125
+ "vendor/dist/**/LICENSE",
123
126
  "version.js"
124
127
  ],
125
128
  "dependencies": {
129
+ "dc-polyfill": "^0.1.10",
130
+ "import-in-the-middle": "^1.14.2"
131
+ },
132
+ "optionalDependencies": {
126
133
  "@datadog/libdatadog": "0.7.0",
127
134
  "@datadog/native-appsec": "10.3.0",
128
- "@datadog/native-iast-taint-tracking": "4.0.0",
135
+ "@datadog/native-iast-taint-tracking": "4.1.0",
129
136
  "@datadog/native-metrics": "3.1.1",
130
137
  "@datadog/openfeature-node-server": "^0.2.0",
131
138
  "@datadog/pprof": "5.12.0",
132
- "@datadog/sketches-js": "2.1.1",
133
139
  "@datadog/wasm-js-rewriter": "5.0.1",
134
- "@isaacs/ttlcache": "^2.0.1",
135
140
  "@opentelemetry/api": ">=1.0.0 <1.10.0",
136
- "@opentelemetry/api-logs": "<1.0.0",
137
- "@opentelemetry/core": ">=1.14.0 <1.31.0",
138
- "@opentelemetry/resources": ">=1.0.0 <1.31.0",
139
- "crypto-randomuuid": "^1.0.0",
140
- "dc-polyfill": "^0.1.10",
141
- "escape-string-regexp": "^5.0.0",
142
- "ignore": "^7.0.5",
143
- "import-in-the-middle": "^1.14.2",
144
- "istanbul-lib-coverage": "^3.2.2",
145
- "jest-docblock": "^29.7.0",
146
- "jsonpath-plus": "^10.3.0",
147
- "limiter": "^1.1.5",
148
- "lodash.sortby": "^4.7.0",
149
- "lru-cache": "^10.4.3",
150
- "module-details-from-path": "^1.0.4",
151
- "mutexify": "^1.4.0",
152
- "opentracing": ">=0.14.7",
153
- "path-to-regexp": "^0.1.12",
154
- "pprof-format": "^2.1.1",
155
- "protobufjs": "^7.5.3",
156
- "retry": "^0.13.1",
157
- "rfdc": "^1.4.1",
158
- "semifies": "^1.0.0",
159
- "shell-quote": "^1.8.2",
160
- "source-map": "^0.7.4",
161
- "tlhunter-sorted-set": "^0.1.0",
162
- "ttl-set": "^1.0.0"
141
+ "@opentelemetry/api-logs": "<1.0.0"
163
142
  },
164
143
  "devDependencies": {
165
144
  "@babel/helpers": "^7.28.4",
166
145
  "@eslint/eslintrc": "^3.3.1",
167
146
  "@eslint/js": "^9.39.0",
168
147
  "@msgpack/msgpack": "^3.1.2",
169
- "@openfeature/core": "^1.9.0",
148
+ "@openfeature/core": "^1.8.1",
170
149
  "@openfeature/server-sdk": "~1.20.0",
171
150
  "@stylistic/eslint-plugin": "^5.5.0",
172
151
  "@types/chai": "^4.3.16",
173
152
  "@types/mocha": "^10.0.10",
174
153
  "@types/node": "^18.19.106",
175
- "@types/sinon": "^17.0.4",
154
+ "@types/sinon": "^21.0.0",
176
155
  "@types/tap": "^15.0.12",
177
156
  "axios": "^1.12.2",
178
157
  "benchmark": "^2.1.4",
179
158
  "body-parser": "^2.2.0",
180
- "bun": "1.3.2",
159
+ "bun": "1.3.3",
181
160
  "chai": "^4.5.0",
182
161
  "eslint": "^9.39.0",
183
162
  "eslint-plugin-cypress": "^5.2.0",
@@ -199,7 +178,10 @@
199
178
  "nock": "^13.5.6",
200
179
  "nyc": "^15.1.0",
201
180
  "octokit": "^5.0.3",
181
+ "opentracing": ">=0.14.7",
202
182
  "proxyquire": "^2.1.3",
183
+ "retry": "^0.13.1",
184
+ "semifies": "^1.0.0",
203
185
  "semver": "^7.7.2",
204
186
  "sinon": "^21.0.0",
205
187
  "sinon-chai": "^3.7.0",
@@ -245,28 +245,45 @@ ${build.initialOptions.banner.js}`
245
245
  }
246
246
  }
247
247
 
248
- const packageJson = JSON.parse(fs.readFileSync(pathToPackageJson).toString())
248
+ try {
249
+ const packageJson = JSON.parse(fs.readFileSync(pathToPackageJson).toString())
249
250
 
250
- const isESM = isESMFile(fullPathToModule, pathToPackageJson, packageJson)
251
- if (isESM && !interceptedESMModules.has(fullPathToModule)) {
252
- fullPathToModule += ESM_INTERCEPTED_SUFFIX
253
- }
251
+ const isESM = isESMFile(fullPathToModule, pathToPackageJson, packageJson)
252
+ if (isESM && !interceptedESMModules.has(fullPathToModule)) {
253
+ fullPathToModule += ESM_INTERCEPTED_SUFFIX
254
+ }
254
255
 
255
- if (DEBUG) console.log(`RESOLVE: ${args.path}@${packageJson.version}`)
256
+ if (DEBUG) console.log(`RESOLVE: ${args.path}@${packageJson.version}`)
256
257
 
257
- // https://esbuild.github.io/plugins/#on-resolve-arguments
258
- return {
259
- path: fullPathToModule,
260
- pluginData: {
261
- version: packageJson.version,
262
- pkg: extracted.pkg,
263
- path: extracted.path,
264
- full: fullPathToModule,
265
- raw: args.path,
266
- pkgOfInterest: true,
267
- kind: args.kind,
268
- internal,
269
- isESM
258
+ // https://esbuild.github.io/plugins/#on-resolve-arguments
259
+ return {
260
+ path: fullPathToModule,
261
+ pluginData: {
262
+ version: packageJson.version,
263
+ pkg: extracted.pkg,
264
+ path: extracted.path,
265
+ full: fullPathToModule,
266
+ raw: args.path,
267
+ pkgOfInterest: true,
268
+ kind: args.kind,
269
+ internal,
270
+ isESM
271
+ }
272
+ }
273
+ } catch (e) {
274
+ // Skip vendored dependencies which never have a `package.json`. This
275
+ // will use the default resolve logic of ESBuild which is what we want
276
+ // since those files should be treated as regular files and not modules
277
+ // even though they are in a `node_modules` folder.
278
+ if (e.code === 'ENOENT') {
279
+ if (DEBUG) {
280
+ console.log([
281
+ 'Skipping `package.json` lookup.',
282
+ 'This usually means the package was vendored but could indicate an issue otherwise.'
283
+ ].join(' '))
284
+ }
285
+ } else {
286
+ throw e
270
287
  }
271
288
  }
272
289
  }
@@ -2,3 +2,4 @@
2
2
 
3
3
  require('./src/helpers/bundler-register')
4
4
  require('./src/helpers/register')
5
+ require('./src/helpers/rewriter/loader')
@@ -112,4 +112,16 @@ for (const extension of extensions) {
112
112
 
113
113
  return exports
114
114
  })
115
+
116
+ addHook({
117
+ name: '@anthropic-ai/sdk',
118
+ file: `resources/beta/messages/messages.${extension}`,
119
+ versions: ['>=0.33.0']
120
+ }, exports => {
121
+ const Messages = exports.Messages
122
+
123
+ shimmer.wrap(Messages.prototype, 'create', wrapCreate)
124
+
125
+ return exports
126
+ })
115
127
  }
@@ -3,6 +3,8 @@
3
3
  const { channel, addHook } = require('./helpers/instrument')
4
4
  const shimmer = require('../../datadog-shimmer')
5
5
 
6
+ const patchedClientConfigProtocols = new WeakSet()
7
+
6
8
  function wrapRequest (send) {
7
9
  return function wrappedRequest (cb) {
8
10
  if (!this.service) return send.apply(this, arguments)
@@ -67,12 +69,14 @@ function wrapSmithySend (send) {
67
69
 
68
70
  if (typeof command.deserialize === 'function') {
69
71
  shimmer.wrap(command, 'deserialize', deserialize => wrapDeserialize(deserialize, channelSuffix))
70
- } else if (this.config?.protocol?.deserializeResponse) {
72
+ } else if (this.config?.protocol?.deserializeResponse && !patchedClientConfigProtocols.has(this.config.protocol)) {
71
73
  shimmer.wrap(
72
74
  this.config.protocol,
73
75
  'deserializeResponse',
74
76
  deserializeResponse => wrapDeserialize(deserializeResponse, channelSuffix, 2)
75
77
  )
78
+
79
+ patchedClientConfigProtocols.add(this.config.protocol)
76
80
  }
77
81
 
78
82
  const ctx = {