newrelic 4.8.1 → 4.9.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.
@@ -755,11 +755,16 @@ function acceptDistributedTracePayload(payload, transport) {
755
755
 
756
756
  const config = this.agent.config
757
757
  const distTraceEnabled = config.distributed_tracing.enabled
758
- const catEnabled = config.cross_application_tracer.enabled
759
758
  const trustedAccount = config.trusted_account_key || config.account_id
760
759
 
761
- if (!distTraceEnabled || !catEnabled || !trustedAccount) {
762
- logger.warn('Invalid configuration for distributed trace payload, not accepting')
760
+ if (!distTraceEnabled || !trustedAccount) {
761
+ logger.debug(
762
+ 'Invalid configuration for distributed trace payload, not accepting ' +
763
+ '(distributed_tracing.enabled: %s, trustKey: %s',
764
+ distTraceEnabled,
765
+ trustedAccount
766
+ )
767
+
763
768
  this.agent.recordSupportability('DistributedTrace/AcceptPayload/Exception')
764
769
  return
765
770
  }
@@ -898,15 +903,20 @@ Transaction.prototype.createDistributedTracePayload = createDistributedTracePayl
898
903
  function createDistributedTracePayload() {
899
904
  const config = this.agent.config
900
905
  const accountId = config.account_id
901
- const appId = config.application_id
906
+ const appId = config.primary_application_id
902
907
  const distTraceEnabled = config.distributed_tracing.enabled
903
- const catEnabled = config.cross_application_tracer.enabled
904
908
 
905
- if (!accountId || !appId || !distTraceEnabled || !catEnabled) {
906
- logger.warn(
907
- 'Invalid configuration for distributed trace payload in transaction %s',
909
+ if (!accountId || !appId || !distTraceEnabled) {
910
+ logger.debug(
911
+ 'Invalid configuration for distributed trace payload ' +
912
+ '(distributed_tracing.enabled: %s, account_id: %s, application_id: %s) ' +
913
+ 'in transaction %s',
914
+ distTraceEnabled,
915
+ accountId,
916
+ appId,
908
917
  this.id
909
918
  )
919
+
910
920
  return new DTPayloadStub()
911
921
  }
912
922
 
@@ -126,12 +126,12 @@ TraceAggregator.prototype.isBetter = function isBetter(name, duration, apdexT) {
126
126
  var isOverThreshold
127
127
 
128
128
  if (config &&
129
- config.transaction_threshold &&
129
+ config.transaction_threshold != null &&
130
130
  config.transaction_threshold !== 'apdex_f' &&
131
131
  typeof config.transaction_threshold === 'number') {
132
- isOverThreshold = duration > config.transaction_threshold * TO_MILLIS
132
+ isOverThreshold = duration >= config.transaction_threshold * TO_MILLIS
133
133
  } else {
134
- isOverThreshold = duration > 4 * TO_MILLIS * apdexT
134
+ isOverThreshold = duration >= 4 * TO_MILLIS * apdexT
135
135
  }
136
136
  if (!isOverThreshold) return false
137
137
 
package/lib/util/codec.js CHANGED
@@ -45,11 +45,14 @@ module.exports = {
45
45
  zlib.inflate(new Buffer(encoded, 'base64'), function cb_inflate(err, raw) {
46
46
  if (err) return callback(err)
47
47
 
48
+ let json
48
49
  try {
49
- return callback(null, JSON.parse(raw))
50
+ json = JSON.parse(raw)
50
51
  } catch (error) {
51
52
  return callback(error)
52
53
  }
54
+
55
+ return callback(null, json)
53
56
  })
54
57
  }
55
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newrelic",
3
- "version": "4.8.1",
3
+ "version": "4.9.0",
4
4
  "author": "New Relic Node.js agent team <nodejs@newrelic.com>",
5
5
  "licenses": [
6
6
  {
@@ -118,6 +118,7 @@
118
118
  },
119
119
  "dependencies": {
120
120
  "@newrelic/koa": "^1.0.0",
121
+ "@newrelic/superagent": "^1.0.0",
121
122
  "@tyriar/fibonacci-heap": "^2.0.7",
122
123
  "async": "^2.1.4",
123
124
  "concat-stream": "^1.5.0",
@@ -138,7 +139,7 @@
138
139
  "chai": "^4.1.2",
139
140
  "connect": "*",
140
141
  "cover": "*",
141
- "ejs": "0.8.5",
142
+ "ejs": "2.5.5",
142
143
  "eslint": "^4.19.1",
143
144
  "express": "*",
144
145
  "generic-pool": "*",