newrelic 13.6.3 → 13.6.4

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,11 @@
1
+ ### v13.6.4 (2025-11-13)
2
+
3
+ #### Bug fixes
4
+
5
+ * Updated `MessageConsumerSubscriber` to end transaction created for a given message consumption ([#3503](https://github.com/newrelic/node-newrelic/pull/3503)) ([ba30818](https://github.com/newrelic/node-newrelic/commit/ba308184e5cb4f916aec53963cce0caa9149efbe))
6
+ * Updated `MessageProducerSubscriber` to properly set the sampled flag on `traceparent` ([#3505](https://github.com/newrelic/node-newrelic/pull/3505)) ([0b1a9a8](https://github.com/newrelic/node-newrelic/commit/0b1a9a80b81e0f4388d421f17176eab386d04cbc))
7
+ * Updated the bedrock middleware to be registered with a `high` priority to ensure payload is properly deserialized ([#3500](https://github.com/newrelic/node-newrelic/pull/3500)) ([63e531b](https://github.com/newrelic/node-newrelic/commit/63e531bf50d600d92556b3785725dd38145f3491))
8
+
1
9
  ### v13.6.3 (2025-11-11)
2
10
 
3
11
  #### Bug fixes
@@ -392,6 +392,11 @@ module.exports.bedrockMiddlewareConfig = {
392
392
  config: {
393
393
  name: 'NewRelicBedrockMiddleware',
394
394
  step: 'deserialize',
395
+ // force high priority to ensure we wrap before any other
396
+ // middleware and then our `after` hook will be the result of
397
+ // any other middleware registered on the deserialize step
398
+ // See: https://github.com/aws/aws-sdk-js-v3/issues/7490
399
+ priority: 'high',
395
400
  override: true
396
401
  }
397
402
  }
@@ -363,7 +363,7 @@ class Subscriber {
363
363
  if (distributedTracingEnabled) {
364
364
  // we have to pass in traceId, segment id, and hard code traceFlags to 1
365
365
  // because we're inserting headers right before the original function is bound.
366
- const traceFlags = tx.sampled === true ? 1 : 0
366
+ const traceFlags = tx.isSampled() === true ? 1 : 0
367
367
  tx.insertDistributedTraceHeaders(headers, null, { traceId: tx.traceId, spanId: ctx?.segment?.id, traceFlags })
368
368
  } else {
369
369
  cat.addCatHeaders(this.config, tx, headers, useMqNames)
@@ -65,6 +65,14 @@ class MessageConsumerSubscriber extends Subscriber {
65
65
  }
66
66
  }
67
67
 
68
+ /**
69
+ * Ends the transaction created for the consumption callback.
70
+ */
71
+ asyncEnd() {
72
+ const ctx = this.agent.tracer.getContext()
73
+ ctx?.transaction?.end()
74
+ }
75
+
68
76
  enable() {
69
77
  super.enable()
70
78
  this.channel.asyncStart.bindStore(this.store, (data) => {
@@ -83,9 +91,8 @@ class MessageConsumerSubscriber extends Subscriber {
83
91
  /**
84
92
  * Used to create a transaction for every consumption callback.
85
93
  *
86
- * @param {object} data event passed to asyncStart handler
87
94
  */
88
- asyncStart(data) {
95
+ asyncStart() {
89
96
  const ctx = this.agent.tracer.getContext()
90
97
  const tx = ctx?.transaction
91
98
  tx.setPartialName(this.name)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newrelic",
3
- "version": "13.6.3",
3
+ "version": "13.6.4",
4
4
  "author": "New Relic Node.js agent team <nodejs@newrelic.com>",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [