dd-trace 5.61.0 → 5.62.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/package.json +1 -1
- package/packages/datadog-instrumentations/src/apollo-server.js +50 -8
- package/packages/datadog-instrumentations/src/aws-sdk.js +49 -60
- package/packages/datadog-instrumentations/src/fastify.js +61 -55
- package/packages/datadog-instrumentations/src/graphql.js +90 -122
- package/packages/datadog-instrumentations/src/http2/server.js +14 -20
- package/packages/datadog-instrumentations/src/microgateway-core.js +16 -15
- package/packages/datadog-instrumentations/src/mongodb-core.js +34 -29
- package/packages/datadog-instrumentations/src/mongodb.js +9 -13
- package/packages/datadog-instrumentations/src/mongoose.js +25 -29
- package/packages/datadog-instrumentations/src/openai.js +0 -2
- package/packages/datadog-instrumentations/src/oracledb.js +39 -33
- package/packages/datadog-instrumentations/src/router.js +1 -1
- package/packages/datadog-plugin-aerospike/src/index.js +5 -9
- package/packages/datadog-plugin-amqp10/src/consumer.js +2 -2
- package/packages/datadog-plugin-amqp10/src/index.js +1 -1
- package/packages/datadog-plugin-amqp10/src/producer.js +3 -3
- package/packages/datadog-plugin-amqplib/src/client.js +3 -3
- package/packages/datadog-plugin-amqplib/src/consumer.js +2 -2
- package/packages/datadog-plugin-amqplib/src/index.js +1 -1
- package/packages/datadog-plugin-amqplib/src/producer.js +2 -2
- package/packages/datadog-plugin-apollo/src/gateway/execute.js +2 -4
- package/packages/datadog-plugin-apollo/src/gateway/fetch.js +2 -4
- package/packages/datadog-plugin-apollo/src/gateway/index.js +1 -1
- package/packages/datadog-plugin-apollo/src/gateway/plan.js +2 -4
- package/packages/datadog-plugin-apollo/src/gateway/postprocessing.js +2 -4
- package/packages/datadog-plugin-apollo/src/gateway/request.js +2 -4
- package/packages/datadog-plugin-apollo/src/gateway/validate.js +2 -4
- package/packages/datadog-plugin-apollo/src/index.js +1 -1
- package/packages/datadog-plugin-avsc/src/index.js +2 -2
- package/packages/datadog-plugin-aws-sdk/src/base.js +70 -46
- package/packages/datadog-plugin-aws-sdk/src/index.js +1 -3
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/index.js +1 -3
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/tracing.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/cloudwatchlogs.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/dynamodb.js +3 -3
- package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +2 -2
- package/packages/datadog-plugin-aws-sdk/src/services/kinesis.js +22 -20
- package/packages/datadog-plugin-aws-sdk/src/services/lambda.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/redshift.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/s3.js +3 -3
- package/packages/datadog-plugin-aws-sdk/src/services/sfn.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/sns.js +3 -3
- package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +17 -15
- package/packages/datadog-plugin-aws-sdk/src/services/states.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/stepfunctions.js +1 -1
- package/packages/datadog-plugin-azure-functions/src/index.js +5 -5
- package/packages/datadog-plugin-azure-service-bus/src/index.js +1 -1
- package/packages/datadog-plugin-azure-service-bus/src/producer.js +2 -2
- package/packages/datadog-plugin-bunyan/src/index.js +3 -5
- package/packages/datadog-plugin-cassandra-driver/src/index.js +3 -3
- package/packages/datadog-plugin-child_process/src/index.js +2 -2
- package/packages/datadog-plugin-confluentinc-kafka-javascript/src/batch-consumer.js +1 -3
- package/packages/datadog-plugin-confluentinc-kafka-javascript/src/consumer.js +1 -3
- package/packages/datadog-plugin-confluentinc-kafka-javascript/src/index.js +1 -1
- package/packages/datadog-plugin-confluentinc-kafka-javascript/src/producer.js +1 -3
- package/packages/datadog-plugin-connect/src/index.js +1 -3
- package/packages/datadog-plugin-couchbase/src/index.js +2 -2
- package/packages/datadog-plugin-cucumber/src/index.js +1 -3
- package/packages/datadog-plugin-cypress/src/index.js +1 -3
- package/packages/datadog-plugin-dd-trace-api/src/index.js +1 -3
- package/packages/datadog-plugin-dns/src/index.js +1 -1
- package/packages/datadog-plugin-dns/src/lookup.js +2 -2
- package/packages/datadog-plugin-dns/src/lookup_service.js +2 -2
- package/packages/datadog-plugin-dns/src/resolve.js +2 -2
- package/packages/datadog-plugin-dns/src/reverse.js +2 -2
- package/packages/datadog-plugin-elasticsearch/src/index.js +1 -1
- package/packages/datadog-plugin-express/src/code_origin.js +1 -3
- package/packages/datadog-plugin-express/src/index.js +1 -1
- package/packages/datadog-plugin-express/src/tracing.js +1 -3
- package/packages/datadog-plugin-fastify/src/code_origin.js +1 -3
- package/packages/datadog-plugin-fastify/src/index.js +1 -1
- package/packages/datadog-plugin-fastify/src/tracing.js +18 -3
- package/packages/datadog-plugin-fetch/src/index.js +2 -2
- package/packages/datadog-plugin-find-my-way/src/index.js +1 -3
- package/packages/datadog-plugin-fs/src/index.js +2 -2
- package/packages/datadog-plugin-google-cloud-pubsub/src/client.js +3 -3
- package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +2 -2
- package/packages/datadog-plugin-google-cloud-pubsub/src/index.js +1 -1
- package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +2 -2
- package/packages/datadog-plugin-google-cloud-vertexai/src/index.js +1 -1
- package/packages/datadog-plugin-google-cloud-vertexai/src/tracing.js +2 -4
- package/packages/datadog-plugin-graphql/src/execute.js +16 -9
- package/packages/datadog-plugin-graphql/src/index.js +1 -1
- package/packages/datadog-plugin-graphql/src/parse.js +12 -7
- package/packages/datadog-plugin-graphql/src/resolve.js +50 -16
- package/packages/datadog-plugin-graphql/src/validate.js +13 -7
- package/packages/datadog-plugin-grpc/src/client.js +4 -4
- package/packages/datadog-plugin-grpc/src/index.js +1 -1
- package/packages/datadog-plugin-grpc/src/server.js +3 -3
- package/packages/datadog-plugin-hapi/src/index.js +1 -3
- package/packages/datadog-plugin-hono/src/index.js +1 -3
- package/packages/datadog-plugin-http/src/client.js +2 -2
- package/packages/datadog-plugin-http/src/index.js +1 -1
- package/packages/datadog-plugin-http/src/server.js +3 -7
- package/packages/datadog-plugin-http2/src/client.js +2 -2
- package/packages/datadog-plugin-http2/src/index.js +1 -1
- package/packages/datadog-plugin-http2/src/server.js +22 -11
- package/packages/datadog-plugin-ioredis/src/index.js +1 -3
- package/packages/datadog-plugin-iovalkey/src/index.js +2 -4
- package/packages/datadog-plugin-jest/src/index.js +1 -3
- package/packages/datadog-plugin-kafkajs/src/batch-consumer.js +2 -2
- package/packages/datadog-plugin-kafkajs/src/consumer.js +2 -2
- package/packages/datadog-plugin-kafkajs/src/index.js +1 -1
- package/packages/datadog-plugin-kafkajs/src/producer.js +3 -3
- package/packages/datadog-plugin-koa/src/index.js +1 -3
- package/packages/datadog-plugin-langchain/src/index.js +2 -2
- package/packages/datadog-plugin-langchain/src/tracing.js +30 -48
- package/packages/datadog-plugin-mariadb/src/index.js +2 -2
- package/packages/datadog-plugin-memcached/src/index.js +1 -1
- package/packages/datadog-plugin-microgateway-core/src/index.js +4 -4
- package/packages/datadog-plugin-mocha/src/index.js +1 -3
- package/packages/datadog-plugin-moleculer/src/client.js +2 -2
- package/packages/datadog-plugin-moleculer/src/index.js +1 -1
- package/packages/datadog-plugin-moleculer/src/server.js +2 -2
- package/packages/datadog-plugin-mongodb-core/src/index.js +9 -5
- package/packages/datadog-plugin-mongoose/src/index.js +20 -0
- package/packages/datadog-plugin-mysql/src/index.js +2 -2
- package/packages/datadog-plugin-mysql2/src/index.js +1 -1
- package/packages/datadog-plugin-net/src/index.js +1 -1
- package/packages/datadog-plugin-net/src/ipc.js +2 -2
- package/packages/datadog-plugin-net/src/tcp.js +2 -2
- package/packages/datadog-plugin-next/src/index.js +1 -3
- package/packages/datadog-plugin-nyc/src/index.js +1 -3
- package/packages/datadog-plugin-openai/src/index.js +1 -1
- package/packages/datadog-plugin-openai/src/tracing.js +7 -411
- package/packages/datadog-plugin-opensearch/src/index.js +1 -3
- package/packages/datadog-plugin-oracledb/src/index.js +9 -5
- package/packages/datadog-plugin-pg/src/index.js +3 -3
- package/packages/datadog-plugin-pino/src/index.js +3 -5
- package/packages/datadog-plugin-playwright/src/index.js +1 -3
- package/packages/datadog-plugin-prisma/src/client.js +4 -6
- package/packages/datadog-plugin-prisma/src/engine.js +3 -3
- package/packages/datadog-plugin-prisma/src/index.js +1 -1
- package/packages/datadog-plugin-protobufjs/src/index.js +2 -6
- package/packages/datadog-plugin-redis/src/index.js +2 -2
- package/packages/datadog-plugin-restify/src/index.js +1 -3
- package/packages/datadog-plugin-rhea/src/consumer.js +1 -1
- package/packages/datadog-plugin-rhea/src/index.js +1 -1
- package/packages/datadog-plugin-rhea/src/producer.js +2 -2
- package/packages/datadog-plugin-router/src/index.js +1 -3
- package/packages/datadog-plugin-selenium/src/index.js +1 -3
- package/packages/datadog-plugin-sharedb/src/index.js +1 -1
- package/packages/datadog-plugin-tedious/src/index.js +3 -3
- package/packages/datadog-plugin-undici/src/index.js +2 -4
- package/packages/datadog-plugin-vitest/src/index.js +1 -3
- package/packages/datadog-plugin-web/src/index.js +1 -3
- package/packages/datadog-plugin-winston/src/index.js +3 -5
- package/packages/dd-trace/src/appsec/channels.js +1 -0
- package/packages/dd-trace/src/appsec/graphql.js +14 -12
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +1 -1
- package/packages/dd-trace/src/appsec/waf/waf_manager.js +1 -1
- package/packages/dd-trace/src/ci-visibility/log-submission/log-submission-plugin.js +1 -3
- package/packages/dd-trace/src/ci-visibility/test-api-manual/test-api-manual-plugin.js +1 -3
- package/packages/dd-trace/src/config.js +1 -1
- package/packages/dd-trace/src/datastreams/checkpointer.js +23 -2
- package/packages/dd-trace/src/datastreams/processor.js +4 -3
- package/packages/dd-trace/src/llmobs/plugins/langchain/index.js +30 -50
- package/packages/dd-trace/src/llmobs/plugins/openai.js +3 -5
- package/packages/dd-trace/src/llmobs/plugins/vertexai.js +3 -5
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +25 -2
- package/packages/dd-trace/src/plugins/apollo.js +3 -3
- package/packages/dd-trace/src/plugins/cache.js +1 -1
- package/packages/dd-trace/src/plugins/client.js +3 -3
- package/packages/dd-trace/src/plugins/consumer.js +3 -3
- package/packages/dd-trace/src/plugins/database.js +2 -2
- package/packages/dd-trace/src/plugins/index.js +1 -0
- package/packages/dd-trace/src/plugins/log_plugin.js +1 -5
- package/packages/dd-trace/src/plugins/outbound.js +1 -1
- package/packages/dd-trace/src/plugins/plugin.js +1 -1
- package/packages/dd-trace/src/plugins/producer.js +3 -3
- package/packages/dd-trace/src/plugins/server.js +3 -3
- package/packages/dd-trace/src/plugins/storage.js +1 -1
- package/packages/dd-trace/src/plugins/tracing.js +24 -6
- package/packages/dd-trace/src/plugins/util/ci.js +11 -7
- package/packages/dd-trace/src/plugins/util/inferred_proxy.js +15 -19
- package/packages/dd-trace/src/plugins/util/tags.js +2 -0
- package/packages/dd-trace/src/plugins/util/web.js +26 -7
- package/packages/dd-trace/src/profiling/config.js +2 -0
- package/packages/dd-trace/src/profiling/exporters/event_serializer.js +2 -21
- package/packages/dd-trace/src/profiling/libuv-size.js +49 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns.js +2 -6
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns_lookup.js +1 -3
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns_lookupservice.js +1 -3
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns_resolve.js +1 -3
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns_reverse.js +1 -3
- package/packages/dd-trace/src/profiling/profilers/event_plugins/fs.js +3 -9
- package/packages/dd-trace/src/profiling/profilers/event_plugins/net.js +3 -9
- package/packages/dd-trace/src/profiling/profilers/events.js +80 -62
- package/packages/dd-trace/src/profiling/profilers/poisson.js +105 -0
- package/packages/dd-trace/src/profiling/profilers/wall.js +1 -1
- package/packages/dd-trace/src/remote_config/manager.js +1 -1
|
@@ -2,19 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
const { addHook, channel } = require('./helpers/instrument')
|
|
4
4
|
const { wrapThen } = require('./helpers/promise')
|
|
5
|
-
const { AsyncResource } = require('./helpers/instrument')
|
|
6
5
|
const shimmer = require('../../datadog-shimmer')
|
|
7
6
|
|
|
7
|
+
const startCh = channel('datadog:mongoose:model:filter:start')
|
|
8
|
+
const finishCh = channel('datadog:mongoose:model:filter:finish')
|
|
9
|
+
// this channel is for wrapping the callback of exec methods and handling store context
|
|
10
|
+
const execStartCh = channel('apm:mongoose:exec:start')
|
|
11
|
+
const execFinishCh = channel('apm:mongoose:exec:finish')
|
|
12
|
+
|
|
8
13
|
function wrapAddQueue (addQueue) {
|
|
9
|
-
|
|
10
|
-
if (typeof name === 'function') {
|
|
11
|
-
arguments[0] = AsyncResource.bind(name)
|
|
12
|
-
} else if (typeof this[name] === 'function') {
|
|
13
|
-
arguments[0] = AsyncResource.bind((...args) => this[name](...args))
|
|
14
|
-
}
|
|
14
|
+
const ctx = {}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
return execStartCh.runStores(ctx, () => {
|
|
17
|
+
return function addQueueWithTrace (name) {
|
|
18
|
+
return execFinishCh.runStores(ctx, () => {
|
|
19
|
+
return addQueue.apply(this, arguments)
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
})
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
addHook({
|
|
@@ -31,9 +36,6 @@ addHook({
|
|
|
31
36
|
return mongoose
|
|
32
37
|
})
|
|
33
38
|
|
|
34
|
-
const startCh = channel('datadog:mongoose:model:filter:start')
|
|
35
|
-
const finishCh = channel('datadog:mongoose:model:filter:finish')
|
|
36
|
-
|
|
37
39
|
const collectionMethodsWithFilter = [
|
|
38
40
|
'count',
|
|
39
41
|
'countDocuments',
|
|
@@ -68,27 +70,21 @@ addHook({
|
|
|
68
70
|
return method.apply(this, arguments)
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
const asyncResource = new AsyncResource('bound-anonymous-fn')
|
|
72
|
-
|
|
73
73
|
const filters = [arguments[0]]
|
|
74
74
|
if (useTwoArguments) {
|
|
75
75
|
filters.push(arguments[1])
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
const finish = asyncResource.bind(function () {
|
|
79
|
-
finishCh.publish()
|
|
80
|
-
})
|
|
81
|
-
|
|
82
78
|
let callbackWrapped = false
|
|
83
79
|
|
|
84
|
-
const wrapCallbackIfExist = (args) => {
|
|
80
|
+
const wrapCallbackIfExist = (args, ctx) => {
|
|
85
81
|
const lastArgumentIndex = args.length - 1
|
|
86
82
|
|
|
87
83
|
if (typeof args[lastArgumentIndex] === 'function') {
|
|
88
84
|
// is a callback, wrap it to execute finish()
|
|
89
85
|
shimmer.wrap(args, lastArgumentIndex, originalCb => {
|
|
90
86
|
return function () {
|
|
91
|
-
|
|
87
|
+
finishCh.publish(ctx)
|
|
92
88
|
|
|
93
89
|
return originalCb.apply(this, arguments)
|
|
94
90
|
}
|
|
@@ -98,13 +94,13 @@ addHook({
|
|
|
98
94
|
}
|
|
99
95
|
}
|
|
100
96
|
|
|
101
|
-
|
|
97
|
+
const ctx = {
|
|
98
|
+
filters,
|
|
99
|
+
methodName
|
|
100
|
+
}
|
|
102
101
|
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
filters,
|
|
106
|
-
methodName
|
|
107
|
-
})
|
|
102
|
+
return startCh.runStores(ctx, () => {
|
|
103
|
+
wrapCallbackIfExist(arguments, ctx)
|
|
108
104
|
|
|
109
105
|
const res = method.apply(this, arguments)
|
|
110
106
|
|
|
@@ -113,7 +109,7 @@ addHook({
|
|
|
113
109
|
shimmer.wrap(res, 'exec', originalExec => {
|
|
114
110
|
return function wrappedExec () {
|
|
115
111
|
if (!callbackWrapped) {
|
|
116
|
-
wrapCallbackIfExist(arguments)
|
|
112
|
+
wrapCallbackIfExist(arguments, ctx)
|
|
117
113
|
}
|
|
118
114
|
|
|
119
115
|
const execResult = originalExec.apply(this, arguments)
|
|
@@ -129,7 +125,7 @@ addHook({
|
|
|
129
125
|
const reject = arguments[1]
|
|
130
126
|
|
|
131
127
|
arguments[0] = shimmer.wrapFunction(resolve, resolve => function wrappedResolve () {
|
|
132
|
-
|
|
128
|
+
finishCh.publish(ctx)
|
|
133
129
|
|
|
134
130
|
if (resolve) {
|
|
135
131
|
return resolve.apply(this, arguments)
|
|
@@ -137,7 +133,7 @@ addHook({
|
|
|
137
133
|
})
|
|
138
134
|
|
|
139
135
|
arguments[1] = shimmer.wrapFunction(reject, reject => function wrappedReject () {
|
|
140
|
-
|
|
136
|
+
finishCh.publish(ctx)
|
|
141
137
|
|
|
142
138
|
if (reject) {
|
|
143
139
|
return reject.apply(this, arguments)
|
|
@@ -151,7 +151,6 @@ addHook({ name: 'openai', file: 'dist/api.js', versions: ['>=3.0.0 <4'] }, expor
|
|
|
151
151
|
methodName,
|
|
152
152
|
args: arguments,
|
|
153
153
|
basePath: this.basePath,
|
|
154
|
-
apiKey: this.configuration.apiKey
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
return ch.tracePromise(fn, ctx, this, ...arguments)
|
|
@@ -224,7 +223,6 @@ for (const extension of extensions) {
|
|
|
224
223
|
methodName: `${baseResource}.${methodName}`,
|
|
225
224
|
args: arguments,
|
|
226
225
|
basePath: client.baseURL,
|
|
227
|
-
apiKey: client.apiKey
|
|
228
226
|
}
|
|
229
227
|
|
|
230
228
|
return ch.start.runStores(ctx, () => {
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const {
|
|
4
4
|
channel,
|
|
5
|
-
addHook
|
|
6
|
-
AsyncResource
|
|
5
|
+
addHook
|
|
7
6
|
} = require('./helpers/instrument')
|
|
8
7
|
const shimmer = require('../../datadog-shimmer')
|
|
9
8
|
|
|
@@ -14,11 +13,11 @@ const startChannel = channel('apm:oracledb:query:start')
|
|
|
14
13
|
const errorChannel = channel('apm:oracledb:query:error')
|
|
15
14
|
const finishChannel = channel('apm:oracledb:query:finish')
|
|
16
15
|
|
|
17
|
-
function finish (
|
|
18
|
-
if (
|
|
19
|
-
errorChannel.publish(
|
|
16
|
+
function finish (ctx) {
|
|
17
|
+
if (ctx.error) {
|
|
18
|
+
errorChannel.publish(ctx)
|
|
20
19
|
}
|
|
21
|
-
finishChannel.publish()
|
|
20
|
+
finishChannel.publish(ctx)
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
addHook({ name: 'oracledb', versions: ['>=5'] }, oracledb => {
|
|
@@ -30,49 +29,55 @@ addHook({ name: 'oracledb', versions: ['>=5'] }, oracledb => {
|
|
|
30
29
|
|
|
31
30
|
if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {
|
|
32
31
|
const cb = arguments[arguments.length - 1]
|
|
33
|
-
const outerAr = new AsyncResource('apm:oracledb:outer-scope')
|
|
34
32
|
arguments[arguments.length - 1] = shimmer.wrapFunction(cb, cb => function wrappedCb (err, result) {
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
if (err) {
|
|
34
|
+
ctx.error = err
|
|
35
|
+
errorChannel.publish(ctx)
|
|
36
|
+
}
|
|
37
|
+
return finishChannel.runStores(ctx, () => {
|
|
38
|
+
return cb.apply(this, arguments)
|
|
39
|
+
})
|
|
37
40
|
})
|
|
38
41
|
}
|
|
39
42
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const connAttrs = connectionAttributes.get(this)
|
|
43
|
+
// The connAttrs are used to pass through the argument to the potential
|
|
44
|
+
// serviceName method a user might have passed through as well as parsing
|
|
45
|
+
// the connection string in v5.
|
|
46
|
+
const connAttrs = connectionAttributes.get(this)
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
const details = typeof this.hostName === 'string' ? this : this._impl
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
let hostname
|
|
51
|
+
let port
|
|
52
|
+
let dbInstance
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
if (details) {
|
|
55
|
+
dbInstance = details.serviceName
|
|
56
|
+
hostname = details.hostName ?? details.nscon?.ntAdapter?.hostName
|
|
57
|
+
port = String(details.port ?? details.nscon?.ntAdapter?.port ?? '')
|
|
58
|
+
}
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
const ctx = {
|
|
61
|
+
dbInstance,
|
|
62
|
+
port,
|
|
63
|
+
hostname,
|
|
64
|
+
query: dbQuery,
|
|
65
|
+
connAttrs
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return startChannel.runStores(ctx, () => {
|
|
65
69
|
try {
|
|
66
70
|
let result = execute.apply(this, arguments)
|
|
67
71
|
|
|
68
72
|
if (typeof result?.then === 'function') {
|
|
69
73
|
result = result.then(
|
|
70
74
|
x => {
|
|
71
|
-
finish()
|
|
75
|
+
finish(ctx)
|
|
72
76
|
return x
|
|
73
77
|
},
|
|
74
78
|
e => {
|
|
75
|
-
|
|
79
|
+
ctx.error = e
|
|
80
|
+
finish(ctx)
|
|
76
81
|
throw e
|
|
77
82
|
}
|
|
78
83
|
)
|
|
@@ -80,7 +85,8 @@ addHook({ name: 'oracledb', versions: ['>=5'] }, oracledb => {
|
|
|
80
85
|
|
|
81
86
|
return result
|
|
82
87
|
} catch (err) {
|
|
83
|
-
|
|
88
|
+
ctx.error = err
|
|
89
|
+
finish(ctx)
|
|
84
90
|
throw err
|
|
85
91
|
}
|
|
86
92
|
})
|
|
@@ -146,7 +146,7 @@ function createWrapRouterMethod (name) {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
if (routeAddedChannel.hasSubscribers) {
|
|
149
|
-
routeAddedChannel.publish({ topOfStackFunc: methodWithTrace, layer: this.stack
|
|
149
|
+
routeAddedChannel.publish({ topOfStackFunc: methodWithTrace, layer: this.stack.at(-1) })
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
if (this.stack.length > offset) {
|
|
@@ -6,16 +6,12 @@ const DatabasePlugin = require('../../dd-trace/src/plugins/database')
|
|
|
6
6
|
const AEROSPIKE_PEER_SERVICE = 'aerospike.namespace'
|
|
7
7
|
|
|
8
8
|
class AerospikePlugin extends DatabasePlugin {
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
12
|
-
static
|
|
13
|
-
return 'tracing:apm:aerospike:command'
|
|
14
|
-
}
|
|
9
|
+
static id = 'aerospike'
|
|
10
|
+
static operation = 'command'
|
|
11
|
+
static system = 'aerospike'
|
|
12
|
+
static prefix = 'tracing:apm:aerospike:command'
|
|
15
13
|
|
|
16
|
-
static
|
|
17
|
-
return [AEROSPIKE_PEER_SERVICE]
|
|
18
|
-
}
|
|
14
|
+
static peerServicePrecursors = [AEROSPIKE_PEER_SERVICE]
|
|
19
15
|
|
|
20
16
|
bindStart (ctx) {
|
|
21
17
|
const { commandName, commandArgs } = ctx
|
|
@@ -4,8 +4,8 @@ const ConsumerPlugin = require('../../dd-trace/src/plugins/consumer')
|
|
|
4
4
|
const { getAddress, getShortName } = require('./util')
|
|
5
5
|
|
|
6
6
|
class Amqp10ConsumerPlugin extends ConsumerPlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
7
|
+
static id = 'amqp10'
|
|
8
|
+
static system = 'amqp'
|
|
9
9
|
|
|
10
10
|
bindStart (ctx) {
|
|
11
11
|
const { link } = ctx
|
|
@@ -5,7 +5,7 @@ const ConsumerPlugin = require('./consumer')
|
|
|
5
5
|
const CompositePlugin = require('../../dd-trace/src/plugins/composite')
|
|
6
6
|
|
|
7
7
|
class Amqp10Plugin extends CompositePlugin {
|
|
8
|
-
static
|
|
8
|
+
static id = 'amqp10'
|
|
9
9
|
static get plugins () {
|
|
10
10
|
return {
|
|
11
11
|
producer: ProducerPlugin,
|
|
@@ -5,9 +5,9 @@ const { CLIENT_PORT_KEY } = require('../../dd-trace/src/constants')
|
|
|
5
5
|
const { getAddress, getShortName } = require('./util')
|
|
6
6
|
|
|
7
7
|
class Amqp10ProducerPlugin extends ProducerPlugin {
|
|
8
|
-
static
|
|
9
|
-
static
|
|
10
|
-
static
|
|
8
|
+
static id = 'amqp10'
|
|
9
|
+
static operation = 'send'
|
|
10
|
+
static system = 'amqp'
|
|
11
11
|
|
|
12
12
|
bindStart (ctx) {
|
|
13
13
|
const { link } = ctx
|
|
@@ -6,9 +6,9 @@ const ClientPlugin = require('../../dd-trace/src/plugins/client')
|
|
|
6
6
|
const { getResourceName } = require('./util')
|
|
7
7
|
|
|
8
8
|
class AmqplibClientPlugin extends ClientPlugin {
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
9
|
+
static id = 'amqplib'
|
|
10
|
+
static type = 'messaging'
|
|
11
|
+
static operation = 'command'
|
|
12
12
|
|
|
13
13
|
bindStart (ctx) {
|
|
14
14
|
const { channel = {}, method, fields } = ctx
|
|
@@ -6,8 +6,8 @@ const { getAmqpMessageSize } = require('../../dd-trace/src/datastreams')
|
|
|
6
6
|
const { getResourceName } = require('./util')
|
|
7
7
|
|
|
8
8
|
class AmqplibConsumerPlugin extends ConsumerPlugin {
|
|
9
|
-
static
|
|
10
|
-
static
|
|
9
|
+
static id = 'amqplib'
|
|
10
|
+
static operation = 'consume'
|
|
11
11
|
|
|
12
12
|
bindStart (ctx) {
|
|
13
13
|
const { method, fields, message, queue } = ctx
|
|
@@ -7,7 +7,7 @@ const CompositePlugin = require('../../dd-trace/src/plugins/composite')
|
|
|
7
7
|
|
|
8
8
|
// TODO: Consider splitting channels for publish/receive in the instrumentation.
|
|
9
9
|
class AmqplibPlugin extends CompositePlugin {
|
|
10
|
-
static
|
|
10
|
+
static id = 'amqplib'
|
|
11
11
|
static get plugins () {
|
|
12
12
|
return {
|
|
13
13
|
producer: ProducerPlugin,
|
|
@@ -7,8 +7,8 @@ const { DsmPathwayCodec, getAmqpMessageSize } = require('../../dd-trace/src/data
|
|
|
7
7
|
const { getResourceName } = require('./util')
|
|
8
8
|
|
|
9
9
|
class AmqplibProducerPlugin extends ProducerPlugin {
|
|
10
|
-
static
|
|
11
|
-
static
|
|
10
|
+
static id = 'amqplib'
|
|
11
|
+
static operation = 'publish'
|
|
12
12
|
|
|
13
13
|
bindStart (ctx) {
|
|
14
14
|
const { channel = {}, method, fields, message } = ctx
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
const ApolloBasePlugin = require('../../../dd-trace/src/plugins/apollo')
|
|
4
4
|
|
|
5
5
|
class ApolloGatewayExecutePlugin extends ApolloBasePlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
8
|
-
return 'tracing:apm:apollo:gateway:execute'
|
|
9
|
-
}
|
|
6
|
+
static operation = 'execute'
|
|
7
|
+
static prefix = 'tracing:apm:apollo:gateway:execute'
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
module.exports = ApolloGatewayExecutePlugin
|
|
@@ -4,10 +4,8 @@ const { storage } = require('../../../datadog-core')
|
|
|
4
4
|
const ApolloBasePlugin = require('../../../dd-trace/src/plugins/apollo')
|
|
5
5
|
|
|
6
6
|
class ApolloGatewayFetchPlugin extends ApolloBasePlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
9
|
-
return 'tracing:apm:apollo:gateway:fetch'
|
|
10
|
-
}
|
|
7
|
+
static operation = 'fetch'
|
|
8
|
+
static prefix = 'tracing:apm:apollo:gateway:fetch'
|
|
11
9
|
|
|
12
10
|
bindStart (ctx) {
|
|
13
11
|
const store = storage('legacy').getStore()
|
|
@@ -10,7 +10,7 @@ const ApolloGatewayValidatePlugin = require('./validate')
|
|
|
10
10
|
const ApolloGatewayFetchPlugin = require('./fetch')
|
|
11
11
|
|
|
12
12
|
class ApolloGatewayPlugin extends CompositePlugin {
|
|
13
|
-
static
|
|
13
|
+
static id = 'gateway'
|
|
14
14
|
static get plugins () {
|
|
15
15
|
return {
|
|
16
16
|
execute: ApolloGatewayExecutePlugin,
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
const ApolloBasePlugin = require('../../../dd-trace/src/plugins/apollo')
|
|
4
4
|
|
|
5
5
|
class ApolloGatewayPlanPlugin extends ApolloBasePlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
8
|
-
return 'tracing:apm:apollo:gateway:plan'
|
|
9
|
-
}
|
|
6
|
+
static operation = 'plan'
|
|
7
|
+
static prefix = 'tracing:apm:apollo:gateway:plan'
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
module.exports = ApolloGatewayPlanPlugin
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
const ApolloBasePlugin = require('../../../dd-trace/src/plugins/apollo')
|
|
4
4
|
|
|
5
5
|
class ApolloGatewayPostProcessingPlugin extends ApolloBasePlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
8
|
-
return 'tracing:apm:apollo:gateway:postprocessing'
|
|
9
|
-
}
|
|
6
|
+
static operation = 'postprocessing'
|
|
7
|
+
static prefix = 'tracing:apm:apollo:gateway:postprocessing'
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
module.exports = ApolloGatewayPostProcessingPlugin
|
|
@@ -9,10 +9,8 @@ const OPERATION_DEFINITION = 'OperationDefinition'
|
|
|
9
9
|
const FRAGMENT_DEFINITION = 'FragmentDefinition'
|
|
10
10
|
|
|
11
11
|
class ApolloGatewayRequestPlugin extends ApolloBasePlugin {
|
|
12
|
-
static
|
|
13
|
-
static
|
|
14
|
-
return 'tracing:apm:apollo:gateway:request'
|
|
15
|
-
}
|
|
12
|
+
static operation = 'request'
|
|
13
|
+
static prefix = 'tracing:apm:apollo:gateway:request'
|
|
16
14
|
|
|
17
15
|
bindStart (ctx) {
|
|
18
16
|
const store = storage('legacy').getStore()
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
const ApolloBasePlugin = require('../../../dd-trace/src/plugins/apollo')
|
|
4
4
|
|
|
5
5
|
class ApolloGatewayValidatePlugin extends ApolloBasePlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
8
|
-
return 'tracing:apm:apollo:gateway:validate'
|
|
9
|
-
}
|
|
6
|
+
static operation = 'validate'
|
|
7
|
+
static prefix = 'tracing:apm:apollo:gateway:validate'
|
|
10
8
|
|
|
11
9
|
end (ctx) {
|
|
12
10
|
const result = ctx.result
|
|
@@ -4,7 +4,7 @@ const CompositePlugin = require('../../dd-trace/src/plugins/composite')
|
|
|
4
4
|
const ApolloGatewayPlugin = require('./gateway')
|
|
5
5
|
|
|
6
6
|
class ApolloPlugin extends CompositePlugin {
|
|
7
|
-
static
|
|
7
|
+
static id = 'apollo'
|
|
8
8
|
static get plugins () {
|
|
9
9
|
return {
|
|
10
10
|
gateway: ApolloGatewayPlugin
|
|
@@ -4,8 +4,8 @@ const SchemaPlugin = require('../../dd-trace/src/plugins/schema')
|
|
|
4
4
|
const SchemaExtractor = require('./schema_iterator')
|
|
5
5
|
|
|
6
6
|
class AvscPlugin extends SchemaPlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
7
|
+
static id = 'avsc'
|
|
8
|
+
static schemaExtractor = SchemaExtractor
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
module.exports = AvscPlugin
|