newrelic 7.1.3 → 7.3.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 (45) hide show
  1. package/NEWS.md +72 -0
  2. package/THIRD_PARTY_NOTICES.md +33 -2
  3. package/bin/test-naming-rules.js +4 -4
  4. package/lib/collector/facts.js +22 -8
  5. package/lib/collector/http-agents.js +20 -7
  6. package/lib/collector/remote-method.js +18 -4
  7. package/lib/config/index.js +34 -42
  8. package/lib/feature_flags.js +6 -2
  9. package/lib/grpc/connection.js +39 -15
  10. package/lib/instrumentation/core/async_hooks.js +106 -14
  11. package/lib/instrumentation/core/http.js +5 -0
  12. package/lib/shim/shim.js +6 -1
  13. package/lib/spans/create-span-event-aggregator.js +1 -0
  14. package/lib/spans/span-event.js +6 -3
  15. package/lib/spans/streaming-span-event.js +6 -3
  16. package/lib/transaction/index.js +29 -0
  17. package/newrelic.js +1 -1
  18. package/package.json +19 -6
  19. package/CONTRIBUTING.md +0 -135
  20. package/Migration Guide.md +0 -271
  21. package/ROADMAP_Node.md +0 -24
  22. package/SECURITY.md +0 -5
  23. package/THIRD_PARTY_NOTICES_ADDENDUM.md +0 -213
  24. package/bin/ca-gen.js +0 -91
  25. package/bin/cassandra-setup.sh +0 -11
  26. package/bin/check-workflow-run.js +0 -74
  27. package/bin/clean.sh +0 -18
  28. package/bin/compare-bench-results.js +0 -172
  29. package/bin/create-github-release.js +0 -109
  30. package/bin/create-release-tag.js +0 -95
  31. package/bin/docker-env-vars.sh +0 -15
  32. package/bin/docker-services.sh +0 -49
  33. package/bin/git-commands.js +0 -110
  34. package/bin/github.js +0 -144
  35. package/bin/npm-commands.js +0 -31
  36. package/bin/prepare-release.js +0 -359
  37. package/bin/publish-docs.sh +0 -16
  38. package/bin/run-bench.js +0 -137
  39. package/bin/run-versioned-tests.sh +0 -24
  40. package/bin/smoke.sh +0 -8
  41. package/bin/ssl.sh +0 -87
  42. package/bin/update-ca-bundle.sh +0 -20
  43. package/bin/update-cats.sh +0 -8
  44. package/jsdoc-conf.json +0 -18
  45. package/third_party_manifest.json +0 -619
@@ -267,6 +267,11 @@ function wrapResponseEnd(agent, proto) {
267
267
  return end.apply(this, arguments)
268
268
  }
269
269
 
270
+ if (!txInfo.transaction.isActive()) {
271
+ logger.trace('wrappedResEnd invoked for ended transaction implying multiple invocations.')
272
+ return end.apply(this, arguments)
273
+ }
274
+
270
275
  // If an error happened, add it to the aggregator.
271
276
  if (txInfo.error) {
272
277
  if (!txInfo.errorHandled || urltils.isError(agent.config, this.statusCode)) {
package/lib/shim/shim.js CHANGED
@@ -1895,7 +1895,12 @@ function shimRequire(filePath) {
1895
1895
  try {
1896
1896
  return require(path.resolve(this._moduleRoot, filePath))
1897
1897
  } catch (e) {
1898
- this.logger.debug('Failed to load %j: %s', filePath, e.stack)
1898
+ this.logger.debug(
1899
+ 'Failed to load \'%s\' from module root: \'%s\'. Stack: %s',
1900
+ filePath,
1901
+ this._moduleRoot,
1902
+ e.stack
1903
+ )
1899
1904
  return null
1900
1905
  }
1901
1906
  }
@@ -72,6 +72,7 @@ function createStandardAggregator(config, collector, metrics) {
72
72
  }
73
73
 
74
74
  function validateInfiniteTracing(trace_observer) {
75
+ // TODO: Remove semver check when Node 10 support dropped.
75
76
  if (!psemver.satisfies('>=10.10.0')) {
76
77
  logger.warn(
77
78
  'Infinite tracing disabled: this version of Node is not supported (must be >=10.10.0)'
@@ -9,7 +9,7 @@ const Config = require('../config')
9
9
  const {truncate} = require('../util/byte-limit')
10
10
 
11
11
  const {DESTINATIONS} = require('../config/attribute-filter')
12
- const NAMES = require('../metrics/names')
12
+
13
13
  const HTTP_LIBRARY = 'http'
14
14
  const CLIENT_KIND = 'client'
15
15
  const CATEGORIES = {
@@ -18,6 +18,9 @@ const CATEGORIES = {
18
18
  GENERIC: 'generic'
19
19
  }
20
20
 
21
+ const EXTERNAL_REGEX = /^(?:Truncated\/)?External\//
22
+ const DATASTORE_REGEX = /^(?:Truncated\/)?Datastore\//
23
+
21
24
  const EMPTY_USER_ATTRS = Object.freeze(Object.create(null))
22
25
 
23
26
  /**
@@ -200,7 +203,7 @@ class HttpSpanEvent extends SpanEvent {
200
203
  }
201
204
 
202
205
  static testSegment(segment) {
203
- return segment.name.startsWith(NAMES.EXTERNAL.PREFIX)
206
+ return EXTERNAL_REGEX.test(segment.name)
204
207
  }
205
208
  }
206
209
 
@@ -259,7 +262,7 @@ class DatastoreSpanEvent extends SpanEvent {
259
262
  }
260
263
 
261
264
  static testSegment(segment) {
262
- return segment.name.startsWith(NAMES.DB.PREFIX)
265
+ return DATASTORE_REGEX.test(segment.name)
263
266
  }
264
267
  }
265
268
 
@@ -10,7 +10,7 @@ const {truncate} = require('../util/byte-limit')
10
10
  const Config = require('../config')
11
11
 
12
12
  const {DESTINATIONS} = require('../config/attribute-filter')
13
- const NAMES = require('../metrics/names')
13
+
14
14
  const HTTP_LIBRARY = 'http'
15
15
  const CLIENT_KIND = 'client'
16
16
  const CATEGORIES = {
@@ -19,6 +19,9 @@ const CATEGORIES = {
19
19
  GENERIC: 'generic'
20
20
  }
21
21
 
22
+ const EXTERNAL_REGEX = /^(?:Truncated\/)?External\//
23
+ const DATASTORE_REGEX = /^(?:Truncated\/)?Datastore\//
24
+
22
25
  /**
23
26
  * Specialized span event class for use with infinite streaming.
24
27
  * Currently designed to be sent over grpc via the v1.proto definition.
@@ -200,7 +203,7 @@ class StreamingHttpSpanEvent extends StreamingSpanEvent {
200
203
  }
201
204
 
202
205
  static isHttpSegment(segment) {
203
- return segment.name.startsWith(NAMES.EXTERNAL.PREFIX)
206
+ return EXTERNAL_REGEX.test(segment.name)
204
207
  }
205
208
  }
206
209
 
@@ -269,7 +272,7 @@ class StreamingDatastoreSpanEvent extends StreamingSpanEvent {
269
272
  }
270
273
 
271
274
  static isDatastoreSegment(segment) {
272
- return segment.name.startsWith(NAMES.DB.PREFIX)
275
+ return DATASTORE_REGEX.test(segment.name)
273
276
  }
274
277
  }
275
278
 
@@ -225,9 +225,28 @@ Transaction.prototype.end = function end() {
225
225
  }
226
226
 
227
227
  this.agent.emit('transactionFinished', this)
228
+
229
+ // Do after emit so all post-processing can complete
230
+ this._cleanUneededReferences()
231
+
228
232
  return this
229
233
  }
230
234
 
235
+ /**
236
+ * Cleans up references that will not be used later for processing such as
237
+ * transaction traces.
238
+ *
239
+ * Errors won't be needed for later processing but can contain extra details we
240
+ * don't want to hold in memory. Particularly, axios errors can result in indirect
241
+ * references to promises which will prevent them from being destroyed and result
242
+ * in a memory leak. This is due to the TraceSegment not getting removed from the
243
+ * async-hooks segmentMap because 'destroy' never fires.
244
+ */
245
+ Transaction.prototype._cleanUneededReferences = function _cleanUneededReferences() {
246
+ this.userErrors = null
247
+ this.exceptions = null
248
+ }
249
+
231
250
  /**
232
251
  * For web transactions, this represents the time from when the request was received
233
252
  * to when response was sent. For background transactions, it is equal to duration
@@ -768,6 +787,11 @@ function _linkExceptionToSegment(exception) {
768
787
  Transaction.prototype.addException = _addException
769
788
 
770
789
  function _addException(exception) {
790
+ if (!this.isActive()) {
791
+ logger.trace('Transaction is not active. Not capturing error: ', exception)
792
+ return
793
+ }
794
+
771
795
  this._linkExceptionToSegment(exception)
772
796
  this.exceptions.push(exception)
773
797
  }
@@ -782,6 +806,11 @@ function _addException(exception) {
782
806
  Transaction.prototype.addUserError = _addUserError
783
807
 
784
808
  function _addUserError(exception) {
809
+ if (!this.isActive()) {
810
+ logger.trace('Transaction is not active. Not capturing user error: ', exception)
811
+ return
812
+ }
813
+
785
814
  this._linkExceptionToSegment(exception)
786
815
  this.userErrors.push(exception)
787
816
  }
package/newrelic.js CHANGED
@@ -28,7 +28,7 @@ exports.config = {
28
28
  *
29
29
  * @env NEW_RELIC_DISTRIBUTED_TRACING_ENABLED
30
30
  */
31
- enabled: false
31
+ enabled: true
32
32
  },
33
33
  logging: {
34
34
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newrelic",
3
- "version": "7.1.3",
3
+ "version": "7.3.1",
4
4
  "author": "New Relic Node.js agent team <nodejs@newrelic.com>",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [
@@ -125,7 +125,7 @@
125
125
  "docs": "npm ci && jsdoc -c ./jsdoc-conf.json --private -r .",
126
126
  "integration": "npm run prepare-test && npm run sub-install && time tap --no-esm test/integration/**/**/*.tap.js --timeout=180 --no-coverage",
127
127
  "prepare-test": "npm ci && npm run ca-gen && npm run ssl && npm run docker-env",
128
- "lint": "eslint ./*.js lib test",
128
+ "lint": "eslint ./*.js lib test bin",
129
129
  "public-docs": "npm ci && jsdoc -c ./jsdoc-conf.json --tutorials examples/shim api.js lib/shim/ lib/transaction/handle.js && cp examples/shim/*.png out/",
130
130
  "publish-docs": "./bin/publish-docs.sh",
131
131
  "services": "./bin/docker-services.sh",
@@ -143,8 +143,8 @@
143
143
  "newrelic-naming-rules": "./bin/test-naming-rules.js"
144
144
  },
145
145
  "dependencies": {
146
- "@grpc/grpc-js": "^1.2.7",
147
- "@grpc/proto-loader": "^0.5.5",
146
+ "@grpc/grpc-js": "^1.2.11",
147
+ "@grpc/proto-loader": "^0.5.6",
148
148
  "@newrelic/aws-sdk": "^3.1.0",
149
149
  "@newrelic/koa": "^5.0.0",
150
150
  "@newrelic/superagent": "^4.0.0",
@@ -171,7 +171,7 @@
171
171
  "commander": "^7.0.0",
172
172
  "eslint": "^6.8.0",
173
173
  "express": "*",
174
- "fastify": "^2.14.1",
174
+ "fastify": "^2.15.3",
175
175
  "generic-pool": "^3.6.1",
176
176
  "glob": "^7.1.2",
177
177
  "got": "^8.0.1",
@@ -198,5 +198,18 @@
198
198
  "repository": {
199
199
  "type": "git",
200
200
  "url": "https://github.com/newrelic/node-newrelic.git"
201
- }
201
+ },
202
+ "files": [
203
+ "index.js",
204
+ "api.js",
205
+ "stub_api.js",
206
+ "newrelic.js",
207
+ "README.md",
208
+ "LICENSE",
209
+ "NEWS.md",
210
+ "THIRD_PARTY_NOTICES.md",
211
+ "lib/",
212
+ "bin/tracetractor",
213
+ "bin/test-naming-rules.js"
214
+ ]
202
215
  }
package/CONTRIBUTING.md DELETED
@@ -1,135 +0,0 @@
1
- # Guidelines for Contributing Code
2
-
3
- New Relic welcomes code contributions by the Node community to this module, and
4
- have taken effort to make this process easy for both contributors and our
5
- development team.
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](https://github.com/newrelic/.github/blob/main/CODE_OF_CONDUCT.md)
24
-
25
- Note that our [code of conduct](https://github.com/newrelic/.github/blob/main/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
- ## PR Guidelines
49
-
50
- ### Version Support
51
-
52
- When contributing, keep in mind that New Relic customers (that's you!) are running many different versions of Node, some of them pretty old. Changes that depend on the newest version of Node will probably be rejected, especially if they replace something backwards compatible.
53
-
54
- Be aware that the instrumentation needs to work with a wide range of versions of the instrumented modules, and that code that looks nonsensical or overcomplicated may be that way for compatibility-related reasons. Read all the comments and check the related tests before deciding whether existing code is incorrect.
55
-
56
- If you’re planning on contributing a new feature or an otherwise complex contribution, we kindly ask you to start a conversation with the maintainer team by opening up an Github issue first.
57
-
58
- ### General Guidelines
59
-
60
- In general, we try to limit adding third-party production dependencies. If one is necessary, please be prepared to make a clear case for the need.
61
-
62
- ### Coding Style Guidelines/Conventions
63
-
64
- We use eslint to enforce certain coding standards. Please see our [.eslintrc](./.eslintrc.js) file for specific rule configuration.
65
-
66
- ### Testing Guidelines
67
-
68
- The agent includes a suite of unit and functional tests which should be used to
69
- verify your changes don't break existing functionality.
70
-
71
- Unit tests are stored in `test/`. They're written in
72
- [node-tap](https://github.com/isaacs/node-tap), and have the extension `.test.js`.
73
-
74
- Generic functional tests are stored in `test/integration/`. They're written in
75
- [node-tap](https://github.com/isaacs/node-tap), and have the extension
76
- `.tap.js`.
77
-
78
- Functional tests against specific versions of instrumented modules are stored
79
- in `test/versioned/`. They are also written in `node-tap`.
80
-
81
- #### Setup
82
-
83
- To run the tests you need an openssl command-line binary, and some services:
84
-
85
- * Cassandra
86
- * Memcached
87
- * MongoDB
88
- * MySQL
89
- * Postgres
90
- * Redis
91
-
92
- If you have these all running locally on the standard ports, then you are good
93
- to go. However, the suggested path is to use [Docker](http://www.docker.com).
94
- If you use macOS or Windows, install [Docker Desktop]
95
- (https://www.docker.com/products/docker-desktop). Then, run `npm run services`
96
- to download and launch docker containers for each of the above services.
97
-
98
- If you have these services available on non-standard ports or elsewhere on your
99
- network, you can use the following environment variables to tell the tests
100
- where they are:
101
-
102
- * NR_NODE\_TEST_&lt;service&gt;\_HOST
103
- * NR_NODE\_TEST_&lt;service&gt;\_PORT
104
-
105
- The service token is the all-caps version of the service name listed above.
106
-
107
- #### Running Tests
108
-
109
- Running the test suite is simple. Just run:
110
-
111
- npm test
112
-
113
- This will install all the necessary modules (and do any required SSL
114
- certificate creation) and run the unit tests in standalone mode, followed by
115
- the functional tests if all of the unit tests pass.
116
-
117
- If you don't feel like dealing with the hassle of setting up the servers, just
118
- the unit tests can be run with:
119
-
120
- npm run unit
121
-
122
- #### Writing Tests
123
-
124
- For most contributions it is strongly recommended to add additional tests which
125
- exercise your changes. This helps us efficiently incorporate your changes into
126
- our mainline codebase and provides a safeguard that your change won't be broken
127
- by future development. Because of this, we require that all changes come with
128
- tests. You are welcome to submit pull requests with untested changes, but they
129
- won't be merged until you or the development team have an opportunity to write
130
- tests for them.
131
-
132
- There are some rare cases where code changes do not result in changed
133
- functionality (e.g. a performance optimization) and new tests are not required.
134
- In general, including tests with your pull request dramatically increases the
135
- chances it will be accepted.
@@ -1,271 +0,0 @@
1
-
2
- # Migration Guide
3
- This guide is intended to help with upgrading major versions of the Node Agent.
4
- This information can also be found on [our documentation website][upgrade-doc].
5
-
6
- ## Upgrading to Agent v5
7
-
8
- ### Breaking Changes
9
-
10
- **Removed deprecated API methods**: The following API methods had been marked as
11
- deprecated since agent v2, and have now been fully removed from the codebase:
12
-
13
- * `newrelic.addCustomParameter()`
14
-
15
- Replace with `newrelic.addCustomAttribute()`.
16
-
17
- * `newrelic.addCustomParameters()`
18
-
19
- Replace with `newrelic.addCustomAttributes()`.
20
-
21
- * `newrelic.createWebTransaction()`
22
-
23
- Replace with `newrelic.startWebTransaction()` and `newrelic.getTransaction()`.
24
-
25
- * `newrelic.createBackgroundTransaction()`
26
-
27
- Replace with `newrelic.startBackgroundTransaction()` and `newrelic.getTransaction()`.
28
-
29
- * `newrelic.createTracer()`
30
-
31
- Replace with `newrelic.startSegment()`.
32
-
33
- **Removed `ignore_server_configuration` setting**: This setting was only implemented
34
- by the Node agent, so removing it improves parity with other language agents.
35
-
36
- **Removed `node-cassandra-cql` instrumentation**: This [library][node-cassandra-cql]
37
- has not been updated in 5 years, and has since been superseded by
38
- [cassandra-driver](https://www.npmjs.com/package/cassandra-driver), which is
39
- supported by the agent.
40
-
41
- **Removed deprecated configuration settings**: The following configuration
42
- settings have been deprecated since agent v3, and have now been removed from the
43
- codebase:
44
-
45
- * `capture_params`
46
-
47
- Replaced with `attributes.enabled`. By default, request attributes are not
48
- sent to New Relic. Set `attributes.enabled: true` to include agent-defined or
49
- custom attributes in traces.
50
-
51
- * `ignored_params`
52
-
53
- Replaced with `attributes.exclude`. Add any request attribute keys to the
54
- `attributes.exclude` list. Now, instead of having to be an exact match,
55
- wildcards (`*`) may be appended to each item for broader filtering.
56
-
57
- **Updated custom metric naming**: Custom metrics are now prefixed with `Custom/`.
58
- Existing insights queries may need to be addressed moving forward.
59
-
60
- ### Node Version Support
61
-
62
- The agent now only supports Node version 6 and above, which brings it up to date
63
- with Node's [LTS][node-lts-schedule] schedule. Customers running Node 4.x or 5.x
64
- will need to upgrade to a supported version of Node or remain on the v4 agent.
65
-
66
- ### Released Feature Flags
67
- * `custom_instrumentation`: This feature is no longer configurable.
68
- * `custom_metrics`: This feature is no longer configurable.
69
- * `synthetics`: This feature is no longer configurable.
70
- * `native_metrics`: This feature is now controlled by the
71
- `plugins.native_metrics.enabled` configuration value.
72
-
73
- --------------------------------------------------------------------------------
74
-
75
- ## Upgrading to Agent v4
76
-
77
- ### Breaking Changes
78
-
79
- **Upgraded https-proxy-agent from v0 to v2**: This dependency has been updated
80
- due to a security issue in the version of `https-proxy-agent` the New Relic Node.js
81
- agent used. `https-proxy` v2 is incompatible with node v0.10 and v0.12,
82
- requiring deprecation of those versions for the agent. There is no required
83
- action to migrate from v3 to v4 of New Relic's Node.js agent.
84
-
85
- ### Node Version Support
86
- The earliest version of Node supported by the v4 agent is 4. Node 0.10 and 0.12,
87
- which have not been updated since February of 2017, are not supported by v4.
88
- Customers running Node 0.10 or 0.12 will need to upgrade to a supported version
89
- of Node or remain on the v3 agent.
90
-
91
- [Node 4 is also no longer receiving updates][node-lts-schedule], but we will
92
- continue to support this version of Node for the time being. We highly recommend
93
- moving to a newer version of Node as soon as possible. The next major version of
94
- the New Relic Node Agent will likely remove support for it.
95
-
96
- --------------------------------------------------------------------------------
97
-
98
- ## Upgrading to Agent v3
99
-
100
- ### Breaking Changes
101
-
102
- **Removed SSL configuration**: The agent will always connect to New Relic
103
- servers using TLS to encrypt communications. The `ssl` configuration value and
104
- `NEW_RELIC_USE_SSL` environment value are ignored. If set to any value other
105
- than `true`, a warning is logged and the value is ignored.
106
-
107
- **Request parameters now prefixed with `request.parameters.`**: Any request
108
- parameters, such as route (`/user/:userId`) or query (`/user?userId=123`)
109
- parameters will now be prefixed with `request.parameters.` when collected. For
110
- example, the route parameter from `/user/:userId` would be collected as
111
- `request.parameters.userId`.
112
-
113
- Any Insights dashboards, Alerts, or other NRQL queries using these attributes
114
- must be updated to look for the new attributes instead.
115
-
116
- ### Released Feature Flags
117
-
118
- * `send_request_uri_attribute`: This feature is no longer configurable.
119
-
120
- --------------------------------------------------------------------------------
121
-
122
- ## Upgrading to Agent v2
123
-
124
- ### Breaking Changes
125
-
126
- **Reversed naming and ignore rules**: Previously, rules defined in the config
127
- properties `rules.name` and `rules.ignore` were applied in reverse order, the
128
- first rule in the list was applied last. Agent v2 now applies rules in the
129
- order they are defined, so the first rule in the list is applied first.
130
-
131
- Users of naming rules in the v1 agent will need to reverse the order of their
132
- rules in the configuration if they're noticing any issues.
133
-
134
- **De-duplicated HTTP request transactions**: The v1 agent starts a new
135
- transaction for each _listener_ on an HTTP server's `request` event. In
136
- applications with multiple listeners on the `request` event this would result
137
- in extraneous transactions being created that almost always did not get named
138
- correctly. In v2 the agent only creates a single transaction for each `request`
139
- event emitted.
140
-
141
- Any users who utilized multiple `request` event listeners and added a call to
142
- `newrelic.ignoreTransaction()` to remove the extra transactions should remove
143
- those calls.
144
-
145
- **Stopped swallowing outbound request errors**: In v1 the Node Agent swallows
146
- unhandled `error` events emitted by outbound HTTP request objects. Agent v2
147
- removed this behavior in favor of not changing normal Node execution, meaning
148
- the `error` event will always be emitted.
149
-
150
- If you are making outbound requests and currently do not listen for the `error`
151
- event, add a listener and handle the error as appropriate for your application.
152
-
153
- ### Updated configuration options
154
-
155
- In `newrelic.js`, edit the configuration properties you use for compatibility
156
- with the latest versions:
157
-
158
- * `capture_params`
159
-
160
- Replaced with `attributes.enabled`. By default, request attributes are not
161
- sent to New Relic. Set `attributes.enabled`: true to include agent-defined or
162
- custom attributes in traces.
163
-
164
- * `ignored_params`
165
-
166
- Replaced with `attributes.exclude`. Add any request attribute keys to the
167
- `attributes.exclude` list. Now, instead of having to be an exact match,
168
- wildcards (`*`) may be appended to each item for broader filtering.
169
-
170
- **NOTE**: The new properties also have overrides for specific destinations
171
- (`transaction_tracer`, `transaction_events`, `error_collector`, and
172
- `browser_monitoring`). For example, setting
173
- `transaction_tracer.attributes.enabled: false`, would restrict attributes from
174
- being collected in transaction traces, while still allowing them for all others,
175
- assuming the root `attributes.enabled` is `true`. Please see
176
- [Node.js agent configuration](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration)
177
- for more details.
178
-
179
- ### Deprecated API Methods
180
- These methods have been marked as deprecated in Agent v2 and will be removed in
181
- v3.
182
-
183
- * `newrelic.createWebTransaction()`
184
-
185
- Replace with `newrelic.startWebTransaction()` and `newrelic.getTransaction()`.
186
-
187
- * `newrelic.createBackgroundTransaction()`
188
-
189
- Replace with `newrelic.startBackgroundTransaction()` and `newrelic.getTransaction()`.
190
-
191
- * `newrelic.addCustomParameter()`
192
-
193
- Replace with `newrelic.addCustomAttribute()`.
194
-
195
- * `newrelic.addCustomParameters()`
196
-
197
- Replace with `newrelic.addCustomAttributes()`.
198
-
199
- ### New API Methods
200
-
201
- * [`newrelic.getTransaction()`](https://newrelic.github.io/node-newrelic/docs/API.html#getTransaction)
202
-
203
- This method gets a reference to the currently running transaction. It should
204
- be used in conjunction with `newrelic.startWebTransaction`,
205
- `newrelic.startBackgroundTransaction`, or with callback-based message
206
- consumer services. See our [Trouble Shooting][messaging-troubleshooting-doc]
207
- documentation for more information on its usage.
208
-
209
- * [`newrelic.startWebTransaction()`](https://newrelic.github.io/node-newrelic/docs/API.html#startWebTransaction)
210
- [`newrelic.startBackgroundTransaction()`](https://newrelic.github.io/node-newrelic/docs/API.html#startBackgroundTransaction)
211
-
212
- These new API methods replace the older `create*Transaction` methods. They
213
- are easier to use and seamlessly work with promises. Note that unlike the old
214
- method, the provided callback is invoked immediately.
215
-
216
- * [`newrelic.instrument()`](https://newrelic.github.io/node-newrelic/docs/API.html#instrument)
217
- [`newrelic.instrumentDatastore()`](https://newrelic.github.io/node-newrelic/docs/API.html#instrumentDatastore)
218
- [`newrelic.instrumentWebframework()`](https://newrelic.github.io/node-newrelic/docs/API.html#instrumentWebframework)
219
- [`newrelic.instrumentMessages()`](https://newrelic.github.io/node-newrelic/docs/API.html#instrumentMessages)
220
-
221
- These methods can be used to add custom instrumentation for 3rd party modules,
222
- including those already instrumented by the Node Agent. See our
223
- [instrumentation tutorials][instrumentation-tutorial] for more information
224
- on using these methods.
225
-
226
- * `newrelic.addCustomAttribute()`
227
-
228
- Use this method to add a custom trace attribute.
229
-
230
- * `newrelic.addCustomAttributes()`
231
-
232
- Use this method to add multiple custom trace attributes.
233
-
234
- ### Node Version Support
235
- The earliest version of Node supported by the v2 agent is 0.10. Node 0.8, which
236
- has not been updated since July of 2014, is not supported by v2. Customers
237
- running Node 0.8 will need to upgrade to a supported version of Node or remain
238
- on the v1 agent. [Node 0.10 is also no longer receiving updates][node-lts-schedule],
239
- but we will continue to support this version of Node for the time being. We
240
- highly recommend moving to a newer version of Node as soon as possible. The
241
- next major version of the New Relic Node Agent will likely remove support for
242
- it.
243
-
244
- ### npm Version Support
245
- The agent now requires npm version 2.0.0 or higher. This version of npm comes
246
- packaged with Node 0.10.44 or higher. If you are using an earlier version of
247
- Node 0.10 you will need to first install npm 2.0.0 or higher or upgrade to a
248
- newer version of Node. Version 2 of npm can be installed with:
249
-
250
- ```sh
251
- $ npm install --global npm@2
252
- ```
253
-
254
- ### Released Feature Flags
255
- * `express_segments`: This feature is no longer configurable.
256
- * `cat`: This feature is now controlled by the `cross_application_tracer.enabled`
257
- configuration value.
258
-
259
- ### New Framework Minimum Versions
260
-
261
- | Module | Old Minimum | New Minimum |
262
- |---------|-------------|-------------|
263
- | express | 2.0.0 | 4.6.0 |
264
- | mysql | 0.9.0 | 2.0.0 |
265
-
266
-
267
- [upgrade-doc]: https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/upgrade-node-agent-versions
268
- [messaging-troubleshooting-doc]: https://docs.newrelic.com/docs/agents/nodejs-agent/troubleshooting/troubleshoot-message-consumers
269
- [instrumentation-tutorial]: https://newrelic.github.io/node-newrelic/docs/tutorial-Instrumentation-Basics.html
270
- [node-lts-schedule]: https://github.com/nodejs/LTS/tree/2b4253#lts-schedule1
271
- [node-cassandra-cql]: https://www.npmjs.com/package/node-cassandra-cql
package/ROADMAP_Node.md DELETED
@@ -1,24 +0,0 @@
1
- # Node Agent Roadmap
2
-
3
- ## Product Vision
4
- The goal of the Node agent is to provide complete visibility into the health of your service. The agent provides metrics about the runtime health of your service and the process it runs in, and traces that show how specific requests are performing. It also provides information about the environment in which it is running, so you can identify issues with specific hosts, regions, deployments, and other facets.
5
-
6
- New Relic is moving toward OpenTelemetry. OpenTelemetry is a unified standard for service instrumentation. You will soon see an updated version of the agent that uses the OpenTelemetry SDK and [auto-]instrumentation as its foundation. OpenTelemetry will include a broad set of high-quality community-contributed instrumentation and a powerful vendor-neutral API for adding your own instrumentation.
7
-
8
-
9
- ## Roadmap
10
- ### Description
11
- This roadmap project is broken down into the following sections:
12
-
13
- - **Now**:
14
- - This section contains features that are currently in progress.
15
- - **Next**:
16
- - This section contains work planned within the next three months. These features may still be deprioritized and moved to Future.
17
- - **Future**:
18
- - This section is for ideas for future work that is aligned with the product vision and possible opportunities for community contribution. It contains a list of features that anyone can implement. No guarantees can be provided on if or when these features will be completed.
19
-
20
-
21
- **The roadmap project is found [here](https://github.com/orgs/newrelic/projects/11)**
22
-
23
- #### Disclaimers
24
- > This roadmap is subject to change at any time. Future items should not be considered commitments.
package/SECURITY.md DELETED
@@ -1,5 +0,0 @@
1
- # Reporting Security Vulnerabilities
2
-
3
- New Relic is committed to the security of our customers and your data. We believe that engaging with security researchers through our coordinated disclosure program is an important means to achieve our security goals.
4
-
5
- If you believe you have found a security vulnerability in one of our products or websites, we welcome and greatly appreciate you reporting it to New Relic's coordinated disclosure program. Please see our [website for more information on how to report a vulnerability](https://docs.newrelic.com/docs/security/new-relic-security/data-privacy/reporting-security-vulnerabilities).