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
|
@@ -9,8 +9,8 @@ const { tagsFromRequest, tagsFromResponse } = require('../../dd-trace/src/payloa
|
|
|
9
9
|
const { getEnvironmentVariable } = require('../../dd-trace/src/config-helper')
|
|
10
10
|
|
|
11
11
|
class BaseAwsSdkPlugin extends ClientPlugin {
|
|
12
|
-
static
|
|
13
|
-
static
|
|
12
|
+
static id = 'aws'
|
|
13
|
+
static isPayloadReporter = false
|
|
14
14
|
|
|
15
15
|
get serviceIdentifier () {
|
|
16
16
|
const id = this.constructor.id.toLowerCase()
|
|
@@ -34,17 +34,26 @@ class BaseAwsSdkPlugin extends ClientPlugin {
|
|
|
34
34
|
constructor (...args) {
|
|
35
35
|
super(...args)
|
|
36
36
|
|
|
37
|
-
this.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
this._parentMap = new WeakMap()
|
|
38
|
+
|
|
39
|
+
this.addBind(`apm:aws:request:start:${this.serviceIdentifier}`, (ctx) => {
|
|
40
|
+
const {
|
|
41
|
+
request,
|
|
42
|
+
operation,
|
|
43
|
+
awsRegion,
|
|
44
|
+
awsService
|
|
45
|
+
} = ctx
|
|
46
|
+
|
|
47
|
+
const parentStore = ctx.parentStore = storage('legacy').getStore()
|
|
48
|
+
const childOf = parentStore?.span
|
|
49
|
+
|
|
50
|
+
this._parentMap.set(request, parentStore)
|
|
51
|
+
|
|
43
52
|
if (!this.isEnabled(request)) {
|
|
44
|
-
return
|
|
53
|
+
return parentStore
|
|
45
54
|
}
|
|
46
|
-
|
|
47
|
-
const
|
|
55
|
+
|
|
56
|
+
const meta = {
|
|
48
57
|
'span.kind': 'client',
|
|
49
58
|
'service.name': this.serviceName(),
|
|
50
59
|
'aws.operation': operation,
|
|
@@ -54,18 +63,19 @@ class BaseAwsSdkPlugin extends ClientPlugin {
|
|
|
54
63
|
'aws.service': awsService,
|
|
55
64
|
component: 'aws-sdk'
|
|
56
65
|
}
|
|
57
|
-
if (this.requestTags) this.requestTags.set(request,
|
|
66
|
+
if (this.requestTags) this.requestTags.set(request, meta)
|
|
58
67
|
|
|
59
|
-
const span = this.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
})
|
|
68
|
+
const span = this.startSpan(this.operationFromRequest(request), {
|
|
69
|
+
childOf,
|
|
70
|
+
meta,
|
|
71
|
+
integrationName: 'aws-sdk'
|
|
72
|
+
}, ctx)
|
|
65
73
|
|
|
66
74
|
analyticsSampler.sample(span, this.config.measured)
|
|
67
75
|
|
|
68
|
-
|
|
76
|
+
storage('legacy').run(ctx.currentStore, () => {
|
|
77
|
+
this.requestInject(span, request)
|
|
78
|
+
})
|
|
69
79
|
|
|
70
80
|
if (this.constructor.isPayloadReporter && this.cloudTaggingConfig.requestsEnabled) {
|
|
71
81
|
const maxDepth = this.cloudTaggingConfig.maxDepth
|
|
@@ -73,12 +83,15 @@ class BaseAwsSdkPlugin extends ClientPlugin {
|
|
|
73
83
|
span.addTags(requestTags)
|
|
74
84
|
}
|
|
75
85
|
|
|
76
|
-
|
|
77
|
-
|
|
86
|
+
return ctx.currentStore
|
|
87
|
+
})
|
|
78
88
|
|
|
79
|
-
|
|
89
|
+
this.addSub(`apm:aws:request:start:${this.serviceIdentifier}`, (ctx) => {
|
|
80
90
|
if (!this._tracerConfig?._isInServerlessEnvironment()) return
|
|
81
91
|
|
|
92
|
+
const { awsRegion, awsService, currentStore, request } = ctx
|
|
93
|
+
const peerServerlessStorage = storage('peerServerless')
|
|
94
|
+
|
|
82
95
|
// Try to resolve the hostname immediately; if not possible, keep enough
|
|
83
96
|
// information so the region callback can resolve it later.
|
|
84
97
|
const hostname = getHostname({ awsParams: request.params, awsService }, awsRegion)
|
|
@@ -86,15 +99,15 @@ class BaseAwsSdkPlugin extends ClientPlugin {
|
|
|
86
99
|
peerServerlessStorage.enterWith(peerServerlessStore)
|
|
87
100
|
|
|
88
101
|
if (hostname) {
|
|
89
|
-
span.setTag('peer.service', hostname)
|
|
102
|
+
currentStore.span.setTag('peer.service', hostname)
|
|
90
103
|
peerServerlessStore.peerHostname = hostname
|
|
91
104
|
} else {
|
|
92
|
-
|
|
93
|
-
|
|
105
|
+
currentStore.awsParams = request.params
|
|
106
|
+
currentStore.awsService = awsService
|
|
94
107
|
}
|
|
95
108
|
})
|
|
96
109
|
|
|
97
|
-
this.addSub(`apm:aws:request:region:${this.serviceIdentifier}`, region => {
|
|
110
|
+
this.addSub(`apm:aws:request:region:${this.serviceIdentifier}`, ({ region }) => {
|
|
98
111
|
const store = storage('legacy').getStore()
|
|
99
112
|
if (!store) return
|
|
100
113
|
const { span } = store
|
|
@@ -114,24 +127,31 @@ class BaseAwsSdkPlugin extends ClientPlugin {
|
|
|
114
127
|
}
|
|
115
128
|
})
|
|
116
129
|
|
|
117
|
-
this.addSub(`apm:aws:request:complete:${this.serviceIdentifier}`,
|
|
118
|
-
const
|
|
119
|
-
if (!
|
|
120
|
-
const { span } =
|
|
130
|
+
this.addSub(`apm:aws:request:complete:${this.serviceIdentifier}`, ctx => {
|
|
131
|
+
const { response, cbExists = false, currentStore } = ctx
|
|
132
|
+
if (!currentStore) return
|
|
133
|
+
const { span } = currentStore
|
|
121
134
|
if (!span) return
|
|
122
|
-
// try to extract DSM context from response if no callback exists as extraction normally happens in CB
|
|
123
|
-
if (!cbExists && this.serviceIdentifier === 'sqs') {
|
|
124
|
-
const params = response.request.params
|
|
125
|
-
const operation = response.request.operation
|
|
126
|
-
this.responseExtractDSMContext(operation, params, response.data ?? response, span)
|
|
127
|
-
}
|
|
128
|
-
this.addResponseTags(span, response)
|
|
129
135
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
136
|
+
storage('legacy').run(currentStore, () => {
|
|
137
|
+
// try to extract DSM context from response if no callback exists as extraction normally happens in CB
|
|
138
|
+
if (!cbExists && this.serviceIdentifier === 'sqs') {
|
|
139
|
+
const params = response.request.params
|
|
140
|
+
const operation = response.request.operation
|
|
141
|
+
this.responseExtractDSMContext(operation, params, response.data ?? response, span)
|
|
142
|
+
}
|
|
143
|
+
this.addResponseTags(span, response)
|
|
144
|
+
|
|
145
|
+
if (this._tracerConfig?.trace?.aws?.addSpanPointers) {
|
|
146
|
+
this.addSpanPointers(span, response)
|
|
147
|
+
}
|
|
148
|
+
})
|
|
133
149
|
|
|
134
|
-
this.finish(
|
|
150
|
+
this.finish(ctx)
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
this.addBind(`apm:aws:response:start:${this.serviceIdentifier}`, ctx => {
|
|
154
|
+
return this._parentMap.get(ctx.request)
|
|
135
155
|
})
|
|
136
156
|
}
|
|
137
157
|
|
|
@@ -205,11 +225,15 @@ class BaseAwsSdkPlugin extends ClientPlugin {
|
|
|
205
225
|
// implemented by subclasses, or not
|
|
206
226
|
}
|
|
207
227
|
|
|
208
|
-
finish (
|
|
209
|
-
|
|
210
|
-
|
|
228
|
+
finish (ctx) {
|
|
229
|
+
const { currentStore, response } = ctx
|
|
230
|
+
const { span } = currentStore
|
|
231
|
+
const error = response?.error || ctx.error
|
|
232
|
+
|
|
233
|
+
if (error) {
|
|
234
|
+
span.setTag('error', error)
|
|
211
235
|
|
|
212
|
-
const requestId =
|
|
236
|
+
const requestId = error.RequestId || error.requestId
|
|
213
237
|
if (requestId) {
|
|
214
238
|
span.addTags({ 'aws.response.request_id': requestId })
|
|
215
239
|
}
|
|
@@ -219,7 +243,7 @@ class BaseAwsSdkPlugin extends ClientPlugin {
|
|
|
219
243
|
this.config.hooks.request(span, response)
|
|
220
244
|
}
|
|
221
245
|
|
|
222
|
-
super.finish()
|
|
246
|
+
super.finish(ctx)
|
|
223
247
|
}
|
|
224
248
|
|
|
225
249
|
configure (config) {
|
|
@@ -4,9 +4,7 @@ const CompositePlugin = require('../../../../dd-trace/src/plugins/composite')
|
|
|
4
4
|
const BedrockRuntimeTracing = require('./tracing')
|
|
5
5
|
const BedrockRuntimeLLMObsPlugin = require('../../../../dd-trace/src/llmobs/plugins/bedrockruntime')
|
|
6
6
|
class BedrockRuntimePlugin extends CompositePlugin {
|
|
7
|
-
static
|
|
8
|
-
return 'bedrockruntime'
|
|
9
|
-
}
|
|
7
|
+
static id = 'bedrockruntime'
|
|
10
8
|
|
|
11
9
|
static get plugins () {
|
|
12
10
|
return {
|
|
@@ -6,7 +6,7 @@ const { parseModelId } = require('./utils')
|
|
|
6
6
|
const enabledOperations = new Set(['invokeModel'])
|
|
7
7
|
|
|
8
8
|
class BedrockRuntime extends BaseAwsSdkPlugin {
|
|
9
|
-
static
|
|
9
|
+
static id = 'bedrockruntime'
|
|
10
10
|
|
|
11
11
|
isEnabled (request) {
|
|
12
12
|
const operation = request.operation
|
|
@@ -6,9 +6,9 @@ const { DYNAMODB_PTR_KIND, SPAN_POINTER_DIRECTION } = require('../../../dd-trace
|
|
|
6
6
|
const { extractPrimaryKeys, generatePointerHash } = require('../util')
|
|
7
7
|
|
|
8
8
|
class DynamoDb extends BaseAwsSdkPlugin {
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
9
|
+
static id = 'dynamodb'
|
|
10
|
+
static peerServicePrecursors = ['tablename']
|
|
11
|
+
static isPayloadReporter = true
|
|
12
12
|
|
|
13
13
|
generateTags (params, operation, response) {
|
|
14
14
|
const tags = {}
|
|
@@ -3,8 +3,8 @@ const log = require('../../../dd-trace/src/log')
|
|
|
3
3
|
const BaseAwsSdkPlugin = require('../base')
|
|
4
4
|
|
|
5
5
|
class EventBridge extends BaseAwsSdkPlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
6
|
+
static id = 'eventbridge'
|
|
7
|
+
static isPayloadReporter = true
|
|
8
8
|
|
|
9
9
|
generateTags (params, operation, response) {
|
|
10
10
|
if (!params?.source) return {}
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
const { DsmPathwayCodec, getSizeOrZero } = require('../../../dd-trace/src/datastreams')
|
|
3
3
|
const log = require('../../../dd-trace/src/log')
|
|
4
4
|
const BaseAwsSdkPlugin = require('../base')
|
|
5
|
-
const { storage } = require('../../../datadog-core')
|
|
6
5
|
|
|
7
6
|
class Kinesis extends BaseAwsSdkPlugin {
|
|
8
|
-
static
|
|
9
|
-
static
|
|
10
|
-
static
|
|
7
|
+
static id = 'kinesis'
|
|
8
|
+
static peerServicePrecursors = ['streamname']
|
|
9
|
+
static isPayloadReporter = true
|
|
11
10
|
|
|
12
11
|
constructor (...args) {
|
|
13
12
|
super(...args)
|
|
@@ -16,48 +15,50 @@ class Kinesis extends BaseAwsSdkPlugin {
|
|
|
16
15
|
// in the base class
|
|
17
16
|
this.requestTags = new WeakMap()
|
|
18
17
|
|
|
19
|
-
this.
|
|
20
|
-
const { request, response } =
|
|
21
|
-
const store = storage('legacy').getStore()
|
|
18
|
+
this.addBind('apm:aws:response:start:kinesis', ctx => {
|
|
19
|
+
const { request, response } = ctx
|
|
22
20
|
const plugin = this
|
|
23
21
|
|
|
22
|
+
let store = this._parentMap.get(request)
|
|
23
|
+
|
|
24
24
|
// if we have either of these operations, we want to store the streamName param
|
|
25
25
|
// since it is not typically available during get/put records requests
|
|
26
26
|
if (request.operation === 'getShardIterator' || request.operation === 'listShards') {
|
|
27
|
-
this.storeStreamName(request.params, request.operation, store)
|
|
28
|
-
return
|
|
27
|
+
return this.storeStreamName(request.params, request.operation, store)
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
if (request.operation === 'getRecords') {
|
|
32
31
|
let span
|
|
33
32
|
const responseExtraction = this.responseExtract(request.params, request.operation, response)
|
|
34
33
|
if (responseExtraction && responseExtraction.maybeChildOf) {
|
|
35
|
-
|
|
34
|
+
ctx.needsFinish = true
|
|
36
35
|
const options = {
|
|
37
36
|
childOf: responseExtraction.maybeChildOf,
|
|
38
|
-
|
|
37
|
+
meta: {
|
|
39
38
|
...this.requestTags.get(request),
|
|
40
39
|
'span.kind': 'server'
|
|
41
40
|
},
|
|
42
41
|
integrationName: 'aws-sdk'
|
|
43
42
|
}
|
|
44
|
-
span = plugin.
|
|
45
|
-
|
|
43
|
+
span = plugin.startSpan('aws.response', options, ctx)
|
|
44
|
+
store = ctx.currentStore
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
// get the stream name that should have been stored previously
|
|
49
|
-
const { streamName } =
|
|
48
|
+
const { streamName } = store
|
|
50
49
|
|
|
51
50
|
// extract DSM context after as we might not have a parent-child but may have a DSM context
|
|
52
51
|
this.responseExtractDSMContext(
|
|
53
52
|
request.operation, request.params, response, span || null, { streamName }
|
|
54
53
|
)
|
|
55
54
|
}
|
|
55
|
+
|
|
56
|
+
return store
|
|
56
57
|
})
|
|
57
58
|
|
|
58
|
-
this.addSub('apm:aws:response:finish:kinesis',
|
|
59
|
-
|
|
60
|
-
this.finish(
|
|
59
|
+
this.addSub('apm:aws:response:finish:kinesis', ctx => {
|
|
60
|
+
if (!ctx.needsFinish) return
|
|
61
|
+
this.finish(ctx)
|
|
61
62
|
})
|
|
62
63
|
}
|
|
63
64
|
|
|
@@ -72,11 +73,12 @@ class Kinesis extends BaseAwsSdkPlugin {
|
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
storeStreamName (params, operation, store) {
|
|
75
|
-
if (!operation
|
|
76
|
-
if (
|
|
76
|
+
if (!operation) return store
|
|
77
|
+
if (operation !== 'getShardIterator' && operation !== 'listShards') return store
|
|
78
|
+
if (!params || !params.StreamName) return store
|
|
77
79
|
|
|
78
80
|
const streamName = params.StreamName
|
|
79
|
-
|
|
81
|
+
return { ...store, streamName }
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
responseExtract (params, operation, response) {
|
|
@@ -4,7 +4,7 @@ const log = require('../../../dd-trace/src/log')
|
|
|
4
4
|
const BaseAwsSdkPlugin = require('../base')
|
|
5
5
|
|
|
6
6
|
class Lambda extends BaseAwsSdkPlugin {
|
|
7
|
-
static
|
|
7
|
+
static id = 'lambda'
|
|
8
8
|
|
|
9
9
|
generateTags (params, operation, response) {
|
|
10
10
|
if (!params?.FunctionName) return {}
|
|
@@ -6,9 +6,9 @@ const { generatePointerHash } = require('../util')
|
|
|
6
6
|
const { S3_PTR_KIND, SPAN_POINTER_DIRECTION } = require('../../../dd-trace/src/constants')
|
|
7
7
|
|
|
8
8
|
class S3 extends BaseAwsSdkPlugin {
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
9
|
+
static id = 's3'
|
|
10
|
+
static peerServicePrecursors = ['bucketname']
|
|
11
|
+
static isPayloadReporter = true
|
|
12
12
|
|
|
13
13
|
generateTags (params, operation, response) {
|
|
14
14
|
if (!params?.Bucket) return {}
|
|
@@ -4,9 +4,9 @@ const log = require('../../../dd-trace/src/log')
|
|
|
4
4
|
const BaseAwsSdkPlugin = require('../base')
|
|
5
5
|
|
|
6
6
|
class Sns extends BaseAwsSdkPlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
9
|
-
static
|
|
7
|
+
static id = 'sns'
|
|
8
|
+
static peerServicePrecursors = ['topicname']
|
|
9
|
+
static isPayloadReporter = true
|
|
10
10
|
|
|
11
11
|
generateTags (params, operation, response) {
|
|
12
12
|
if (!params) return {}
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
const log = require('../../../dd-trace/src/log')
|
|
4
4
|
const BaseAwsSdkPlugin = require('../base')
|
|
5
|
-
const { storage } = require('../../../datadog-core')
|
|
6
5
|
const { DsmPathwayCodec, getHeadersSize } = require('../../../dd-trace/src/datastreams')
|
|
7
6
|
|
|
8
7
|
class Sqs extends BaseAwsSdkPlugin {
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
8
|
+
static id = 'sqs'
|
|
9
|
+
static peerServicePrecursors = ['queuename']
|
|
10
|
+
static isPayloadReporter = true
|
|
12
11
|
|
|
13
12
|
constructor (...args) {
|
|
14
13
|
super(...args)
|
|
@@ -17,36 +16,39 @@ class Sqs extends BaseAwsSdkPlugin {
|
|
|
17
16
|
// in the base class
|
|
18
17
|
this.requestTags = new WeakMap()
|
|
19
18
|
|
|
20
|
-
this.
|
|
21
|
-
const { request, response } =
|
|
22
|
-
const store = storage('legacy').getStore()
|
|
19
|
+
this.addBind('apm:aws:response:start:sqs', ctx => {
|
|
20
|
+
const { request, response } = ctx
|
|
23
21
|
const contextExtraction = this.responseExtract(request.params, request.operation, response)
|
|
22
|
+
|
|
23
|
+
let store = this._parentMap.get(request)
|
|
24
24
|
let span
|
|
25
25
|
let parsedMessageAttributes = null
|
|
26
26
|
if (contextExtraction && contextExtraction.datadogContext) {
|
|
27
|
-
|
|
27
|
+
ctx.needsFinish = true
|
|
28
28
|
const options = {
|
|
29
29
|
childOf: contextExtraction.datadogContext,
|
|
30
|
-
|
|
30
|
+
meta: {
|
|
31
31
|
...this.requestTags.get(request),
|
|
32
32
|
'span.kind': 'server'
|
|
33
33
|
},
|
|
34
34
|
integrationName: 'aws-sdk'
|
|
35
35
|
}
|
|
36
36
|
parsedMessageAttributes = contextExtraction.parsedAttributes
|
|
37
|
-
span = this.
|
|
38
|
-
|
|
37
|
+
span = this.startSpan('aws.response', options, ctx)
|
|
38
|
+
store = ctx.currentStore
|
|
39
39
|
}
|
|
40
|
-
// extract DSM context after as we might not have a parent-child but may have a DSM context
|
|
41
40
|
|
|
41
|
+
// extract DSM context after as we might not have a parent-child but may have a DSM context
|
|
42
42
|
this.responseExtractDSMContext(
|
|
43
43
|
request.operation, request.params, response, span || null, { parsedAttributes: parsedMessageAttributes }
|
|
44
44
|
)
|
|
45
|
+
|
|
46
|
+
return store
|
|
45
47
|
})
|
|
46
48
|
|
|
47
|
-
this.addSub('apm:aws:response:finish:sqs',
|
|
48
|
-
|
|
49
|
-
this.finish(
|
|
49
|
+
this.addSub('apm:aws:response:finish:sqs', ctx => {
|
|
50
|
+
if (!ctx.needsFinish) return
|
|
51
|
+
this.finish(ctx)
|
|
50
52
|
})
|
|
51
53
|
}
|
|
52
54
|
|
|
@@ -3,7 +3,7 @@ const log = require('../../../dd-trace/src/log')
|
|
|
3
3
|
const BaseAwsSdkPlugin = require('../base')
|
|
4
4
|
|
|
5
5
|
class Stepfunctions extends BaseAwsSdkPlugin {
|
|
6
|
-
static
|
|
6
|
+
static id = 'stepfunctions'
|
|
7
7
|
|
|
8
8
|
// This is the shape of StartExecutionInput, as defined in
|
|
9
9
|
// https://github.com/aws/aws-sdk-js/blob/master/apis/states-2016-11-23.normal.json
|
|
@@ -16,11 +16,11 @@ const triggerMap = {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
class AzureFunctionsPlugin extends TracingPlugin {
|
|
19
|
-
static
|
|
20
|
-
static
|
|
21
|
-
static
|
|
22
|
-
static
|
|
23
|
-
static
|
|
19
|
+
static id = 'azure-functions'
|
|
20
|
+
static operation = 'invoke'
|
|
21
|
+
static kind = 'server'
|
|
22
|
+
static type = 'serverless'
|
|
23
|
+
static prefix = 'tracing:datadog:azure:functions:invoke'
|
|
24
24
|
|
|
25
25
|
bindStart (ctx) {
|
|
26
26
|
const childOf = extractTraceContext(this._tracer, ctx)
|
|
@@ -4,7 +4,7 @@ const ProducerPlugin = require('./producer')
|
|
|
4
4
|
const CompositePlugin = require('../../dd-trace/src/plugins/composite')
|
|
5
5
|
|
|
6
6
|
class AzureServiceBusPlugin extends CompositePlugin {
|
|
7
|
-
static
|
|
7
|
+
static id = 'azure-service-bus'
|
|
8
8
|
static get plugins () {
|
|
9
9
|
return {
|
|
10
10
|
producer: ProducerPlugin
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const ProducerPlugin = require('../../dd-trace/src/plugins/producer')
|
|
4
4
|
|
|
5
5
|
class AzureServiceBusProducerPlugin extends ProducerPlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
6
|
+
static id = 'azure-service-bus'
|
|
7
|
+
static operation = 'send'
|
|
8
8
|
|
|
9
9
|
bindStart (ctx) {
|
|
10
10
|
const { sender, msg } = ctx
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const LogPlugin = require('../../dd-trace/src/plugins/log_plugin')
|
|
4
4
|
|
|
5
|
-
class BunyanPlugin extends
|
|
6
|
-
static
|
|
7
|
-
return 'bunyan'
|
|
8
|
-
}
|
|
5
|
+
class BunyanPlugin extends LogPlugin {
|
|
6
|
+
static id = 'bunyan'
|
|
9
7
|
}
|
|
10
8
|
module.exports = BunyanPlugin
|
|
@@ -4,9 +4,9 @@ const DatabasePlugin = require('../../dd-trace/src/plugins/database')
|
|
|
4
4
|
const CASSANDRA_CONTACT_POINTS_KEY = 'db.cassandra.contact.points'
|
|
5
5
|
|
|
6
6
|
class CassandraDriverPlugin extends DatabasePlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
9
|
-
static
|
|
7
|
+
static id = 'cassandra-driver'
|
|
8
|
+
static system = 'cassandra'
|
|
9
|
+
static peerServicePrecursors = [CASSANDRA_CONTACT_POINTS_KEY]
|
|
10
10
|
|
|
11
11
|
bindStart (ctx) {
|
|
12
12
|
let { keyspace, query, contactPoints = {} } = ctx
|
|
@@ -28,8 +28,8 @@ function truncateCommand (cmdFields) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
class ChildProcessPlugin extends TracingPlugin {
|
|
31
|
-
static
|
|
32
|
-
static
|
|
31
|
+
static id = 'child_process'
|
|
32
|
+
static prefix = 'tracing:datadog:child_process:execution'
|
|
33
33
|
|
|
34
34
|
get tracer () {
|
|
35
35
|
return this._tracer
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
const KafkajsBatchConsumerPlugin = require('../../datadog-plugin-kafkajs/src/batch-consumer')
|
|
4
4
|
|
|
5
5
|
class ConfluentKafkaJsBatchConsumerPlugin extends KafkajsBatchConsumerPlugin {
|
|
6
|
-
static
|
|
7
|
-
return 'confluentinc-kafka-javascript'
|
|
8
|
-
}
|
|
6
|
+
static id = 'confluentinc-kafka-javascript'
|
|
9
7
|
}
|
|
10
8
|
|
|
11
9
|
module.exports = ConfluentKafkaJsBatchConsumerPlugin
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
const KafkajsConsumerPlugin = require('../../datadog-plugin-kafkajs/src/consumer')
|
|
4
4
|
|
|
5
5
|
class ConfluentKafkaJsConsumerPlugin extends KafkajsConsumerPlugin {
|
|
6
|
-
static
|
|
7
|
-
return 'confluentinc-kafka-javascript'
|
|
8
|
-
}
|
|
6
|
+
static id = 'confluentinc-kafka-javascript'
|
|
9
7
|
}
|
|
10
8
|
|
|
11
9
|
module.exports = ConfluentKafkaJsConsumerPlugin
|
|
@@ -6,7 +6,7 @@ const BatchConsumerPlugin = require('./batch-consumer')
|
|
|
6
6
|
const KafkajsPlugin = require('../../datadog-plugin-kafkajs/src/index')
|
|
7
7
|
|
|
8
8
|
class ConfluentKafkaJsPlugin extends KafkajsPlugin {
|
|
9
|
-
static
|
|
9
|
+
static id = 'confluentinc-kafka-javascript'
|
|
10
10
|
static get plugins () {
|
|
11
11
|
return {
|
|
12
12
|
producer: ProducerPlugin,
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
const KafkajsProducerPlugin = require('../../datadog-plugin-kafkajs/src/producer')
|
|
4
4
|
|
|
5
5
|
class ConfluentKafkaJsProducerPlugin extends KafkajsProducerPlugin {
|
|
6
|
-
static
|
|
7
|
-
return 'confluentinc-kafka-javascript'
|
|
8
|
-
}
|
|
6
|
+
static id = 'confluentinc-kafka-javascript'
|
|
9
7
|
}
|
|
10
8
|
|
|
11
9
|
module.exports = ConfluentKafkaJsProducerPlugin
|