dd-trace 3.3.1 → 3.12.1

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 (198) hide show
  1. package/LICENSE-3rdparty.csv +8 -0
  2. package/README.md +108 -43
  3. package/ci/init.js +6 -1
  4. package/ext/exporters.d.ts +2 -1
  5. package/ext/exporters.js +2 -1
  6. package/index.d.ts +129 -36
  7. package/package.json +18 -9
  8. package/packages/datadog-instrumentations/src/body-parser.js +26 -0
  9. package/packages/datadog-instrumentations/src/cassandra-driver.js +7 -7
  10. package/packages/datadog-instrumentations/src/child-process.js +30 -0
  11. package/packages/datadog-instrumentations/src/connect.js +15 -15
  12. package/packages/datadog-instrumentations/src/cucumber.js +1 -3
  13. package/packages/datadog-instrumentations/src/elasticsearch.js +51 -47
  14. package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +1 -1
  15. package/packages/datadog-instrumentations/src/helpers/hooks.js +9 -0
  16. package/packages/datadog-instrumentations/src/helpers/register.js +5 -0
  17. package/packages/datadog-instrumentations/src/http/server.js +20 -12
  18. package/packages/datadog-instrumentations/src/http2/server.js +67 -1
  19. package/packages/datadog-instrumentations/src/jest.js +182 -25
  20. package/packages/datadog-instrumentations/src/koa.js +32 -32
  21. package/packages/datadog-instrumentations/src/ldapjs.js +91 -0
  22. package/packages/datadog-instrumentations/src/mariadb.js +63 -0
  23. package/packages/datadog-instrumentations/src/memcached.js +1 -4
  24. package/packages/datadog-instrumentations/src/mocha.js +135 -24
  25. package/packages/datadog-instrumentations/src/next.js +10 -2
  26. package/packages/datadog-instrumentations/src/opensearch.js +10 -0
  27. package/packages/datadog-instrumentations/src/oracledb.js +8 -8
  28. package/packages/datadog-instrumentations/src/pg.js +7 -3
  29. package/packages/datadog-instrumentations/src/qs.js +24 -0
  30. package/packages/datadog-instrumentations/src/redis.js +12 -3
  31. package/packages/datadog-instrumentations/src/restify.js +5 -1
  32. package/packages/datadog-instrumentations/src/rhea.js +29 -15
  33. package/packages/datadog-instrumentations/src/router.js +23 -23
  34. package/packages/datadog-plugin-amqp10/src/consumer.js +32 -0
  35. package/packages/datadog-plugin-amqp10/src/index.js +11 -101
  36. package/packages/datadog-plugin-amqp10/src/producer.js +34 -0
  37. package/packages/datadog-plugin-amqp10/src/util.js +15 -0
  38. package/packages/datadog-plugin-amqplib/src/client.js +38 -0
  39. package/packages/datadog-plugin-amqplib/src/consumer.js +40 -0
  40. package/packages/datadog-plugin-amqplib/src/index.js +14 -102
  41. package/packages/datadog-plugin-amqplib/src/producer.js +37 -0
  42. package/packages/datadog-plugin-amqplib/src/util.js +14 -0
  43. package/packages/datadog-plugin-cassandra-driver/src/index.js +22 -60
  44. package/packages/datadog-plugin-cucumber/src/index.js +14 -33
  45. package/packages/datadog-plugin-cypress/src/plugin.js +2 -1
  46. package/packages/datadog-plugin-dns/src/index.js +16 -91
  47. package/packages/datadog-plugin-dns/src/lookup.js +40 -0
  48. package/packages/datadog-plugin-dns/src/lookup_service.js +24 -0
  49. package/packages/datadog-plugin-dns/src/resolve.js +24 -0
  50. package/packages/datadog-plugin-dns/src/reverse.js +21 -0
  51. package/packages/datadog-plugin-elasticsearch/src/index.js +24 -60
  52. package/packages/datadog-plugin-google-cloud-pubsub/src/client.js +24 -0
  53. package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +41 -0
  54. package/packages/datadog-plugin-google-cloud-pubsub/src/index.js +14 -99
  55. package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +33 -0
  56. package/packages/datadog-plugin-graphql/src/execute.js +73 -0
  57. package/packages/datadog-plugin-graphql/src/index.js +14 -176
  58. package/packages/datadog-plugin-graphql/src/parse.js +32 -0
  59. package/packages/datadog-plugin-graphql/src/resolve.js +70 -76
  60. package/packages/datadog-plugin-graphql/src/validate.js +28 -0
  61. package/packages/datadog-plugin-grpc/src/client.js +46 -55
  62. package/packages/datadog-plugin-grpc/src/index.js +7 -24
  63. package/packages/datadog-plugin-grpc/src/server.js +50 -52
  64. package/packages/datadog-plugin-grpc/src/util.js +15 -14
  65. package/packages/datadog-plugin-http/src/client.js +15 -5
  66. package/packages/datadog-plugin-http/src/index.js +7 -22
  67. package/packages/datadog-plugin-http/src/server.js +19 -3
  68. package/packages/datadog-plugin-http2/src/client.js +20 -1
  69. package/packages/datadog-plugin-http2/src/index.js +8 -26
  70. package/packages/datadog-plugin-http2/src/server.js +44 -0
  71. package/packages/datadog-plugin-jest/src/index.js +41 -65
  72. package/packages/datadog-plugin-kafkajs/src/consumer.js +42 -0
  73. package/packages/datadog-plugin-kafkajs/src/index.js +11 -87
  74. package/packages/datadog-plugin-kafkajs/src/producer.js +31 -0
  75. package/packages/datadog-plugin-mariadb/src/index.js +10 -0
  76. package/packages/datadog-plugin-memcached/src/index.js +17 -52
  77. package/packages/datadog-plugin-mocha/src/index.js +40 -60
  78. package/packages/datadog-plugin-moleculer/src/client.js +22 -36
  79. package/packages/datadog-plugin-moleculer/src/index.js +8 -26
  80. package/packages/datadog-plugin-moleculer/src/server.js +18 -30
  81. package/packages/datadog-plugin-mongodb-core/src/index.js +23 -51
  82. package/packages/datadog-plugin-mysql/src/index.js +23 -52
  83. package/packages/datadog-plugin-mysql2/src/index.js +1 -3
  84. package/packages/datadog-plugin-net/src/index.js +4 -0
  85. package/packages/datadog-plugin-net/src/ipc.js +21 -0
  86. package/packages/datadog-plugin-net/src/tcp.js +46 -0
  87. package/packages/datadog-plugin-next/src/index.js +3 -0
  88. package/packages/datadog-plugin-opensearch/src/index.js +11 -0
  89. package/packages/datadog-plugin-oracledb/src/index.js +29 -55
  90. package/packages/datadog-plugin-pg/src/index.js +27 -51
  91. package/packages/datadog-plugin-redis/src/index.js +29 -60
  92. package/packages/datadog-plugin-rhea/src/consumer.js +55 -0
  93. package/packages/datadog-plugin-rhea/src/index.js +11 -96
  94. package/packages/datadog-plugin-rhea/src/producer.js +45 -0
  95. package/packages/datadog-plugin-router/src/index.js +13 -2
  96. package/packages/datadog-plugin-sharedb/src/index.js +22 -39
  97. package/packages/datadog-plugin-tedious/src/index.js +20 -41
  98. package/packages/dd-trace/src/appsec/addresses.js +3 -1
  99. package/packages/dd-trace/src/appsec/blocking.js +44 -0
  100. package/packages/dd-trace/src/appsec/callbacks/ddwaf.js +8 -6
  101. package/packages/dd-trace/src/appsec/gateway/engine/engine.js +1 -1
  102. package/packages/dd-trace/src/appsec/gateway/engine/index.js +7 -2
  103. package/packages/dd-trace/src/appsec/gateway/engine/runner.js +0 -1
  104. package/packages/dd-trace/src/appsec/iast/analyzers/analyzers.js +4 -1
  105. package/packages/dd-trace/src/appsec/iast/analyzers/command-injection-analyzer.js +11 -0
  106. package/packages/dd-trace/src/appsec/iast/analyzers/injection-analyzer.js +19 -0
  107. package/packages/dd-trace/src/appsec/iast/analyzers/ldap-injection-analyzer.js +11 -0
  108. package/packages/dd-trace/src/appsec/iast/analyzers/sql-injection-analyzer.js +13 -0
  109. package/packages/dd-trace/src/appsec/iast/analyzers/vulnerability-analyzer.js +43 -5
  110. package/packages/dd-trace/src/appsec/iast/iast-context.js +3 -1
  111. package/packages/dd-trace/src/appsec/iast/index.js +24 -8
  112. package/packages/dd-trace/src/appsec/iast/overhead-controller.js +20 -1
  113. package/packages/dd-trace/src/appsec/iast/path-line.js +17 -6
  114. package/packages/dd-trace/src/appsec/iast/taint-tracking/csi-methods.js +17 -0
  115. package/packages/dd-trace/src/appsec/iast/taint-tracking/filter.js +16 -0
  116. package/packages/dd-trace/src/appsec/iast/taint-tracking/index.js +18 -0
  117. package/packages/dd-trace/src/appsec/iast/taint-tracking/operations.js +98 -0
  118. package/packages/dd-trace/src/appsec/iast/taint-tracking/origin-types.js +4 -0
  119. package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +38 -0
  120. package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +67 -0
  121. package/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js +103 -0
  122. package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +98 -30
  123. package/packages/dd-trace/src/appsec/index.js +79 -25
  124. package/packages/dd-trace/src/{plugins/util → appsec}/ip_blocklist.js +0 -0
  125. package/packages/dd-trace/src/appsec/ip_extractor.js +98 -0
  126. package/packages/dd-trace/src/appsec/recommended.json +134 -53
  127. package/packages/dd-trace/src/appsec/remote_config/capabilities.js +7 -0
  128. package/packages/dd-trace/src/appsec/remote_config/index.js +56 -0
  129. package/packages/dd-trace/src/appsec/remote_config/manager.js +264 -0
  130. package/packages/dd-trace/src/{exporters → appsec/remote_config}/scheduler.js +9 -9
  131. package/packages/dd-trace/src/appsec/rule_manager.js +61 -1
  132. package/packages/dd-trace/src/appsec/templates/blocked.html +99 -0
  133. package/packages/dd-trace/src/appsec/templates/blocked.json +8 -0
  134. package/packages/dd-trace/src/ci-visibility/exporters/agent-proxy/index.js +66 -0
  135. package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +9 -5
  136. package/packages/dd-trace/src/ci-visibility/exporters/agentless/index.js +19 -51
  137. package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +10 -5
  138. package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +202 -0
  139. package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +51 -62
  140. package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-itr-configuration.js +89 -0
  141. package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +82 -0
  142. package/packages/dd-trace/src/config.js +119 -35
  143. package/packages/dd-trace/src/constants.js +9 -1
  144. package/packages/dd-trace/src/dogstatsd.js +42 -10
  145. package/packages/dd-trace/src/encode/agentless-ci-visibility.js +10 -2
  146. package/packages/dd-trace/src/encode/coverage-ci-visibility.js +0 -1
  147. package/packages/dd-trace/src/exporter.js +3 -0
  148. package/packages/dd-trace/src/exporters/agent/index.js +10 -2
  149. package/packages/dd-trace/src/exporters/agent/writer.js +2 -9
  150. package/packages/dd-trace/src/exporters/common/agent-info-exporter.js +82 -0
  151. package/packages/dd-trace/src/exporters/common/request.js +51 -1
  152. package/packages/dd-trace/src/exporters/span-stats/index.js +6 -2
  153. package/packages/dd-trace/src/format.js +29 -10
  154. package/packages/dd-trace/src/lambda/handler.js +72 -0
  155. package/packages/dd-trace/src/lambda/index.js +5 -0
  156. package/packages/dd-trace/src/lambda/runtime/errors.js +20 -0
  157. package/packages/dd-trace/src/lambda/runtime/patch.js +74 -0
  158. package/packages/dd-trace/src/lambda/runtime/ritm.js +138 -0
  159. package/packages/dd-trace/src/metrics.js +15 -2
  160. package/packages/dd-trace/src/opentracing/propagation/text_map.js +1 -5
  161. package/packages/dd-trace/src/opentracing/span.js +2 -1
  162. package/packages/dd-trace/src/opentracing/span_context.js +9 -0
  163. package/packages/dd-trace/src/plugin_manager.js +11 -17
  164. package/packages/dd-trace/src/plugins/cache.js +9 -0
  165. package/packages/dd-trace/src/plugins/ci_plugin.js +97 -0
  166. package/packages/dd-trace/src/plugins/client.js +9 -0
  167. package/packages/dd-trace/src/plugins/composite.js +26 -0
  168. package/packages/dd-trace/src/plugins/consumer.js +9 -0
  169. package/packages/dd-trace/src/plugins/database.js +55 -0
  170. package/packages/dd-trace/src/plugins/incoming.js +7 -0
  171. package/packages/dd-trace/src/plugins/index.js +3 -0
  172. package/packages/dd-trace/src/plugins/log_plugin.js +2 -2
  173. package/packages/dd-trace/src/plugins/outgoing.js +31 -0
  174. package/packages/dd-trace/src/plugins/plugin.js +3 -0
  175. package/packages/dd-trace/src/plugins/producer.js +9 -0
  176. package/packages/dd-trace/src/plugins/server.js +9 -0
  177. package/packages/dd-trace/src/plugins/storage.js +21 -0
  178. package/packages/dd-trace/src/plugins/tracing.js +94 -0
  179. package/packages/dd-trace/src/plugins/util/ci.js +40 -4
  180. package/packages/dd-trace/src/plugins/util/git.js +58 -18
  181. package/packages/dd-trace/src/plugins/util/test.js +71 -8
  182. package/packages/dd-trace/src/plugins/util/user-provided-git.js +14 -1
  183. package/packages/dd-trace/src/plugins/util/web.js +11 -114
  184. package/packages/dd-trace/src/priority_sampler.js +6 -2
  185. package/packages/dd-trace/src/profiling/config.js +11 -6
  186. package/packages/dd-trace/src/profiling/exporters/agent.js +4 -0
  187. package/packages/dd-trace/src/profiling/index.js +2 -2
  188. package/packages/dd-trace/src/profiling/profiler.js +43 -7
  189. package/packages/dd-trace/src/proxy.js +8 -16
  190. package/packages/dd-trace/src/ritm.js +25 -14
  191. package/packages/dd-trace/src/span_processor.js +17 -0
  192. package/packages/dd-trace/src/span_sampler.js +77 -0
  193. package/packages/dd-trace/src/span_stats.js +2 -2
  194. package/packages/dd-trace/src/telemetry/dependencies.js +21 -7
  195. package/packages/dd-trace/src/telemetry/index.js +7 -1
  196. package/packages/dd-trace/src/telemetry/send-data.js +3 -1
  197. package/packages/dd-trace/src/tracer.js +10 -5
  198. package/packages/dd-trace/src/util.js +43 -1
@@ -1,6 +1,8 @@
1
1
  Component,Origin,License,Copyright
2
2
  require,@datadog/native-appsec,Apache license 2.0,Copyright 2018 Datadog Inc.
3
3
  require,@datadog/native-metrics,Apache license 2.0,Copyright 2018 Datadog Inc.
4
+ require,@datadog/native-iast-rewriter,Apache license 2.0,Copyright 2018 Datadog Inc.
5
+ require,@datadog/native-iast-taint-tracking,Apache license 2.0,Copyright 2018 Datadog Inc.
4
6
  require,@datadog/pprof,Apache license 2.0,Copyright 2019 Google Inc.
5
7
  require,@datadog/sketches-js,Apache license 2.0,Copyright 2020 Datadog Inc.
6
8
  require,crypto-randomuuid,MIT,Copyright 2021 Node.js Foundation and contributors
@@ -18,8 +20,10 @@ require,lodash.uniq,MIT,Copyright JS Foundation and other contributors
18
20
  require,lru-cache,ISC,Copyright (c) 2010-2022 Isaac Z. Schlueter and Contributors
19
21
  require,methods,MIT,Copyright 2013-2014 TJ Holowaychuk
20
22
  require,module-details-from-path,MIT,Copyright 2016 Thomas Watson Steen
23
+ require,node-abort-controller,MIT,Copyright (c) 2019 Steve Faulkner
21
24
  require,opentracing,MIT,Copyright 2016 Resonance Labs Inc
22
25
  require,path-to-regexp,MIT,Copyright 2014 Blake Embrey
26
+ require,protobufjs,BSD-3-Clause,Copyright 2016 Daniel Wirtz
23
27
  require,retry,MIT,Copyright 2011 Tim Koschützki Felix Geisendörfer
24
28
  require,semver,ISC,Copyright Isaac Z. Schlueter and Contributors
25
29
  dev,@types/node,MIT,Copyright Authors
@@ -35,6 +39,7 @@ dev,dotenv,BSD-2-Clause,Copyright 2015 Scott Motte
35
39
  dev,eslint,MIT,Copyright JS Foundation and other contributors https://js.foundation
36
40
  dev,eslint-config-standard,MIT,Copyright Feross Aboukhadijeh
37
41
  dev,eslint-plugin-import,MIT,Copyright 2015 Ben Mosher
42
+ dev,eslint-plugin-mocha,MIT,Copyright 2014 Mathias Schreck
38
43
  dev,eslint-plugin-node,MIT,Copyright 2015 Toru Nagashima
39
44
  dev,eslint-plugin-promise,ISC,jden and other contributors
40
45
  dev,eslint-plugin-standard,MIT,Copyright 2015 Jamund Ferguson
@@ -46,6 +51,8 @@ dev,int64-buffer,MIT,Copyright 2015-2016 Yusuke Kawasaki
46
51
  dev,jszip,MIT,Copyright 2015-2016 Stuart Knightley and contributors
47
52
  dev,mkdirp,MIT,Copyright 2010 James Halliday
48
53
  dev,mocha,MIT,Copyright 2011-2018 JS Foundation and contributors https://js.foundation
54
+ dev,mocha-junit-reporter,MIT,Copyright (c) 2015 Michael Allen
55
+ dev,mocha-multi-reporters,MIT,Copyright 2019 Yousaf Nabi and 2015 Stanley Ng
49
56
  dev,multer,MIT,Copyright 2014 Hage Yaapa
50
57
  dev,msgpack-lite,MIT,Copyright 2015 Yusuke Kawasaki
51
58
  dev,nock,MIT,Copyright 2017 Pedro Teixeira and other contributors
@@ -56,4 +63,5 @@ dev,sinon,BSD-3-Clause,Copyright 2010-2017 Christian Johansen
56
63
  dev,sinon-chai,WTFPL and BSD-2-Clause,Copyright 2004 Sam Hocevar 2012–2017 Domenic Denicola
57
64
  dev,tape,MIT,Copyright James Halliday
58
65
  dev,wait-on,MIT,Copyright 2015 Jeff Barczewski
66
+ file,aws-lambda-nodejs-runtime-interface-client,Apache 2.0,Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
59
67
  file,profile.proto,Apache license 2.0,Copyright 2016 Google Inc.
package/README.md CHANGED
@@ -1,76 +1,139 @@
1
- # dd-trace-js
1
+ # `dd-trace`: Node.js APM Tracer Library
2
2
 
3
- [![npm](https://img.shields.io/npm/v/dd-trace.svg?colorB=blue)](https://www.npmjs.com/package/dd-trace)
4
- [![npm (tag)](https://img.shields.io/npm/v/dd-trace/dev.svg)](https://www.npmjs.com/package/dd-trace/v/dev)
5
- [![CircleCI](https://circleci.com/gh/DataDog/dd-trace-js.svg?style=shield)](https://circleci.com/gh/DataDog/dd-trace-js)
3
+ [![npm v3](https://img.shields.io/npm/v/dd-trace/latest?color=blue&label=dd-trace%40v3&logo=npm)](https://www.npmjs.com/package/dd-trace)
4
+ [![npm v2](https://img.shields.io/npm/v/dd-trace/latest-node12?color=blue&label=dd-trace%40v2&logo=npm)](https://www.npmjs.com/package/dd-trace/v/latest-node12)
5
+ [![npm dev](https://img.shields.io/npm/v/dd-trace/dev?color=orange&label=dd-trace%40dev&logo=npm)](https://www.npmjs.com/package/dd-trace/v/dev)
6
6
  [![codecov](https://codecov.io/gh/DataDog/dd-trace-js/branch/master/graph/badge.svg)](https://codecov.io/gh/DataDog/dd-trace-js)
7
7
 
8
- **Node.js APM Tracer**
8
+ <img align="right" src="https://user-images.githubusercontent.com/551402/208212084-1d0c07e2-4135-4c61-b2da-8f2fddbc66ed.png" alt="Bits the dog JavaScript" width="200px"/>
9
9
 
10
- Datadog APM tracing client for Node.js.
10
+ `dd-trace` is an npm package that you can install in your Node.js application to capture APM (Application Performance Monitoring) data. In Datadog terminology this library is called a Tracer. This data is then sent off to a process which collects and aggregates the data, called an Agent. Finally the data is sent off to the Datadog servers where it's stored and made available for querying in a myriad of ways, such as displaying in a dashboard or triggering alerts.
11
11
 
12
- ## Getting Started
12
+ ![Tracer, Agent, Datadog relationship diagram](./docs/relationship.png)
13
13
 
14
- For a basic product overview, check out our [setup documentation](https://docs.datadoghq.com/tracing/languages/nodejs/).
15
14
 
16
- For installation, configuration, and details about using the API, check out our [API documentation](https://datadog.github.io/dd-trace-js).
15
+ ## Documentation
16
+
17
+ Most of the documentation for `dd-trace` is available on these webpages:
18
+
19
+ - [Tracing Node.js Applications](https://docs.datadoghq.com/tracing/languages/nodejs/) - most project documentation, including setup instructions
20
+ - [Configuring the NodeJS Tracing Library](https://docs.datadoghq.com/tracing/trace_collection/library_config/nodejs) - environment variables and config options
21
+ - [API Documentation](https://datadog.github.io/dd-trace-js) - method signatures, plugin list, and some usage examples
22
+ - [APM Terms and Concepts](https://docs.datadoghq.com/tracing/visualization/) - a glossary of concepts applicable across all languages
23
+
24
+
25
+ ## Version Release Lines and Maintenance
26
+
27
+ | Release Line | Latest Version | Status |Initial Release | End of Life |
28
+ | :--: | :--: | :---: | :---: | :---: |
29
+ | [`v1`](https://github.com/DataDog/dd-trace-js/tree/v1.x) | ![npm v1](https://img.shields.io/npm/v/dd-trace/legacy-v1?color=white&label=%20&style=flat-square) | **End of Life** | 2021-07-13 | 2022-02-25 |
30
+ | [`v2`](https://github.com/DataDog/dd-trace-js/tree/v2.x) | ![npm v2](https://img.shields.io/npm/v/dd-trace/latest-node12?color=white&label=%20&style=flat-square) | **Maintenance** | 2022-01-28 | 2023-08-15 |
31
+ | [`v3`](https://github.com/DataDog/dd-trace-js/tree/v3.x) | ![npm v3](https://img.shields.io/npm/v/dd-trace/latest?color=white&label=%20&style=flat-square) | **Current** | 2022-08-15 | Unknown |
32
+
33
+ We currently maintain two release lines, namely `v2` and `v3`.
34
+ Features and bug fixes that are merged are released to the `v3` line and, if appropriate, also the `v2` line.
35
+
36
+ For any new projects it is recommended to use the `v3` release line:
37
+
38
+ ```sh
39
+ $ npm install dd-trace
40
+ $ yarn add dd-trace
41
+ ```
42
+
43
+ However, existing projects that already use the `v2` release line, or projects that need to support Node.js v12, may use the `v2` release line.
44
+ This is done by specifying the version when installing the package.
45
+ Note that we also publish to npm using a `latest-node12` tag that can also be used for install:
46
+
47
+ ```sh
48
+ $ npm install dd-trace@2
49
+ $ yarn add dd-trace@2
50
+ $ npm install dd-trace@latest-node12
51
+ $ yarn add dd-trace@latest-node12
52
+ ```
53
+
54
+ Any backwards-breaking functionality that is introduced into the library will result in an increase of the major version of the library and therefore a new release line.
55
+ Such releases are kept to a minimum to reduce the pain of upgrading the library.
56
+
57
+ When a new release line is introduced the previous release line then enters maintenance mode where it will receive updates for the next year.
58
+ Once that year is up the release line enters End of Life and will not receive new updates.
59
+ The library also follows the Node.js LTS lifecycle wherein new release lines drop compatibility with Node.js versions that reach end of life (with the maintenance release line still receiving updates for a year).
60
+
61
+ For more information about library versioning and compatibility, see the [NodeJS Compatibility Requirements](https://docs.datadoghq.com/tracing/trace_collection/compatibility/nodejs/#releases) page.
62
+
63
+ Changes associated with each individual release are documented on the [GitHub Releases](https://github.com/DataDog/dd-trace-js/releases) screen.
17
64
 
18
- For descriptions of terminology used in APM, take a look at the [official documentation](https://docs.datadoghq.com/tracing/visualization/).
19
65
 
20
66
  ## Development
21
67
 
22
68
  Before contributing to this open source project, read our [CONTRIBUTING.md](https://github.com/DataDog/dd-trace-js/blob/master/CONTRIBUTING.md).
23
69
 
24
- ## Security Vulnerabilities
25
70
 
26
- If you have found a security issue, please contact the security team directly at [security@datadoghq.com](mailto:security@datadoghq.com).
27
-
28
- ### Requirements
71
+ ## Requirements
29
72
 
30
73
  Since this project supports multiple Node versions, using a version
31
74
  manager such as [nvm](https://github.com/creationix/nvm) is recommended.
32
75
 
33
76
  We use [yarn](https://yarnpkg.com/) for its workspace functionality, so make sure to install that as well.
34
77
 
35
- To get started once you have Node and yarn installed, run:
78
+ To install dependencies once you have Node and yarn installed, run:
36
79
 
37
80
  ```sh
38
81
  $ yarn
39
82
  ```
40
83
 
41
- ### Testing
42
84
 
43
- Before running the tests, the data stores need to be running.
85
+ ## Testing
86
+
87
+ Before running _plugin_ tests, the data stores need to be running.
44
88
  The easiest way to start all of them is to use the provided
45
89
  docker-compose configuration:
46
90
 
47
91
  ```sh
48
92
  $ docker-compose up -d -V --remove-orphans --force-recreate
93
+ $ yarn services
49
94
  ```
50
95
 
51
- #### Unit Tests
52
96
 
53
- To run the unit tests, use:
97
+ ### Unit Tests
98
+
99
+ There are several types of unit tests, for various types of components. The
100
+ following commands may be useful:
54
101
 
55
102
  ```sh
56
- $ yarn test
103
+ # Tracer core tests (i.e. testing `packages/dd-trace`)
104
+ $ yarn test:trace:core
105
+ # "Core" library tests (i.e. testing `packages/datadog-core`
106
+ $ yarn test:core
107
+ # Instrumentations tests (i.e. testing `packages/datadog-instrumentations`
108
+ $ yarn test:instrumentations
57
109
  ```
58
110
 
59
- To run the unit tests continuously in watch mode while developing, use:
111
+ Several other components have test commands as well. See `package.json` for
112
+ details.
113
+
114
+ To test _plugins_ (i.e. components in `packages/datadog-plugin-XXXX`
115
+ directories, set the `PLUGINS` environment variable to the plugin you're
116
+ interested in, and use `yarn test:plugins`. If you need to test multiple
117
+ plugins you may separate then with a pipe (`|`) delimiter. Here's an
118
+ example testing the `express` and `bluebird` plugins:
60
119
 
61
120
  ```sh
62
- $ yarn tdd
121
+ PLUGINS="express|bluebird" yarn test:plugins
63
122
  ```
64
123
 
65
- #### Memory Leaks
124
+
125
+ ### Memory Leaks
66
126
 
67
127
  To run the memory leak tests, use:
68
128
 
69
129
  ```sh
70
- $ yarn leak
130
+ $ yarn leak:core
131
+
132
+ # or
133
+
134
+ $ yarn leak:plugins
71
135
  ```
72
136
 
73
- Please note that memory leak tests only run on Node `>=8`.
74
137
 
75
138
  ### Linting
76
139
 
@@ -83,29 +146,31 @@ To run the linter, use:
83
146
  $ yarn lint
84
147
  ```
85
148
 
86
- ### Continuous Integration
87
149
 
88
- We rely on CircleCI 2.0 for our tests. If you want to test how the CI behaves
89
- locally, you can use the CircleCI Command Line Interface as described here:
90
- https://circleci.com/docs/2.0/local-jobs/
150
+ ### Benchmarks
91
151
 
92
- After installing the `circleci` CLI, simply run one of the following:
152
+ Our microbenchmarks live in `benchmark/sirun`. Each directory in there
153
+ corresponds to a specific benchmark test and its variants, which are used to
154
+ track regressions and improvements over time.
155
+
156
+ In addition to those, when two or more approaches must be compared, please write
157
+ a benchmark in the `benchmark/index.js` module so that we can keep track of the
158
+ most efficient algorithm. To run your benchmark, use:
93
159
 
94
160
  ```sh
95
- $ circleci build --job lint
96
- $ circleci build --job node-leaks
97
- $ circleci build --job node-core-8
98
- $ circleci build --job node-core-10
99
- $ circleci build --job node-core-12
100
- $ circleci build --job node-core-latest
161
+ $ yarn bench
101
162
  ```
102
163
 
103
- ### Benchmarks
104
164
 
105
- When two or more approaches must be compared, please write a benchmark
106
- in the `benchmark/index.js` module so that we can keep track of the
107
- most efficient algorithm. To run your benchmark, just:
165
+ ## Serverless / Lambda
108
166
 
109
- ```sh
110
- $ yarn bench
111
- ```
167
+ Note that there is a separate Lambda project, [datadog-lambda-js](https://github.com/DataDog/datadog-lambda-js), that is responsible for enabling metrics and distributed tracing when your application runs on Lambda.
168
+ That project does depend on the `dd-trace` package but also adds a lot of Lambda-related niceties.
169
+ If you find any issues specific to Lambda integrations then the issues may get solved quicker if they're added to that repository.
170
+ That said, even if your application runs on Lambda, any core instrumentation issues not related to Lambda itself may be better served by opening an issue in this repository.
171
+ Regardless of where you open the issue, someone at Datadog will try to help.
172
+
173
+
174
+ ## Security Vulnerabilities
175
+
176
+ If you have found a security issue, please contact the security team directly at [security@datadoghq.com](mailto:security@datadoghq.com).
package/ci/init.js CHANGED
@@ -7,7 +7,8 @@ const options = {
7
7
  startupLogs: false,
8
8
  tags: {
9
9
  [ORIGIN_KEY]: 'ciapp-test'
10
- }
10
+ },
11
+ isCiVisibility: true
11
12
  }
12
13
 
13
14
  let shouldInit = true
@@ -25,6 +26,10 @@ but neither DD_API_KEY nor DATADOG_API_KEY are set in your environment, \
25
26
  so dd-trace will not be initialized.`)
26
27
  shouldInit = false
27
28
  }
29
+ } else {
30
+ options.experimental = {
31
+ exporter: 'agent_proxy'
32
+ }
28
33
  }
29
34
 
30
35
  if (shouldInit) {
@@ -1,7 +1,8 @@
1
1
  declare const exporters: {
2
2
  LOG: 'log',
3
3
  AGENT: 'agent',
4
- DATADOG: 'datadog'
4
+ DATADOG: 'datadog',
5
+ AGENT_PROXY: 'agent_proxy'
5
6
  }
6
7
 
7
8
  export = exporters
package/ext/exporters.js CHANGED
@@ -2,5 +2,6 @@
2
2
  module.exports = {
3
3
  LOG: 'log',
4
4
  AGENT: 'agent',
5
- DATADOG: 'datadog'
5
+ DATADOG: 'datadog',
6
+ AGENT_PROXY: 'agent_proxy'
6
7
  }