dd-trace 2.6.0 → 2.8.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/LICENSE-3rdparty.csv +1 -4
- package/index.d.ts +0 -7
- package/package.json +18 -24
- package/packages/datadog-instrumentations/index.js +16 -0
- package/packages/datadog-instrumentations/src/amqp10.js +33 -32
- package/packages/datadog-instrumentations/src/amqplib.js +16 -11
- package/packages/datadog-instrumentations/src/aws-sdk.js +104 -0
- package/packages/datadog-instrumentations/src/cassandra-driver.js +53 -51
- package/packages/datadog-instrumentations/src/connect.js +111 -0
- package/packages/datadog-instrumentations/src/couchbase.js +41 -39
- package/packages/datadog-instrumentations/src/cucumber.js +38 -38
- package/packages/datadog-instrumentations/src/dns.js +20 -19
- package/packages/datadog-instrumentations/src/elasticsearch.js +30 -32
- package/packages/datadog-instrumentations/src/express.js +27 -0
- package/packages/datadog-instrumentations/src/fastify.js +187 -0
- package/packages/datadog-instrumentations/src/find-my-way.js +30 -0
- package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +100 -0
- package/packages/datadog-instrumentations/src/hapi.js +210 -0
- package/packages/datadog-instrumentations/src/http/client.js +44 -44
- package/packages/datadog-instrumentations/src/http/server.js +15 -13
- package/packages/datadog-instrumentations/src/ioredis.js +16 -17
- package/packages/datadog-instrumentations/src/jest.js +22 -17
- package/packages/datadog-instrumentations/src/kafkajs.js +112 -0
- package/packages/datadog-instrumentations/src/knex.js +20 -0
- package/packages/datadog-instrumentations/src/koa.js +159 -0
- package/packages/datadog-instrumentations/src/limitd-client.js +21 -0
- package/packages/datadog-instrumentations/src/memcached.js +14 -12
- package/packages/datadog-instrumentations/src/mocha.js +37 -39
- package/packages/datadog-instrumentations/src/moleculer/client.js +46 -0
- package/packages/datadog-instrumentations/src/moleculer/server.js +59 -0
- package/packages/datadog-instrumentations/src/moleculer.js +4 -0
- package/packages/datadog-instrumentations/src/mongodb-core.js +29 -33
- package/packages/datadog-instrumentations/src/mysql.js +30 -29
- package/packages/datadog-instrumentations/src/mysql2.js +8 -9
- package/packages/datadog-instrumentations/src/net.js +23 -24
- package/packages/datadog-instrumentations/src/oracledb.js +128 -0
- package/packages/datadog-instrumentations/src/paperplane.js +77 -0
- package/packages/datadog-instrumentations/src/pg.js +32 -32
- package/packages/datadog-instrumentations/src/redis.js +49 -47
- package/packages/datadog-instrumentations/src/restify.js +58 -0
- package/packages/datadog-instrumentations/src/rhea.js +52 -50
- package/packages/datadog-instrumentations/src/router.js +177 -0
- package/packages/datadog-instrumentations/src/sharedb.js +20 -20
- package/packages/datadog-instrumentations/src/tedious.js +19 -19
- package/packages/datadog-plugin-amqp10/src/index.js +2 -7
- package/packages/datadog-plugin-amqplib/src/index.js +1 -2
- package/packages/datadog-plugin-aws-sdk/src/base.js +146 -0
- package/packages/datadog-plugin-aws-sdk/src/index.js +16 -106
- package/packages/datadog-plugin-aws-sdk/src/services/cloudwatchlogs.js +4 -2
- package/packages/datadog-plugin-aws-sdk/src/services/default.js +7 -0
- package/packages/datadog-plugin-aws-sdk/src/services/dynamodb.js +3 -1
- package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +5 -4
- package/packages/datadog-plugin-aws-sdk/src/services/index.js +12 -0
- package/packages/datadog-plugin-aws-sdk/src/services/kinesis.js +4 -3
- package/packages/datadog-plugin-aws-sdk/src/services/lambda.js +4 -3
- package/packages/datadog-plugin-aws-sdk/src/services/redshift.js +3 -1
- package/packages/datadog-plugin-aws-sdk/src/services/s3.js +3 -1
- package/packages/datadog-plugin-aws-sdk/src/services/sns.js +4 -3
- package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +45 -6
- package/packages/datadog-plugin-cassandra-driver/src/index.js +1 -5
- package/packages/datadog-plugin-connect/src/index.js +10 -114
- package/packages/datadog-plugin-couchbase/src/index.js +3 -4
- package/packages/datadog-plugin-cucumber/src/index.js +1 -9
- package/packages/datadog-plugin-dns/src/index.js +15 -5
- package/packages/datadog-plugin-elasticsearch/src/index.js +1 -5
- package/packages/datadog-plugin-express/src/index.js +11 -25
- package/packages/datadog-plugin-fastify/src/index.js +17 -4
- package/packages/datadog-plugin-find-my-way/src/index.js +20 -0
- package/packages/datadog-plugin-google-cloud-pubsub/src/index.js +56 -111
- package/packages/datadog-plugin-hapi/src/index.js +34 -3
- package/packages/datadog-plugin-http/src/client.js +1 -3
- package/packages/datadog-plugin-http/src/server.js +2 -6
- package/packages/datadog-plugin-jest/src/index.js +2 -3
- package/packages/datadog-plugin-kafkajs/src/index.js +61 -91
- package/packages/datadog-plugin-koa/src/index.js +12 -164
- package/packages/datadog-plugin-memcached/src/index.js +1 -5
- package/packages/datadog-plugin-mocha/src/index.js +3 -7
- package/packages/datadog-plugin-moleculer/src/client.js +34 -44
- package/packages/datadog-plugin-moleculer/src/index.js +32 -3
- package/packages/datadog-plugin-moleculer/src/server.js +28 -50
- package/packages/datadog-plugin-mongodb-core/src/index.js +1 -5
- package/packages/datadog-plugin-mysql/src/index.js +1 -5
- package/packages/datadog-plugin-net/src/index.js +3 -7
- package/packages/datadog-plugin-oracledb/src/index.js +34 -100
- package/packages/datadog-plugin-paperplane/src/index.js +14 -100
- package/packages/datadog-plugin-paperplane/src/logger.js +11 -0
- package/packages/datadog-plugin-paperplane/src/server.js +24 -0
- package/packages/datadog-plugin-pg/src/index.js +1 -5
- package/packages/datadog-plugin-redis/src/index.js +1 -5
- package/packages/datadog-plugin-restify/src/index.js +13 -75
- package/packages/datadog-plugin-rhea/src/index.js +1 -5
- package/packages/datadog-plugin-router/src/index.js +67 -164
- package/packages/datadog-plugin-sharedb/src/index.js +1 -5
- package/packages/datadog-plugin-tedious/src/index.js +1 -5
- package/packages/datadog-plugin-web/src/index.js +20 -0
- package/packages/dd-trace/lib/version.js +1 -1
- package/packages/dd-trace/src/appsec/callbacks/ddwaf.js +8 -2
- package/packages/dd-trace/src/appsec/reporter.js +4 -0
- package/packages/dd-trace/src/encode/agentless-ci-visibility.js +3 -1
- package/packages/dd-trace/src/plugin_manager.js +13 -7
- package/packages/dd-trace/src/plugins/index.js +1 -2
- package/packages/dd-trace/src/plugins/log_plugin.js +8 -4
- package/packages/dd-trace/src/plugins/plugin.js +8 -8
- package/packages/dd-trace/src/plugins/util/test.js +5 -1
- package/packages/dd-trace/src/plugins/util/web.js +40 -12
- package/packages/dd-trace/src/profiling/config.js +8 -8
- package/packages/dd-trace/src/profiling/index.js +4 -4
- package/packages/dd-trace/src/profiling/profilers/{heap.js → space.js} +2 -2
- package/packages/dd-trace/src/profiling/profilers/{cpu.js → wall.js} +2 -2
- package/scripts/install_plugin_modules.js +23 -11
- package/packages/datadog-plugin-aws-sdk/src/helpers.js +0 -103
- package/packages/datadog-plugin-fastify/src/fastify.js +0 -198
- package/packages/datadog-plugin-fastify/src/find-my-way.js +0 -37
- package/packages/datadog-plugin-hapi/src/route.js +0 -75
- package/packages/datadog-plugin-hapi/src/server.js +0 -204
- package/packages/datadog-plugin-knex/src/index.js +0 -23
- package/packages/datadog-plugin-limitd-client/src/index.js +0 -30
- package/scripts/postpublish.js +0 -24
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const web = require('../../dd-trace/src/plugins/util/web')
|
|
4
|
-
|
|
5
|
-
function createWrapDispatch (tracer, config) {
|
|
6
|
-
config = web.normalizeConfig(config)
|
|
7
|
-
|
|
8
|
-
return function wrapDispatch (dispatch) {
|
|
9
|
-
return function dispatchWithTrace (options) {
|
|
10
|
-
const handler = dispatch.apply(this, arguments)
|
|
11
|
-
|
|
12
|
-
if (typeof handler !== 'function') return handler
|
|
13
|
-
|
|
14
|
-
return function (req, res) {
|
|
15
|
-
return web.instrument(tracer, config, req, res, 'hapi.request', () => {
|
|
16
|
-
return handler.apply(this, arguments)
|
|
17
|
-
})
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function createWrapServer (tracer) {
|
|
24
|
-
return function wrapServer (server) {
|
|
25
|
-
return function serverWithTrace (options) {
|
|
26
|
-
const app = server.apply(this, arguments)
|
|
27
|
-
|
|
28
|
-
if (!app) return app
|
|
29
|
-
|
|
30
|
-
if (typeof app.ext === 'function') {
|
|
31
|
-
app.ext = createWrapExt(tracer)(app.ext)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (typeof app.start === 'function') {
|
|
35
|
-
app.start = createWrapStart(tracer)(app.start)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return app
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function createWrapStart () {
|
|
44
|
-
return function wrapStart (start) {
|
|
45
|
-
return function startWithTrace () {
|
|
46
|
-
if (this && typeof this.ext === 'function') {
|
|
47
|
-
this.ext('onPreResponse', onPreResponse)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return start.apply(this, arguments)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function createWrapExt () {
|
|
56
|
-
return function wrapExt (ext) {
|
|
57
|
-
return function extWithTrace (events, method, options) {
|
|
58
|
-
if (typeof events === 'object') {
|
|
59
|
-
arguments[0] = wrapEvents(events)
|
|
60
|
-
} else {
|
|
61
|
-
arguments[1] = wrapExtension(method)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return ext.apply(this, arguments)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function wrapExtension (method) {
|
|
70
|
-
return [].concat(method).map(wrapHandler)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function wrapEvents (events) {
|
|
74
|
-
return [].concat(events).map(event => {
|
|
75
|
-
if (!event || !event.method) return event
|
|
76
|
-
|
|
77
|
-
return Object.assign({}, event, {
|
|
78
|
-
method: wrapExtension(event.method)
|
|
79
|
-
})
|
|
80
|
-
})
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function wrapHandler (handler) {
|
|
84
|
-
if (typeof handler !== 'function') return handler
|
|
85
|
-
|
|
86
|
-
return function (request, h) {
|
|
87
|
-
if (!request || !request.raw) return handler.apply(this, arguments)
|
|
88
|
-
|
|
89
|
-
return web.reactivate(request.raw.req, () => handler.apply(this, arguments))
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function onPreResponse (request, h) {
|
|
94
|
-
if (!request || !request.raw) return reply(request, h)
|
|
95
|
-
|
|
96
|
-
const req = request.raw.req
|
|
97
|
-
|
|
98
|
-
web.addError(req, request.response)
|
|
99
|
-
|
|
100
|
-
if (request.route) {
|
|
101
|
-
web.enterRoute(req, request.route.path)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return reply(request, h)
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function reply (request, h) {
|
|
108
|
-
if (h.continue) {
|
|
109
|
-
return typeof h.continue === 'function'
|
|
110
|
-
? h.continue()
|
|
111
|
-
: h.continue
|
|
112
|
-
} else if (typeof h === 'function') {
|
|
113
|
-
return h()
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
module.exports = [
|
|
118
|
-
{
|
|
119
|
-
name: '@hapi/hapi',
|
|
120
|
-
versions: ['>=17.9'],
|
|
121
|
-
patch (hapi, tracer, config) {
|
|
122
|
-
this.wrap(hapi, ['server', 'Server'], createWrapServer(tracer, config))
|
|
123
|
-
},
|
|
124
|
-
unpatch (hapi) {
|
|
125
|
-
this.unwrap(hapi, ['server', 'Server'])
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
name: 'hapi',
|
|
130
|
-
versions: ['>=17'],
|
|
131
|
-
patch (hapi, tracer, config) {
|
|
132
|
-
this.wrap(hapi, ['server', 'Server'], createWrapServer(tracer, config))
|
|
133
|
-
},
|
|
134
|
-
unpatch (hapi) {
|
|
135
|
-
this.unwrap(hapi, ['server', 'Server'])
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
name: 'hapi',
|
|
140
|
-
versions: ['2 - 7.1', '8 - 16'],
|
|
141
|
-
patch (hapi, tracer, config) {
|
|
142
|
-
this.wrap(hapi.Server.prototype, 'start', createWrapStart(tracer, config))
|
|
143
|
-
this.wrap(hapi.Server.prototype, 'ext', createWrapExt(tracer, config))
|
|
144
|
-
},
|
|
145
|
-
unpatch (hapi) {
|
|
146
|
-
this.unwrap(hapi.Server.prototype, 'start')
|
|
147
|
-
this.unwrap(hapi.Server.prototype, 'ext')
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
name: 'hapi',
|
|
152
|
-
versions: ['^7.2'],
|
|
153
|
-
patch (hapi, tracer, config) {
|
|
154
|
-
this.wrap(hapi, 'createServer', createWrapServer(tracer, config))
|
|
155
|
-
},
|
|
156
|
-
unpatch (hapi) {
|
|
157
|
-
this.unwrap(hapi, 'createServer')
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
name: '@hapi/hapi',
|
|
162
|
-
versions: ['>=17.9'],
|
|
163
|
-
file: 'lib/core.js',
|
|
164
|
-
patch (Core, tracer, config) {
|
|
165
|
-
this.wrap(Core.prototype, '_dispatch', createWrapDispatch(tracer, config))
|
|
166
|
-
},
|
|
167
|
-
unpatch (Core) {
|
|
168
|
-
this.unwrap(Core.prototype, '_dispatch')
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
name: 'hapi',
|
|
173
|
-
versions: ['7.2 - 16'],
|
|
174
|
-
file: 'lib/connection.js',
|
|
175
|
-
patch (Connection, tracer, config) {
|
|
176
|
-
this.wrap(Connection.prototype, '_dispatch', createWrapDispatch(tracer, config))
|
|
177
|
-
},
|
|
178
|
-
unpatch (Connection) {
|
|
179
|
-
this.unwrap(Connection.prototype, '_dispatch')
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
name: 'hapi',
|
|
184
|
-
versions: ['>=17'],
|
|
185
|
-
file: 'lib/core.js',
|
|
186
|
-
patch (Core, tracer, config) {
|
|
187
|
-
this.wrap(Core.prototype, '_dispatch', createWrapDispatch(tracer, config))
|
|
188
|
-
},
|
|
189
|
-
unpatch (Core) {
|
|
190
|
-
this.unwrap(Core.prototype, '_dispatch')
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
name: 'hapi',
|
|
195
|
-
versions: ['2 - 7.1'],
|
|
196
|
-
file: 'lib/server.js',
|
|
197
|
-
patch (Server, tracer, config) {
|
|
198
|
-
this.wrap(Server.prototype, '_dispatch', createWrapDispatch(tracer, config))
|
|
199
|
-
},
|
|
200
|
-
unpatch (Server) {
|
|
201
|
-
this.unwrap(Server.prototype, '_dispatch')
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
]
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const { wrapThen } = require('../../datadog-instrumentations/src/helpers/promise')
|
|
4
|
-
|
|
5
|
-
function createPatch (file) {
|
|
6
|
-
return {
|
|
7
|
-
name: 'knex',
|
|
8
|
-
versions: ['>=0.8.0'],
|
|
9
|
-
file,
|
|
10
|
-
patch (Builder) {
|
|
11
|
-
this.wrap(Builder.prototype, 'then', wrapThen)
|
|
12
|
-
},
|
|
13
|
-
unpatch (Builder) {
|
|
14
|
-
this.unwrap(Builder.prototype, 'then')
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
module.exports = [
|
|
20
|
-
createPatch('lib/query/builder.js'),
|
|
21
|
-
createPatch('lib/raw.js'),
|
|
22
|
-
createPatch('lib/schema/builder.js')
|
|
23
|
-
]
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
function createWrapRequest (tracer) {
|
|
4
|
-
const scope = tracer.scope()
|
|
5
|
-
|
|
6
|
-
return function wrapRequest (original) {
|
|
7
|
-
return function requestWithTrace (request, callback) {
|
|
8
|
-
const index = arguments.length - 1
|
|
9
|
-
|
|
10
|
-
arguments[index] = scope.bind(arguments[index])
|
|
11
|
-
|
|
12
|
-
return original.apply(this, arguments)
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
module.exports = [
|
|
18
|
-
{
|
|
19
|
-
name: 'limitd-client',
|
|
20
|
-
versions: ['>=2.8'],
|
|
21
|
-
patch (LimitdClient, tracer) {
|
|
22
|
-
this.wrap(LimitdClient.prototype, '_directRequest', createWrapRequest(tracer))
|
|
23
|
-
this.wrap(LimitdClient.prototype, '_retriedRequest', createWrapRequest(tracer))
|
|
24
|
-
},
|
|
25
|
-
unpatch (LimitdClient) {
|
|
26
|
-
this.unwrap(LimitdClient.prototype, '_directRequest')
|
|
27
|
-
this.unwrap(LimitdClient.prototype, '_retriedRequest')
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
]
|
package/scripts/postpublish.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const exec = require('./helpers/exec')
|
|
4
|
-
|
|
5
|
-
const pkg = require('../package.json')
|
|
6
|
-
|
|
7
|
-
const betaExpr = /\d+\.\d+\.\d+-.*/
|
|
8
|
-
const legacyExpr = /0\.\d+\.\d+/
|
|
9
|
-
|
|
10
|
-
if (!betaExpr.test(pkg.version) && !legacyExpr.test(pkg.version)) {
|
|
11
|
-
const releaseBranches = exec.pipe('git fetch && git branch -a | grep -E "/v\\d+\\.x"')
|
|
12
|
-
.trim()
|
|
13
|
-
.split(/\s+/)
|
|
14
|
-
const releaseMajors = releaseBranches
|
|
15
|
-
.map(branch => parseInt(branch.replace(/[^0-9]/g, '')))
|
|
16
|
-
.sort()
|
|
17
|
-
.reverse()
|
|
18
|
-
const latestMajor = releaseMajors[0]
|
|
19
|
-
const currentMajor = parseInt(pkg.version.split('.')[0])
|
|
20
|
-
|
|
21
|
-
if (currentMajor === latestMajor) {
|
|
22
|
-
exec(`node scripts/publish_docs.js "v${pkg.version}"`)
|
|
23
|
-
}
|
|
24
|
-
}
|