newrelic 10.4.1 → 10.5.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.
package/NEWS.md CHANGED
@@ -1,30 +1,58 @@
1
- ### v10.4.1 (2023-07-10)
1
+ ### v10.5.0 (2023-07-20)
2
2
 
3
- #### Security Improvements
3
+ #### Features
4
4
 
5
- * **deps:** bump protobufjs from 7.2.3 to 7.2.4 ([#1713](https://github.com/newrelic/node-newrelic/pull/1713)) ([5fb4606](https://github.com/newrelic/node-newrelic/commit/5fb4606f04f1317bbb5fa1807d149233bb0b84fd))
5
+ * enabled code_level_metrics by default ([#1723](https://github.com/newrelic/node-newrelic/pull/1723)) ([0b96de3](https://github.com/newrelic/node-newrelic/commit/0b96de3fbf8db7be7d3673e29bab706d1d67de42))
6
6
 
7
- #### Miscellaneous Chores
8
-
9
- * **test:** Converted adaptive-sampler.test.js to tap ([#1709](https://github.com/newrelic/node-newrelic/pull/1709)) ([bb42249](https://github.com/newrelic/node-newrelic/commit/bb4224926dd0576d57dd233596c12088de099183))
10
- * **test:** converted environment.test.js to tap ([#1705](https://github.com/newrelic/node-newrelic/pull/1705)) ([53b4376](https://github.com/newrelic/node-newrelic/commit/53b4376863f88b9aaa5e778dcce71cba2fe0ee20))
11
- * **test:** Replaced t.equals with t.equal ([#1711](https://github.com/newrelic/node-newrelic/pull/1711)) ([a0b255e](https://github.com/newrelic/node-newrelic/commit/a0b255e74ded6c9342a5411446a635b38df9f805))
7
+ #### Bug Fixes
12
8
 
13
- ### v10.4.0 (2023-06-30)
9
+ * prevent ESM loader from loading instrumentation multiple times ([#1729](https://github.com/newrelic/node-newrelic/pull/1729)) ([962d172](https://github.com/newrelic/node-newrelic/commit/962d172aa5a9496041fe40e73ab8d183db94bae7))
14
10
 
15
11
  #### Miscellaneous Chores
16
12
 
17
- * **test:** Converted 'errors/expected.test.js' to tap-style ([#1695](https://github.com/newrelic/node-newrelic/pull/1695)) ([86025de](https://github.com/newrelic/node-newrelic/commit/86025de673b2380561b29ff6a384babb85df7521))
18
- * **test:** Converted server-config.test.js to tap-style ([#1702](https://github.com/newrelic/node-newrelic/pull/1702)) ([2c6906d](https://github.com/newrelic/node-newrelic/commit/2c6906de3b21068424acb42229d4ad5fdf6c547c))
19
-
20
- #### Continuous Integration
21
-
22
- * skip running test suite when merging releases ([#1704](https://github.com/newrelic/node-newrelic/pull/1704)) ([f78b981](https://github.com/newrelic/node-newrelic/commit/f78b98146839b8ff594a066764284ac83b9fdfde))
23
-
24
- #### Build System
25
-
26
- * updated `@newrelic/aws-sdk` to latest to get the instrumentation fixes for 3.363.0 ([#1707](https://github.com/newrelic/node-newrelic/pull/1707)) ([a2cca08](https://github.com/newrelic/node-newrelic/commit/a2cca08bdbdf509701e1d7f056b479e6947ce344))
13
+ * **deps-dev:** bump word-wrap from 1.2.3 to 1.2.4 ([#1730](https://github.com/newrelic/node-newrelic/pull/1730)) ([500a69e](https://github.com/newrelic/node-newrelic/commit/500a69e6c9e94e4073805630e6d380f349d91689))
27
14
 
15
+ ### v10.4.2 (2023-07-13)
16
+
17
+ #### Bug Fixes
18
+
19
+ * Dropped query params from `request.uri` attribute when obfuscating ([#1719](https://github.com/newrelic/node-newrelic/pull/1719)) ([76112a6](https://github.com/newrelic/node-newrelic/commit/76112a6143e503b21096d569cb81c82d83be4dfa))
20
+
21
+ #### Miscellaneous Chores
22
+
23
+ * Created story issue template ([#1694](https://github.com/newrelic/node-newrelic/pull/1694)) ([20442c6](https://github.com/newrelic/node-newrelic/commit/20442c6f65c4894aca9e0d9d9da9ade045aca90d))
24
+
25
+ #### Tests
26
+
27
+ * Pinned prisma to < 5 when running on node 14 ([#1717](https://github.com/newrelic/node-newrelic/pull/1717)) ([b000d7b](https://github.com/newrelic/node-newrelic/commit/b000d7b5915b5f6ca571d627ee31e6082ae66ed2))
28
+
29
+ ### v10.4.1 (2023-07-10)
30
+
31
+ #### Security Improvements
32
+
33
+ * **deps:** bump protobufjs from 7.2.3 to 7.2.4 ([#1713](https://github.com/newrelic/node-newrelic/pull/1713)) ([5fb4606](https://github.com/newrelic/node-newrelic/commit/5fb4606f04f1317bbb5fa1807d149233bb0b84fd))
34
+
35
+ #### Miscellaneous Chores
36
+
37
+ * **test:** Converted adaptive-sampler.test.js to tap ([#1709](https://github.com/newrelic/node-newrelic/pull/1709)) ([bb42249](https://github.com/newrelic/node-newrelic/commit/bb4224926dd0576d57dd233596c12088de099183))
38
+ * **test:** converted environment.test.js to tap ([#1705](https://github.com/newrelic/node-newrelic/pull/1705)) ([53b4376](https://github.com/newrelic/node-newrelic/commit/53b4376863f88b9aaa5e778dcce71cba2fe0ee20))
39
+ * **test:** Replaced t.equals with t.equal ([#1711](https://github.com/newrelic/node-newrelic/pull/1711)) ([a0b255e](https://github.com/newrelic/node-newrelic/commit/a0b255e74ded6c9342a5411446a635b38df9f805))
40
+
41
+ ### v10.4.0 (2023-06-30)
42
+
43
+ #### Miscellaneous Chores
44
+
45
+ * **test:** Converted 'errors/expected.test.js' to tap-style ([#1695](https://github.com/newrelic/node-newrelic/pull/1695)) ([86025de](https://github.com/newrelic/node-newrelic/commit/86025de673b2380561b29ff6a384babb85df7521))
46
+ * **test:** Converted server-config.test.js to tap-style ([#1702](https://github.com/newrelic/node-newrelic/pull/1702)) ([2c6906d](https://github.com/newrelic/node-newrelic/commit/2c6906de3b21068424acb42229d4ad5fdf6c547c))
47
+
48
+ #### Continuous Integration
49
+
50
+ * skip running test suite when merging releases ([#1704](https://github.com/newrelic/node-newrelic/pull/1704)) ([f78b981](https://github.com/newrelic/node-newrelic/commit/f78b98146839b8ff594a066764284ac83b9fdfde))
51
+
52
+ #### Build System
53
+
54
+ * updated `@newrelic/aws-sdk` to latest to get the instrumentation fixes for 3.363.0 ([#1707](https://github.com/newrelic/node-newrelic/pull/1707)) ([a2cca08](https://github.com/newrelic/node-newrelic/commit/a2cca08bdbdf509701e1d7f056b479e6947ce344))
55
+
28
56
  ### v10.3.2 (2023-06-26)
29
57
 
30
58
  #### Bug Fixes
package/esm-loader.mjs CHANGED
@@ -66,9 +66,16 @@ export async function resolve(specifier, context, nextResolve) {
66
66
  const { url, format } = resolvedModule
67
67
  logger.debug(`Instrumentation exists for ${specifier} ${format} package.`)
68
68
 
69
- if (format === 'commonjs') {
69
+ if (registeredSpecifiers.get(url)) {
70
+ logger.debug(
71
+ `Instrumentation already registered for ${specifier} under ${fileURLToPath(
72
+ url
73
+ )}, skipping resolve hook...`
74
+ )
75
+ } else if (format === 'commonjs') {
70
76
  // ES Modules translate import statements into fully qualified filepaths, so we create a copy of our instrumentation under this filepath
71
77
  const instrumentationDefinitionCopy = [...instrumentationDefinition]
78
+
72
79
  instrumentationDefinitionCopy.forEach((copy) => {
73
80
  // Stripping the prefix is necessary because the code downstream gets this url without it
74
81
  copy.moduleName = fileURLToPath(url)
@@ -80,6 +87,9 @@ export async function resolve(specifier, context, nextResolve) {
80
87
  `Registered CommonJS instrumentation for ${specifier} under ${copy.moduleName}`
81
88
  )
82
89
  })
90
+
91
+ // Keep track of what we've registered so we don't double register (see: https://github.com/newrelic/node-newrelic/issues/1646)
92
+ registeredSpecifiers.set(url, specifier)
83
93
  } else if (format === 'module') {
84
94
  registeredSpecifiers.set(url, specifier)
85
95
  const modifiedUrl = new URL(url)
@@ -1221,7 +1221,7 @@ defaultConfig.definition = () => ({
1221
1221
  code_level_metrics: {
1222
1222
  enabled: {
1223
1223
  formatter: boolean,
1224
- default: false
1224
+ default: true
1225
1225
  }
1226
1226
  },
1227
1227
 
@@ -86,7 +86,7 @@ function wrapEmitWithTransaction(agent, emit, isHTTPS) {
86
86
 
87
87
  // the error tracer needs a URL for tracing, even though naming overwrites
88
88
  transaction.parsedUrl = url.parse(request.url, true)
89
- transaction.url = urltils.obfuscatePath(agent.config, transaction.parsedUrl.path)
89
+ transaction.url = urltils.obfuscatePath(agent.config, transaction.parsedUrl.pathname)
90
90
  transaction.verb = request.method
91
91
 
92
92
  // URL is sent as an agent attribute with transaction events
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newrelic",
3
- "version": "10.4.1",
3
+ "version": "10.5.0",
4
4
  "author": "New Relic Node.js agent team <nodejs@newrelic.com>",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [