newrelic 6.10.0 → 6.11.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 (201) hide show
  1. package/CODE_OF_CONDUCT.md +46 -0
  2. package/CONTRIBUTING.md +61 -29
  3. package/LICENSE +201 -295
  4. package/NEWS.md +13 -0
  5. package/README.md +85 -683
  6. package/THIRD_PARTY_NOTICES.md +1908 -234
  7. package/THIRD_PARTY_NOTICES_ADDENDUM.md +206 -0
  8. package/api.js +5 -0
  9. package/bin/ca-gen.js +6 -0
  10. package/bin/cassandra-setup.sh +3 -0
  11. package/bin/clean.sh +3 -0
  12. package/bin/compare-bench-results.js +5 -0
  13. package/bin/docker-env-vars.sh +3 -0
  14. package/bin/docker-services.sh +3 -0
  15. package/bin/publish-docs.sh +3 -0
  16. package/bin/run-bench.js +5 -0
  17. package/bin/run-versioned-tests.sh +3 -0
  18. package/bin/smoke.sh +3 -0
  19. package/bin/ssl.sh +3 -0
  20. package/bin/test-naming-rules.js +6 -0
  21. package/bin/tracetractor +5 -0
  22. package/bin/travis-install-gcc5.sh +3 -0
  23. package/bin/travis-install-mongo.sh +3 -0
  24. package/bin/travis-node.sh +3 -0
  25. package/bin/travis-setup.sh +2 -0
  26. package/bin/update-ca-bundle.sh +3 -0
  27. package/bin/update-cats.sh +3 -0
  28. package/index.js +5 -0
  29. package/lib/adaptive-sampler.js +5 -0
  30. package/lib/agent.js +5 -0
  31. package/lib/aggregators/base-aggregator.js +5 -0
  32. package/lib/aggregators/event-aggregator.js +5 -0
  33. package/lib/aggregators/trace-aggregator.js +5 -0
  34. package/lib/attributes.js +5 -0
  35. package/lib/collector/api.js +5 -0
  36. package/lib/collector/facts.js +5 -0
  37. package/lib/collector/http-agents.js +5 -0
  38. package/lib/collector/key-parser.js +5 -0
  39. package/lib/collector/parse-response.js +5 -0
  40. package/lib/collector/remote-method.js +5 -0
  41. package/lib/collector/response.js +5 -0
  42. package/lib/collector/serverless.js +5 -0
  43. package/lib/collector/ssl/certificates.js +5 -0
  44. package/lib/config/attribute-filter.js +5 -0
  45. package/lib/config/default.js +5 -7
  46. package/lib/config/env.js +5 -6
  47. package/lib/config/harvest-config-validator.js +5 -0
  48. package/lib/config/hsm.js +5 -0
  49. package/lib/config/index.js +6 -1
  50. package/lib/config/lasp.js +5 -0
  51. package/lib/config/merge-server-config.js +5 -0
  52. package/lib/custom-events/custom-event-aggregator.js +5 -0
  53. package/lib/db/parse-sql.js +5 -0
  54. package/lib/db/parsed-statement.js +5 -0
  55. package/lib/db/query-parsers/sql.js +5 -0
  56. package/lib/db/query-sample.js +5 -0
  57. package/lib/db/query-trace-aggregator.js +5 -0
  58. package/lib/db/slow-query.js +5 -0
  59. package/lib/db/statement-matcher.js +5 -0
  60. package/lib/db/utils.js +5 -0
  61. package/lib/environment.js +5 -0
  62. package/lib/errors/error-collector.js +5 -0
  63. package/lib/errors/error-event-aggregator.js +5 -0
  64. package/lib/errors/error-trace-aggregator.js +5 -0
  65. package/lib/errors/helper.js +5 -0
  66. package/lib/errors/index.js +5 -0
  67. package/lib/feature_flags.js +7 -1
  68. package/lib/grpc/connection/states.js +5 -0
  69. package/lib/grpc/connection.js +5 -0
  70. package/lib/header-attributes.js +5 -0
  71. package/lib/header-processing.js +5 -0
  72. package/lib/instrumentation/@hapi/hapi.js +5 -0
  73. package/lib/instrumentation/amqplib.js +5 -0
  74. package/lib/instrumentation/bluebird.js +5 -0
  75. package/lib/instrumentation/cassandra-driver.js +5 -0
  76. package/lib/instrumentation/connect.js +5 -0
  77. package/lib/instrumentation/core/async_hooks.js +5 -0
  78. package/lib/instrumentation/core/child_process.js +5 -0
  79. package/lib/instrumentation/core/crypto.js +5 -0
  80. package/lib/instrumentation/core/dns.js +5 -0
  81. package/lib/instrumentation/core/domain.js +5 -0
  82. package/lib/instrumentation/core/fs.js +5 -0
  83. package/lib/instrumentation/core/globals.js +5 -0
  84. package/lib/instrumentation/core/http-outbound.js +5 -0
  85. package/lib/instrumentation/core/http.js +5 -0
  86. package/lib/instrumentation/core/inspector.js +5 -0
  87. package/lib/instrumentation/core/net.js +5 -0
  88. package/lib/instrumentation/core/timers.js +5 -0
  89. package/lib/instrumentation/core/zlib.js +5 -0
  90. package/lib/instrumentation/director.js +5 -0
  91. package/lib/instrumentation/express.js +5 -0
  92. package/lib/instrumentation/fastify/spec-builders.js +106 -0
  93. package/lib/instrumentation/fastify.js +79 -0
  94. package/lib/instrumentation/generic-pool.js +5 -0
  95. package/lib/instrumentation/hapi/hapi-17.js +5 -0
  96. package/lib/instrumentation/hapi/shared.js +5 -0
  97. package/lib/instrumentation/hapi.js +5 -0
  98. package/lib/instrumentation/ioredis.js +5 -0
  99. package/lib/instrumentation/memcached.js +5 -0
  100. package/lib/instrumentation/mongodb.js +5 -0
  101. package/lib/instrumentation/mysql.js +5 -0
  102. package/lib/instrumentation/oracle.js +5 -0
  103. package/lib/instrumentation/pg.js +5 -0
  104. package/lib/instrumentation/promise.js +5 -0
  105. package/lib/instrumentation/q.js +5 -0
  106. package/lib/instrumentation/redis.js +5 -0
  107. package/lib/instrumentation/restify.js +5 -0
  108. package/lib/instrumentation/vision.js +5 -0
  109. package/lib/instrumentation/when.js +5 -0
  110. package/lib/instrumentations.js +6 -0
  111. package/lib/logger.js +5 -0
  112. package/lib/metrics/index.js +5 -0
  113. package/lib/metrics/mapper.js +5 -0
  114. package/lib/metrics/metric-aggregator.js +4 -1
  115. package/lib/metrics/names.js +5 -0
  116. package/lib/metrics/normalizer/rule.js +5 -0
  117. package/lib/metrics/normalizer/tx_segment.js +5 -0
  118. package/lib/metrics/normalizer.js +5 -0
  119. package/lib/metrics/recorders/custom.js +5 -0
  120. package/lib/metrics/recorders/distributed-trace.js +5 -0
  121. package/lib/metrics/recorders/generic.js +5 -0
  122. package/lib/metrics/recorders/http.js +5 -0
  123. package/lib/metrics/recorders/http_external.js +5 -0
  124. package/lib/metrics/recorders/message-transaction.js +5 -0
  125. package/lib/metrics/recorders/other.js +5 -0
  126. package/lib/parse-proc-cpuinfo.js +5 -0
  127. package/lib/parse-proc-meminfo.js +5 -0
  128. package/lib/prioritized-attributes.js +5 -0
  129. package/lib/priority-queue.js +5 -0
  130. package/lib/proxy/grpc.js +5 -0
  131. package/lib/reservoir.js +5 -0
  132. package/lib/sampler.js +5 -0
  133. package/lib/serverless/api-gateway.js +5 -0
  134. package/lib/serverless/aws-lambda.js +5 -0
  135. package/lib/shim/conglomerate-shim.js +5 -0
  136. package/lib/shim/constants.js +5 -0
  137. package/lib/shim/datastore-shim.js +5 -0
  138. package/lib/shim/index.js +5 -0
  139. package/lib/shim/message-shim.js +5 -0
  140. package/lib/shim/promise-shim.js +5 -0
  141. package/lib/shim/shim.js +5 -0
  142. package/lib/shim/specs/index.js +5 -0
  143. package/lib/shim/transaction-shim.js +5 -0
  144. package/lib/shim/webframework-shim.js +7 -1
  145. package/lib/shimmer.js +5 -116
  146. package/lib/spans/create-span-event-aggregator.js +5 -0
  147. package/lib/spans/map-to-streaming-type.js +5 -0
  148. package/lib/spans/span-context.js +5 -0
  149. package/lib/spans/span-event-aggregator.js +5 -0
  150. package/lib/spans/span-event.js +5 -0
  151. package/lib/spans/span-streamer.js +5 -0
  152. package/lib/spans/streaming-span-attributes.js +5 -0
  153. package/lib/spans/streaming-span-event-aggregator.js +5 -0
  154. package/lib/spans/streaming-span-event.js +5 -0
  155. package/lib/stats/apdex.js +5 -0
  156. package/lib/stats/index.js +5 -5
  157. package/lib/system-info.js +5 -0
  158. package/lib/timer.js +5 -0
  159. package/lib/transaction/dt-payload.js +5 -0
  160. package/lib/transaction/handle.js +5 -0
  161. package/lib/transaction/index.js +5 -0
  162. package/lib/transaction/name-state.js +5 -0
  163. package/lib/transaction/trace/aggregator.js +5 -0
  164. package/lib/transaction/trace/exclusive-time-calculator.js +5 -0
  165. package/lib/transaction/trace/index.js +5 -0
  166. package/lib/transaction/trace/segment.js +5 -0
  167. package/lib/transaction/tracecontext.js +5 -0
  168. package/lib/transaction/tracer/index.js +5 -0
  169. package/lib/transaction/transaction-event-aggregator.js +5 -0
  170. package/lib/uninstrumented.js +5 -0
  171. package/lib/util/arity.js +5 -0
  172. package/lib/util/attribute-types.js +5 -0
  173. package/lib/util/byte-limit.js +5 -0
  174. package/lib/util/cat.js +5 -0
  175. package/lib/util/codec.js +5 -0
  176. package/lib/util/copy.js +5 -0
  177. package/lib/util/deep-equal.js +5 -0
  178. package/lib/util/flatten.js +5 -0
  179. package/lib/util/get.js +5 -0
  180. package/lib/util/hashes.js +5 -0
  181. package/lib/util/label-parser.js +5 -0
  182. package/lib/util/logger.js +5 -0
  183. package/lib/util/process-version.js +5 -0
  184. package/lib/util/properties.js +5 -0
  185. package/lib/util/sql/obfuscate.js +5 -0
  186. package/lib/util/stream-sink.js +5 -0
  187. package/lib/util/unwrapped-core.js +5 -0
  188. package/lib/util/urltils.js +5 -0
  189. package/lib/utilization/aws-info.js +5 -0
  190. package/lib/utilization/azure-info.js +5 -0
  191. package/lib/utilization/common.js +5 -0
  192. package/lib/utilization/docker-info.js +5 -0
  193. package/lib/utilization/gcp-info.js +5 -0
  194. package/lib/utilization/index.js +5 -0
  195. package/lib/utilization/kubernetes-info.js +5 -0
  196. package/lib/utilization/pcf-info.js +5 -0
  197. package/newrelic.js +16 -0
  198. package/package.json +5 -5
  199. package/stub_api.js +5 -0
  200. package/third_party_manifest.json +624 -0
  201. package/lib/injector.js +0 -161
@@ -0,0 +1,46 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ Examples of behavior that contributes to creating a positive environment include:
10
+
11
+ * Using welcoming and inclusive language
12
+ * Being respectful of differing viewpoints and experiences
13
+ * Gracefully accepting constructive criticism
14
+ * Focusing on what is best for the community
15
+ * Showing empathy towards other community members
16
+
17
+ Examples of unacceptable behavior by participants include:
18
+
19
+ * The use of sexualized language or imagery and unwelcome sexual attention or advances
20
+ * Trolling, insulting/derogatory comments, and personal or political attacks
21
+ * Public or private harassment
22
+ * Publishing others' private information, such as a physical or electronic address, without explicit permission
23
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+ ## Our Responsibilities
26
+
27
+ Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
+
29
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ ## Scope
32
+
33
+ This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
+
35
+ ## Enforcement
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at opensource@newrelic.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
+
39
+ Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
+
41
+ ## Attribution
42
+
43
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44
+
45
+ [homepage]: http://contributor-covenant.org
46
+ [version]: http://contributor-covenant.org/version/1/4/
package/CONTRIBUTING.md CHANGED
@@ -1,41 +1,81 @@
1
- # Guidelines for contributing code
1
+ # Guidelines for Contributing Code
2
2
 
3
3
  New Relic welcomes code contributions by the Node community to this module, and
4
4
  have taken effort to make this process easy for both contributors and our
5
5
  development team.
6
6
 
7
+ ## Process
8
+
9
+ ### Feature Requests
10
+
11
+ Feature requests should be submitted in the [Issue tracker](../../issues), with
12
+ a description of the expected behavior & use case. Before submitting an Issue,
13
+ please search for similar ones in the [closed
14
+ issues](../../issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement).
15
+
16
+ ### Pull Requests
17
+
18
+ We can only accept PRs for version v6.11.0 or greater due to open source
19
+ licensing restrictions.
20
+
21
+ ### Code of Conduct
22
+
23
+ Before contributing please read the [code of conduct](./CODE_OF_CONDUCT.md)
24
+
25
+ Note that our [code of conduct](./CODE_OF_CONDUCT.md) applies to all platforms
26
+ and venues related to this project; please follow it in all your interactions
27
+ with the project and its participants.
28
+
29
+ ### Contributor License Agreement
30
+
31
+ Keep in mind that when you submit your Pull Request, you'll need to sign the
32
+ CLA via the click-through using CLA-Assistant. If you'd like to execute our
33
+ corporate CLA, or if you have any questions, please drop us an email at
34
+ opensource@newrelic.com.
35
+
36
+ For more information about CLAs, please check out Alex Russell’s excellent
37
+ post, [“Why Do I Need to Sign
38
+ This?”](https://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
39
+
40
+ ### Slack
41
+
42
+ We host a public Slack with a dedicated channel for contributors and
43
+ maintainers of open source projects hosted by New Relic. If you are
44
+ contributing to this project, you're welcome to request access to the
45
+ \#oss-contributors channel in the newrelicusers.slack.com workspace. To request
46
+ access, see https://newrelicusers-signup.herokuapp.com/.
47
+
48
+ ## The Code
49
+
50
+ ### Version Support
51
+
7
52
  When contributing, keep in mind that New Relic customers (that's you!) are
8
53
  running many different versions of Node, some of them pretty old. Changes that
9
54
  depend on the newest version of Node will probably be rejected, with prejudice
10
55
  if they replace something backwards compatible.
11
56
 
12
- Also be aware that the instrumentation needs to work with a wide range of
13
- versions of the instrumented modules, and that code that looks nonsensical or
57
+ Be aware that the instrumentation needs to work with a wide range of versions
58
+ of the instrumented modules, and that code that looks nonsensical or
14
59
  overcomplicated may be that way for compatibility-related reasons. Read all the
15
60
  comments and check the related tests before deciding whether existing code is
16
61
  incorrect.
17
62
 
18
- ## Testing
63
+ ### Testing
19
64
 
20
65
  The agent includes a suite of unit and functional tests which should be used to
21
66
  verify your changes don't break existing functionality.
22
67
 
23
68
  Unit tests are stored in `test/`. They're written in
24
- [Mocha](https://mochajs.org), and have the extension
25
- `.test.js`.
69
+ [node-tap](https://github.com/isaacs/node-tap), and have the extension `.test.js`.
26
70
 
27
71
  Generic functional tests are stored in `test/integration/`. They're written in
28
72
  [node-tap](https://github.com/isaacs/node-tap), and have the extension
29
73
  `.tap.js`.
30
74
 
31
- Functional tests against specific versions of instrumented modules are stored in
32
- `test/versioned/`. They are also written in `node-tap`.
75
+ Functional tests against specific versions of instrumented modules are stored
76
+ in `test/versioned/`. They are also written in `node-tap`.
33
77
 
34
- There are some other tests in `test/versioned-node/`. They are works in progress
35
- and not ready for general-purpose use.
36
-
37
-
38
- ### Setup
78
+ #### Setup
39
79
 
40
80
  To run the tests you need an openssl command-line binary, and some services:
41
81
 
@@ -53,30 +93,30 @@ If you use macOS or Windows, install [Docker Desktop]
53
93
  to download and launch docker containers for each of the above services.
54
94
 
55
95
  If you have these services available on non-standard ports or elsewhere on your
56
- network, you can use the following environment variables to tell the tests where
57
- they are:
96
+ network, you can use the following environment variables to tell the tests
97
+ where they are:
58
98
 
59
99
  * NR_NODE\_TEST_<service>\_HOST
60
100
  * NR_NODE\_TEST_<service>\_PORT
61
101
 
62
102
  The service token is the all-caps version of the service name listed above.
63
103
 
64
- ### Running the tests
104
+ #### Running the tests
65
105
 
66
- Running the test suite is simple. Just run:
106
+ Running the test suite is simple. Just run:
67
107
 
68
108
  npm test
69
109
 
70
- This will install all the necessary modules (and do any required SSL certificate
71
- creation) and run the unit tests in standalone mode, followed by the functional
72
- tests if all of the unit tests pass.
110
+ This will install all the necessary modules (and do any required SSL
111
+ certificate creation) and run the unit tests in standalone mode, followed by
112
+ the functional tests if all of the unit tests pass.
73
113
 
74
114
  If you don't feel like dealing with the hassle of setting up the servers, just
75
115
  the unit tests can be run with:
76
116
 
77
117
  npm run unit
78
118
 
79
- ### Writing tests
119
+ #### Writing tests
80
120
 
81
121
  For most contributions it is strongly recommended to add additional tests which
82
122
  exercise your changes. This helps us efficiently incorporate your changes into
@@ -90,11 +130,3 @@ There are some rare cases where code changes do not result in changed
90
130
  functionality (e.g. a performance optimization) and new tests are not required.
91
131
  In general, including tests with your pull request dramatically increases the
92
132
  chances it will be accepted.
93
-
94
- ## And finally...
95
-
96
- You are welcome to send pull requests to us - however, by doing so you agree
97
- that you are granting New Relic a non-exclusive, non-revokable, no-cost license
98
- to use the code, algorithms, patents, and ideas in that code in our products if
99
- we so choose. You also agree the code is provided as-is and you provide no
100
- warranties as to its fitness or correctness for any purpose.