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.
- package/NEWS.md +53 -0
- package/api.js +16 -10
- package/bin/travis-setup.sh +18 -7
- package/lib/config/env.js +2 -1
- package/lib/config/index.js +2 -0
- package/lib/db/tracer.js +3 -1
- package/lib/errors/index.js +1 -1
- package/lib/instrumentation/bluebird.js +35 -45
- package/lib/instrumentation/core/child_process.js +41 -38
- package/lib/instrumentation/core/domain.js +6 -5
- package/lib/instrumentation/core/net.js +62 -66
- package/lib/instrumentation/core/timers.js +78 -49
- package/lib/instrumentation/core/zlib.js +22 -8
- package/lib/instrumentations.js +3 -2
- package/lib/shim/constants.js +4 -0
- package/lib/shim/datastore-shim.js +1 -1
- package/lib/shim/index.js +8 -6
- package/lib/shim/promise-shim.js +563 -0
- package/lib/shim/shim.js +38 -11
- package/lib/shimmer.js +1 -0
- package/lib/transaction/index.js +18 -8
- package/lib/transaction/trace/aggregator.js +3 -3
- package/lib/util/codec.js +4 -1
- package/package.json +3 -2
package/lib/transaction/index.js
CHANGED
|
@@ -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 || !
|
|
762
|
-
logger.
|
|
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.
|
|
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
|
|
906
|
-
logger.
|
|
907
|
-
'Invalid configuration for distributed trace payload
|
|
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
|
|
132
|
+
isOverThreshold = duration >= config.transaction_threshold * TO_MILLIS
|
|
133
133
|
} else {
|
|
134
|
-
isOverThreshold = duration
|
|
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
|
-
|
|
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.
|
|
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": "
|
|
142
|
+
"ejs": "2.5.5",
|
|
142
143
|
"eslint": "^4.19.1",
|
|
143
144
|
"express": "*",
|
|
144
145
|
"generic-pool": "*",
|