newrelic 7.5.2 → 8.3.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 +4989 -4886
- package/THIRD_PARTY_NOTICES.md +625 -216
- package/api.js +105 -174
- package/bin/test-naming-rules.js +38 -32
- package/bin/tracetractor +0 -1
- package/index.js +12 -18
- package/lib/agent.js +108 -111
- package/lib/aggregators/base-aggregator.js +1 -1
- package/lib/aggregators/event-aggregator.js +6 -6
- package/lib/attributes.js +12 -13
- package/lib/collector/api.js +32 -42
- package/lib/collector/facts.js +67 -65
- package/lib/collector/http-agents.js +30 -27
- package/lib/collector/parse-response.js +1 -2
- package/lib/collector/remote-method.js +43 -36
- package/lib/collector/serverless.js +13 -18
- package/lib/collector/ssl/certificates.js +1056 -1056
- package/lib/config/attribute-filter.js +90 -82
- package/lib/config/default.js +30 -18
- package/lib/config/env.js +17 -12
- package/lib/config/harvest-config-validator.js +1 -1
- package/lib/config/index.js +160 -177
- package/lib/config/merge-server-config.js +7 -5
- package/lib/custom-events/custom-event-aggregator.js +1 -1
- package/lib/db/parse-sql.js +6 -9
- package/lib/db/parsed-statement.js +6 -13
- package/lib/db/query-parsers/sql.js +6 -9
- package/lib/db/query-sample.js +7 -3
- package/lib/db/query-trace-aggregator.js +12 -12
- package/lib/db/utils.js +1 -1
- package/lib/environment.js +173 -138
- package/lib/errors/error-collector.js +18 -31
- package/lib/errors/error-event-aggregator.js +1 -1
- package/lib/errors/error-trace-aggregator.js +2 -3
- package/lib/errors/helper.js +21 -30
- package/lib/errors/index.js +16 -28
- package/lib/feature_flags.js +5 -8
- package/lib/grpc/connection/states.js +6 -6
- package/lib/grpc/connection.js +35 -46
- package/lib/header-attributes.js +49 -53
- package/lib/instrumentation/amqplib.js +8 -17
- package/lib/instrumentation/bluebird.js +61 -20
- package/lib/instrumentation/cassandra-driver.js +2 -2
- package/lib/instrumentation/connect.js +4 -3
- package/lib/instrumentation/core/async_hooks.js +11 -4
- package/lib/instrumentation/core/child_process.js +20 -28
- package/lib/instrumentation/core/crypto.js +1 -7
- package/lib/instrumentation/core/dns.js +3 -7
- package/lib/instrumentation/core/domain.js +2 -8
- package/lib/instrumentation/core/fs.js +22 -37
- package/lib/instrumentation/core/globals.js +3 -7
- package/lib/instrumentation/core/http-outbound.js +15 -40
- package/lib/instrumentation/core/http.js +29 -63
- package/lib/instrumentation/core/inspector.js +6 -10
- package/lib/instrumentation/core/net.js +3 -1
- package/lib/instrumentation/core/timers.js +17 -24
- package/lib/instrumentation/core/zlib.js +2 -10
- package/lib/instrumentation/express.js +4 -2
- package/lib/instrumentation/fastify/spec-builders.js +5 -0
- package/lib/instrumentation/fastify.js +37 -10
- package/lib/instrumentation/hapi/hapi-17.js +9 -10
- package/lib/instrumentation/hapi.js +15 -15
- package/lib/instrumentation/ioredis.js +1 -2
- package/lib/instrumentation/memcached.js +39 -43
- package/lib/instrumentation/mongodb/common.js +218 -0
- package/lib/instrumentation/mongodb/constants.js +87 -0
- package/lib/instrumentation/mongodb/v2-mongo.js +110 -0
- package/lib/instrumentation/mongodb/v3-mongo.js +80 -0
- package/lib/instrumentation/mongodb/v4-mongo.js +90 -0
- package/lib/instrumentation/mongodb.js +20 -312
- package/lib/instrumentation/mysql.js +33 -26
- package/lib/instrumentation/oracle.js +10 -14
- package/lib/instrumentation/pg.js +30 -21
- package/lib/instrumentation/promise.js +20 -17
- package/lib/instrumentation/redis.js +30 -30
- package/lib/instrumentation/when.js +9 -1
- package/lib/instrumentations.js +24 -24
- package/lib/logger.js +1 -1
- package/lib/metrics/index.js +37 -17
- package/lib/metrics/mapper.js +9 -9
- package/lib/metrics/metric-aggregator.js +5 -10
- package/lib/metrics/names.js +8 -7
- package/lib/metrics/normalizer/rule.js +6 -7
- package/lib/metrics/normalizer/tx_segment.js +17 -13
- package/lib/metrics/normalizer.js +30 -33
- package/lib/metrics/recorders/custom.js +3 -1
- package/lib/metrics/recorders/distributed-trace.js +3 -18
- package/lib/metrics/recorders/generic.js +3 -2
- package/lib/metrics/recorders/http.js +4 -6
- package/lib/metrics/recorders/http_external.js +1 -3
- package/lib/metrics/recorders/message-transaction.js +2 -12
- package/lib/metrics/recorders/other.js +2 -12
- package/lib/parse-proc-cpuinfo.js +11 -16
- package/lib/parse-proc-meminfo.js +5 -3
- package/lib/prioritized-attributes.js +12 -17
- package/lib/priority-queue.js +1 -1
- package/lib/proxy/grpc.js +1 -1
- package/lib/reservoir.js +9 -3
- package/lib/sampler.js +12 -13
- package/lib/serverless/api-gateway.js +3 -3
- package/lib/serverless/aws-lambda.js +28 -37
- package/lib/shim/conglomerate-shim.js +4 -4
- package/lib/shim/datastore-shim.js +29 -38
- package/lib/shim/index.js +8 -9
- package/lib/shim/message-shim.js +111 -113
- package/lib/shim/promise-shim.js +18 -13
- package/lib/shim/shim.js +72 -66
- package/lib/shim/specs/index.js +18 -19
- package/lib/shim/transaction-shim.js +26 -36
- package/lib/shim/webframework-shim.js +25 -35
- package/lib/shimmer.js +184 -166
- package/lib/spans/create-span-event-aggregator.js +24 -44
- package/lib/spans/span-context.js +4 -10
- package/lib/spans/span-event-aggregator.js +68 -13
- package/lib/spans/span-event.js +5 -7
- package/lib/spans/span-streamer.js +10 -18
- package/lib/spans/streaming-span-event-aggregator.js +1 -1
- package/lib/spans/streaming-span-event.js +4 -4
- package/lib/stats/apdex.js +5 -11
- package/lib/stats/index.js +12 -17
- package/lib/system-info.js +7 -3
- package/lib/timer.js +30 -16
- package/lib/transaction/dt-payload.js +1 -1
- package/lib/transaction/handle.js +19 -19
- package/lib/transaction/index.js +94 -112
- package/lib/transaction/name-state.js +5 -6
- package/lib/transaction/trace/aggregator.js +78 -73
- package/lib/transaction/trace/exclusive-time-calculator.js +5 -9
- package/lib/transaction/trace/index.js +26 -24
- package/lib/transaction/trace/segment.js +39 -56
- package/lib/transaction/tracecontext.js +37 -45
- package/lib/transaction/tracer/index.js +79 -44
- package/lib/transaction/transaction-event-aggregator.js +29 -31
- package/lib/uninstrumented.js +4 -5
- package/lib/util/attribute-types.js +1 -5
- package/lib/util/byte-limit.js +0 -1
- package/lib/util/cat.js +5 -13
- package/lib/util/codec.js +8 -4
- package/lib/util/deep-equal.js +48 -18
- package/lib/util/flatten.js +5 -2
- package/lib/util/hashes.js +2 -2
- package/lib/util/label-parser.js +7 -13
- package/lib/util/logger.js +31 -13
- package/lib/util/process-version.js +1 -1
- package/lib/util/properties.js +1 -1
- package/lib/util/sql/obfuscate.js +7 -17
- package/lib/util/stream-sink.js +2 -3
- package/lib/util/urltils.js +9 -13
- package/lib/utilization/aws-info.js +2 -3
- package/lib/utilization/azure-info.js +32 -30
- package/lib/utilization/common.js +5 -4
- package/lib/utilization/docker-info.js +4 -6
- package/lib/utilization/gcp-info.js +36 -35
- package/lib/utilization/index.js +1 -1
- package/lib/utilization/kubernetes-info.js +2 -2
- package/lib/utilization/pcf-info.js +4 -4
- package/package.json +32 -18
- package/stub_api.js +8 -6
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
'use strict'
|
|
7
7
|
|
|
8
8
|
const CollectorResponse = require('./response')
|
|
9
|
-
const logger = require('../logger').child({component: 'serverless_collector'})
|
|
9
|
+
const logger = require('../logger').child({ component: 'serverless_collector' })
|
|
10
10
|
const zlib = require('zlib')
|
|
11
11
|
const fs = require('fs')
|
|
12
12
|
const stringify = require('json-stringify-safe')
|
|
@@ -17,6 +17,7 @@ const PAYLOAD_MARKER = 'NR_LAMBDA_MONITORING'
|
|
|
17
17
|
const path = require('path')
|
|
18
18
|
const defaultPipePath = path.resolve('/tmp', 'newrelic-telemetry')
|
|
19
19
|
|
|
20
|
+
/* eslint-disable camelcase */
|
|
20
21
|
class ServerlessCollector {
|
|
21
22
|
/**
|
|
22
23
|
* Constructs a new serverless collector instance with the give agent.
|
|
@@ -94,7 +95,7 @@ class ServerlessCollector {
|
|
|
94
95
|
this.payload.metric_data = payload
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
cb(null, {retainData: false})
|
|
98
|
+
cb(null, { retainData: false })
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
/**
|
|
@@ -108,7 +109,7 @@ class ServerlessCollector {
|
|
|
108
109
|
this.payload.error_data = payload
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
cb(null, {retainData: false})
|
|
112
|
+
cb(null, { retainData: false })
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
/**
|
|
@@ -122,7 +123,7 @@ class ServerlessCollector {
|
|
|
122
123
|
this.payload.error_event_data = payload
|
|
123
124
|
}
|
|
124
125
|
|
|
125
|
-
cb(null, {retainData: false})
|
|
126
|
+
cb(null, { retainData: false })
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
/**
|
|
@@ -135,7 +136,7 @@ class ServerlessCollector {
|
|
|
135
136
|
if (this.enabled) {
|
|
136
137
|
this.payload.transaction_sample_data = payload
|
|
137
138
|
}
|
|
138
|
-
cb(null, {retainData: false})
|
|
139
|
+
cb(null, { retainData: false })
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
/**
|
|
@@ -149,7 +150,7 @@ class ServerlessCollector {
|
|
|
149
150
|
this.payload.analytic_event_data = payload
|
|
150
151
|
}
|
|
151
152
|
|
|
152
|
-
cb(null, {retainData: false})
|
|
153
|
+
cb(null, { retainData: false })
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
/**
|
|
@@ -163,7 +164,7 @@ class ServerlessCollector {
|
|
|
163
164
|
this.payload.custom_event_data = payload
|
|
164
165
|
}
|
|
165
166
|
|
|
166
|
-
cb(null, {retainData: false})
|
|
167
|
+
cb(null, { retainData: false })
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
/**
|
|
@@ -176,7 +177,7 @@ class ServerlessCollector {
|
|
|
176
177
|
if (this.enabled) {
|
|
177
178
|
this.payload.sql_trace_data = payload
|
|
178
179
|
}
|
|
179
|
-
cb(null, {retainData: false})
|
|
180
|
+
cb(null, { retainData: false })
|
|
180
181
|
}
|
|
181
182
|
|
|
182
183
|
/**
|
|
@@ -189,7 +190,7 @@ class ServerlessCollector {
|
|
|
189
190
|
if (this.enabled) {
|
|
190
191
|
this.payload.span_event_data = payload
|
|
191
192
|
}
|
|
192
|
-
cb(null, {retainData: false})
|
|
193
|
+
cb(null, { retainData: false })
|
|
193
194
|
}
|
|
194
195
|
|
|
195
196
|
/**
|
|
@@ -266,10 +267,7 @@ class ServerlessCollector {
|
|
|
266
267
|
// Guarantees process.stdout will block, so long logs
|
|
267
268
|
// won't be truncated if process.exit() is called early.
|
|
268
269
|
const s = process.stdout
|
|
269
|
-
payloadLength > 65000 &&
|
|
270
|
-
s._handle &&
|
|
271
|
-
s._handle.setBlocking &&
|
|
272
|
-
s._handle.setBlocking(true)
|
|
270
|
+
payloadLength > 65000 && s._handle && s._handle.setBlocking && s._handle.setBlocking(true)
|
|
273
271
|
|
|
274
272
|
fs.writeSync(process.stdout.fd, serializedPayload)
|
|
275
273
|
} else {
|
|
@@ -286,11 +284,7 @@ class ServerlessCollector {
|
|
|
286
284
|
* @param {boolean} sync Whether to write to stdout synchronously.
|
|
287
285
|
*/
|
|
288
286
|
_doFlush(payload, sync = false) {
|
|
289
|
-
const serializedPayload = JSON.stringify([
|
|
290
|
-
PAYLOAD_VERSION,
|
|
291
|
-
PAYLOAD_MARKER,
|
|
292
|
-
payload
|
|
293
|
-
]) + '\n'
|
|
287
|
+
const serializedPayload = JSON.stringify([PAYLOAD_VERSION, PAYLOAD_MARKER, payload]) + '\n'
|
|
294
288
|
|
|
295
289
|
const didUsePipe = fs.existsSync(this.pipePath) && this.flushToPipeSync(serializedPayload)
|
|
296
290
|
|
|
@@ -301,3 +295,4 @@ class ServerlessCollector {
|
|
|
301
295
|
}
|
|
302
296
|
|
|
303
297
|
module.exports = ServerlessCollector
|
|
298
|
+
/* eslint-enable camelcase */
|