newrelic 12.16.0 → 12.16.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.
package/NEWS.md CHANGED
@@ -1,3 +1,21 @@
1
+ ### v12.16.1 (2025-03-24)
2
+
3
+ #### Features
4
+
5
+ * Assign all attributes on internal spans to segment ([#3000](https://github.com/newrelic/node-newrelic/pull/3000)) ([5403018](https://github.com/newrelic/node-newrelic/commit/54030185ba5630099b76182a52c629276af4d93e))
6
+
7
+ #### Bug fixes
8
+
9
+ * Fixed `tracer.transactionNestProxy` to create a new transaction if there is no transaction or transaction is not active ([#3007](https://github.com/newrelic/node-newrelic/pull/3007)) ([ced9e22](https://github.com/newrelic/node-newrelic/commit/ced9e22a23ddeed860c1fd88f0afb10bb94343cb))
10
+
11
+ #### Documentation
12
+
13
+ * Updated compatibility report ([#2993](https://github.com/newrelic/node-newrelic/pull/2993)) ([cdfa042](https://github.com/newrelic/node-newrelic/commit/cdfa042325a7636e84a7b19a34874b20915dac63))
14
+
15
+ #### Tests
16
+
17
+ * Fixed handling require esm for >20.19.0+ ([#3002](https://github.com/newrelic/node-newrelic/pull/3002)) ([b808e00](https://github.com/newrelic/node-newrelic/commit/b808e00c399d3c924eeeb19f9c6b9fba4695a720))
18
+
1
19
  ### v12.16.0 (2025-03-17)
2
20
 
3
21
  #### Features
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  'use strict'
7
- const customRecorder = require('../../metrics/recorders/custom')
7
+ const genericRecorder = require('../../metrics/recorders/generic')
8
8
 
9
9
  module.exports = function createInternalSegment(agent, otelSpan) {
10
10
  const context = agent.tracer.getContext()
@@ -13,7 +13,7 @@ module.exports = function createInternalSegment(agent, otelSpan) {
13
13
  id: otelSpan?.spanContext()?.spanId,
14
14
  name,
15
15
  parent: context.segment,
16
- recorder: customRecorder,
16
+ recorder: genericRecorder,
17
17
  transaction: context.transaction
18
18
  })
19
19
  return { segment, transaction: context.transaction }
@@ -113,6 +113,8 @@ module.exports = class NrSpanProcessor {
113
113
  this.reconcileProducerAttributes({ segment, span })
114
114
  } else if (span.kind === SpanKind.CLIENT && (span.attributes[ATTR_HTTP_METHOD] || span.attributes[ATTR_HTTP_REQUEST_METHOD])) {
115
115
  this.reconcileHttpExternalAttributes({ segment, span })
116
+ } else {
117
+ this.#reconciler.reconcile({ segment, otelSpan: span })
116
118
  }
117
119
 
118
120
  this.addAWSLinkingAttributes({ segment, span })
@@ -222,10 +222,11 @@ function transactionNestProxy(type, handler) {
222
222
 
223
223
  // don't nest transactions, reuse existing ones
224
224
  let context = tracer.getContext()
225
+ const transaction = tracer.getTransaction()
225
226
 
226
227
  let createNew = false
227
228
 
228
- if (!context?.transaction || context?.transaction.type !== type) {
229
+ if (!transaction || transaction.type !== type) {
229
230
  createNew = true
230
231
  }
231
232
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newrelic",
3
- "version": "12.16.0",
3
+ "version": "12.16.1",
4
4
  "author": "New Relic Node.js agent team <nodejs@newrelic.com>",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [