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
|
@@ -4,9 +4,7 @@ const RouterPlugin = require('../../datadog-plugin-router/src')
|
|
|
4
4
|
const web = require('../../dd-trace/src/plugins/util/web')
|
|
5
5
|
|
|
6
6
|
class HonoPlugin extends RouterPlugin {
|
|
7
|
-
static
|
|
8
|
-
return 'hono'
|
|
9
|
-
}
|
|
7
|
+
static id = 'hono'
|
|
10
8
|
|
|
11
9
|
constructor (...args) {
|
|
12
10
|
super(...args)
|
|
@@ -16,8 +16,8 @@ const HTTP_REQUEST_HEADERS = tags.HTTP_REQUEST_HEADERS
|
|
|
16
16
|
const HTTP_RESPONSE_HEADERS = tags.HTTP_RESPONSE_HEADERS
|
|
17
17
|
|
|
18
18
|
class HttpClientPlugin extends ClientPlugin {
|
|
19
|
-
static
|
|
20
|
-
static
|
|
19
|
+
static id = 'http'
|
|
20
|
+
static prefix = 'apm:http:client:request'
|
|
21
21
|
|
|
22
22
|
bindStart (message) {
|
|
23
23
|
const { args, http = {} } = message
|
|
@@ -5,7 +5,7 @@ const HttpClientPlugin = require('./client')
|
|
|
5
5
|
const CompositePlugin = require('../../dd-trace/src/plugins/composite')
|
|
6
6
|
|
|
7
7
|
class HttpPlugin extends CompositePlugin {
|
|
8
|
-
static
|
|
8
|
+
static id = 'http'
|
|
9
9
|
static get plugins () {
|
|
10
10
|
return {
|
|
11
11
|
server: HttpServerPlugin,
|
|
@@ -7,9 +7,9 @@ const { incomingHttpRequestStart, incomingHttpRequestEnd } = require('../../dd-t
|
|
|
7
7
|
const { COMPONENT } = require('../../dd-trace/src/constants')
|
|
8
8
|
|
|
9
9
|
class HttpServerPlugin extends ServerPlugin {
|
|
10
|
-
static
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
static id = 'http'
|
|
11
|
+
|
|
12
|
+
static prefix = 'apm:http:server:request'
|
|
13
13
|
|
|
14
14
|
constructor (...args) {
|
|
15
15
|
super(...args)
|
|
@@ -17,10 +17,6 @@ class HttpServerPlugin extends ServerPlugin {
|
|
|
17
17
|
this.addTraceSub('exit', message => this.exit(message))
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
addTraceSub (eventName, handler) {
|
|
21
|
-
this.addSub(`apm:${this.constructor.id}:server:${this.operation}:${eventName}`, handler)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
20
|
start ({ req, res, abortController }) {
|
|
25
21
|
const store = storage('legacy').getStore()
|
|
26
22
|
const span = web.startSpan(
|
|
@@ -24,8 +24,8 @@ const HTTP2_HEADER_STATUS = ':status'
|
|
|
24
24
|
const HTTP2_METHOD_GET = 'GET'
|
|
25
25
|
|
|
26
26
|
class Http2ClientPlugin extends ClientPlugin {
|
|
27
|
-
static
|
|
28
|
-
static
|
|
27
|
+
static id = 'http2'
|
|
28
|
+
static prefix = 'apm:http2:client:request'
|
|
29
29
|
|
|
30
30
|
bindStart (message) {
|
|
31
31
|
const { authority, options, headers = {} } = message
|
|
@@ -5,7 +5,7 @@ const Http2ClientPlugin = require('./client')
|
|
|
5
5
|
const CompositePlugin = require('../../dd-trace/src/plugins/composite')
|
|
6
6
|
|
|
7
7
|
class Http2Plugin extends CompositePlugin {
|
|
8
|
-
static
|
|
8
|
+
static id = 'http2'
|
|
9
9
|
static get plugins () {
|
|
10
10
|
return {
|
|
11
11
|
server: Http2ServerPlugin,
|
|
@@ -3,21 +3,22 @@
|
|
|
3
3
|
// Plugin temporarily disabled. See https://github.com/DataDog/dd-trace-js/issues/312
|
|
4
4
|
|
|
5
5
|
const ServerPlugin = require('../../dd-trace/src/plugins/server')
|
|
6
|
-
const { storage } = require('../../datadog-core')
|
|
7
6
|
const web = require('../../dd-trace/src/plugins/util/web')
|
|
8
7
|
const { COMPONENT } = require('../../dd-trace/src/constants')
|
|
9
8
|
|
|
10
9
|
class Http2ServerPlugin extends ServerPlugin {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
constructor (tracer, config) {
|
|
11
|
+
super(tracer, config)
|
|
12
|
+
this.addBind('apm:http2:server:response:emit', this.bindEmit)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
static id = 'http2'
|
|
16
|
+
|
|
17
|
+
static prefix = 'apm:http2:server:request'
|
|
18
|
+
|
|
19
|
+
bindStart (ctx) {
|
|
20
|
+
const { req, res } = ctx
|
|
18
21
|
|
|
19
|
-
start ({ req, res }) {
|
|
20
|
-
const store = storage('legacy').getStore()
|
|
21
22
|
const span = web.startSpan(
|
|
22
23
|
this.tracer,
|
|
23
24
|
{
|
|
@@ -26,13 +27,15 @@ class Http2ServerPlugin extends ServerPlugin {
|
|
|
26
27
|
},
|
|
27
28
|
req,
|
|
28
29
|
res,
|
|
29
|
-
this.operationName()
|
|
30
|
+
this.operationName(),
|
|
31
|
+
ctx
|
|
30
32
|
)
|
|
31
33
|
|
|
32
34
|
span.setTag(COMPONENT, this.constructor.id)
|
|
33
35
|
span._integrationName = this.constructor.id
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
ctx.currentStore.req = req
|
|
38
|
+
ctx.currentStore.res = res
|
|
36
39
|
|
|
37
40
|
const context = web.getContext(req)
|
|
38
41
|
|
|
@@ -40,14 +43,22 @@ class Http2ServerPlugin extends ServerPlugin {
|
|
|
40
43
|
context.res.writeHead = web.wrapWriteHead(context)
|
|
41
44
|
context.instrumented = true
|
|
42
45
|
}
|
|
46
|
+
|
|
47
|
+
return ctx.currentStore
|
|
43
48
|
}
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
bindEmit (ctx) {
|
|
51
|
+
if (ctx.eventName !== 'close') return ctx.currentStore
|
|
52
|
+
|
|
53
|
+
const { req } = ctx
|
|
54
|
+
|
|
46
55
|
const context = web.getContext(req)
|
|
47
56
|
|
|
48
57
|
if (!context || !context.res) return // Not created by a http.Server instance.
|
|
49
58
|
|
|
50
59
|
web.finishAll(context)
|
|
60
|
+
|
|
61
|
+
return ctx.currentStore
|
|
51
62
|
}
|
|
52
63
|
|
|
53
64
|
error (error) {
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
const RedisPlugin = require('../../datadog-plugin-redis/src')
|
|
4
4
|
|
|
5
5
|
class IOValkeyPlugin extends RedisPlugin {
|
|
6
|
-
static
|
|
7
|
-
return 'iovalkey'
|
|
8
|
-
}
|
|
6
|
+
static id = 'iovalkey'
|
|
9
7
|
|
|
10
|
-
static
|
|
8
|
+
static system = 'valkey'
|
|
11
9
|
|
|
12
10
|
constructor (...args) {
|
|
13
11
|
super(...args)
|
|
@@ -67,9 +67,7 @@ function withTimeout (promise, timeoutMs) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
class JestPlugin extends CiPlugin {
|
|
70
|
-
static
|
|
71
|
-
return 'jest'
|
|
72
|
-
}
|
|
70
|
+
static id = 'jest'
|
|
73
71
|
|
|
74
72
|
// The lists are the same for every test suite, so we can cache them
|
|
75
73
|
getUnskippableSuites (unskippableSuitesList) {
|
|
@@ -5,8 +5,8 @@ const { getMessageSize } = require('../../dd-trace/src/datastreams')
|
|
|
5
5
|
const { convertToTextMap } = require('./utils')
|
|
6
6
|
|
|
7
7
|
class KafkajsBatchConsumerPlugin extends ConsumerPlugin {
|
|
8
|
-
static
|
|
9
|
-
static
|
|
8
|
+
static id = 'kafkajs'
|
|
9
|
+
static operation = 'consume-batch'
|
|
10
10
|
|
|
11
11
|
start (ctx) {
|
|
12
12
|
const { topic, messages, groupId, clusterId } = ctx.extractedArgs || ctx
|
|
@@ -10,8 +10,8 @@ const beforeFinishCh = dc.channel('dd-trace:kafkajs:consumer:beforeFinish')
|
|
|
10
10
|
const MESSAGING_DESTINATION_KEY = 'messaging.destination.name'
|
|
11
11
|
|
|
12
12
|
class KafkajsConsumerPlugin extends ConsumerPlugin {
|
|
13
|
-
static
|
|
14
|
-
static
|
|
13
|
+
static id = 'kafkajs'
|
|
14
|
+
static operation = 'consume'
|
|
15
15
|
|
|
16
16
|
constructor () {
|
|
17
17
|
super(...arguments)
|
|
@@ -6,7 +6,7 @@ const BatchConsumerPlugin = require('./batch-consumer')
|
|
|
6
6
|
const CompositePlugin = require('../../dd-trace/src/plugins/composite')
|
|
7
7
|
|
|
8
8
|
class KafkajsPlugin extends CompositePlugin {
|
|
9
|
-
static
|
|
9
|
+
static id = 'kafkajs'
|
|
10
10
|
static get plugins () {
|
|
11
11
|
return {
|
|
12
12
|
producer: ProducerPlugin,
|
|
@@ -7,9 +7,9 @@ const BOOTSTRAP_SERVERS_KEY = 'messaging.kafka.bootstrap.servers'
|
|
|
7
7
|
const MESSAGING_DESTINATION_KEY = 'messaging.destination.name'
|
|
8
8
|
|
|
9
9
|
class KafkajsProducerPlugin extends ProducerPlugin {
|
|
10
|
-
static
|
|
11
|
-
static
|
|
12
|
-
static
|
|
10
|
+
static id = 'kafkajs'
|
|
11
|
+
static operation = 'produce'
|
|
12
|
+
static peerServicePrecursors = [BOOTSTRAP_SERVERS_KEY]
|
|
13
13
|
|
|
14
14
|
constructor () {
|
|
15
15
|
super(...arguments)
|
|
@@ -4,9 +4,7 @@ const RouterPlugin = require('../../datadog-plugin-router/src')
|
|
|
4
4
|
const web = require('../../dd-trace/src/plugins/util/web')
|
|
5
5
|
|
|
6
6
|
class KoaPlugin extends RouterPlugin {
|
|
7
|
-
static
|
|
8
|
-
return 'koa'
|
|
9
|
-
}
|
|
7
|
+
static id = 'koa'
|
|
10
8
|
|
|
11
9
|
constructor (...args) {
|
|
12
10
|
super(...args)
|
|
@@ -19,8 +19,8 @@ for (const Plugin of langChainTracingPlugins) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
class LangChainPlugin extends CompositePlugin {
|
|
22
|
-
static
|
|
23
|
-
static
|
|
22
|
+
static id = 'langchain'
|
|
23
|
+
static plugins = plugins
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
module.exports = LangChainPlugin
|
|
@@ -13,9 +13,9 @@ const LangChainLanguageModelHandler = require('./handlers/language_models')
|
|
|
13
13
|
const LangChainEmbeddingHandler = require('./handlers/embedding')
|
|
14
14
|
|
|
15
15
|
class BaseLangChainTracingPlugin extends TracingPlugin {
|
|
16
|
-
static
|
|
17
|
-
static
|
|
18
|
-
static
|
|
16
|
+
static id = 'langchain'
|
|
17
|
+
static operation = 'invoke'
|
|
18
|
+
static system = 'langchain'
|
|
19
19
|
|
|
20
20
|
constructor () {
|
|
21
21
|
super(...arguments)
|
|
@@ -85,75 +85,57 @@ class BaseLangChainTracingPlugin extends TracingPlugin {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
class RunnableSequenceInvokePlugin extends BaseLangChainTracingPlugin {
|
|
88
|
-
static
|
|
89
|
-
static
|
|
90
|
-
static
|
|
91
|
-
return 'tracing:orchestrion:@langchain/core:RunnableSequence_invoke'
|
|
92
|
-
}
|
|
88
|
+
static id = 'langchain_rs_invoke'
|
|
89
|
+
static lcType = 'chain'
|
|
90
|
+
static prefix = 'tracing:orchestrion:@langchain/core:RunnableSequence_invoke'
|
|
93
91
|
}
|
|
94
92
|
|
|
95
93
|
class RunnableSequenceBatchPlugin extends BaseLangChainTracingPlugin {
|
|
96
|
-
static
|
|
97
|
-
static
|
|
98
|
-
static
|
|
99
|
-
return 'tracing:orchestrion:@langchain/core:RunnableSequence_batch'
|
|
100
|
-
}
|
|
94
|
+
static id = 'langchain_rs_batch'
|
|
95
|
+
static lcType = 'chain'
|
|
96
|
+
static prefix = 'tracing:orchestrion:@langchain/core:RunnableSequence_batch'
|
|
101
97
|
}
|
|
102
98
|
|
|
103
99
|
class BaseChatModelGeneratePlugin extends BaseLangChainTracingPlugin {
|
|
104
|
-
static
|
|
105
|
-
static
|
|
106
|
-
static
|
|
107
|
-
return 'tracing:orchestrion:@langchain/core:BaseChatModel_generate'
|
|
108
|
-
}
|
|
100
|
+
static id = 'langchain_chat_model_generate'
|
|
101
|
+
static lcType = 'chat_model'
|
|
102
|
+
static prefix = 'tracing:orchestrion:@langchain/core:BaseChatModel_generate'
|
|
109
103
|
}
|
|
110
104
|
|
|
111
105
|
class BaseLLMGeneratePlugin extends BaseLangChainTracingPlugin {
|
|
112
|
-
static
|
|
113
|
-
static
|
|
114
|
-
static
|
|
115
|
-
return 'tracing:orchestrion:@langchain/core:BaseLLM_generate'
|
|
116
|
-
}
|
|
106
|
+
static id = 'langchain_llm_generate'
|
|
107
|
+
static lcType = 'llm'
|
|
108
|
+
static prefix = 'tracing:orchestrion:@langchain/core:BaseLLM_generate'
|
|
117
109
|
}
|
|
118
110
|
|
|
119
111
|
class EmbeddingsEmbedQueryPlugin extends BaseLangChainTracingPlugin {
|
|
120
|
-
static
|
|
121
|
-
static
|
|
122
|
-
static
|
|
123
|
-
return 'tracing:apm:@langchain/core:Embeddings_embedQuery'
|
|
124
|
-
}
|
|
112
|
+
static id = 'langchain_embeddings_embed_query'
|
|
113
|
+
static lcType = 'embedding'
|
|
114
|
+
static prefix = 'tracing:apm:@langchain/core:Embeddings_embedQuery'
|
|
125
115
|
}
|
|
126
116
|
|
|
127
117
|
class EmbeddingsEmbedDocumentsPlugin extends BaseLangChainTracingPlugin {
|
|
128
|
-
static
|
|
129
|
-
static
|
|
130
|
-
static
|
|
131
|
-
return 'tracing:apm:@langchain/core:Embeddings_embedDocuments'
|
|
132
|
-
}
|
|
118
|
+
static id = 'langchain_embeddings_embed_documents'
|
|
119
|
+
static lcType = 'embedding'
|
|
120
|
+
static prefix = 'tracing:apm:@langchain/core:Embeddings_embedDocuments'
|
|
133
121
|
}
|
|
134
122
|
|
|
135
123
|
class ToolInvokePlugin extends BaseLangChainTracingPlugin {
|
|
136
|
-
static
|
|
137
|
-
static
|
|
138
|
-
static
|
|
139
|
-
return 'tracing:orchestrion:@langchain/core:Tool_invoke'
|
|
140
|
-
}
|
|
124
|
+
static id = 'langchain_tool_invoke'
|
|
125
|
+
static lcType = 'tool'
|
|
126
|
+
static prefix = 'tracing:orchestrion:@langchain/core:Tool_invoke'
|
|
141
127
|
}
|
|
142
128
|
|
|
143
129
|
class VectorStoreSimilaritySearchPlugin extends BaseLangChainTracingPlugin {
|
|
144
|
-
static
|
|
145
|
-
static
|
|
146
|
-
static
|
|
147
|
-
return 'tracing:orchestrion:@langchain/core:VectorStore_similaritySearch'
|
|
148
|
-
}
|
|
130
|
+
static id = 'langchain_vectorstore_similarity_search'
|
|
131
|
+
static lcType = 'similarity_search'
|
|
132
|
+
static prefix = 'tracing:orchestrion:@langchain/core:VectorStore_similaritySearch'
|
|
149
133
|
}
|
|
150
134
|
|
|
151
135
|
class VectorStoreSimilaritySearchWithScorePlugin extends BaseLangChainTracingPlugin {
|
|
152
|
-
static
|
|
153
|
-
static
|
|
154
|
-
static
|
|
155
|
-
return 'tracing:orchestrion:@langchain/core:VectorStore_similaritySearchWithScore'
|
|
156
|
-
}
|
|
136
|
+
static id = 'langchain_vectorstore_similarity_search_with_score'
|
|
137
|
+
static lcType = 'similarity_search'
|
|
138
|
+
static prefix = 'tracing:orchestrion:@langchain/core:VectorStore_similaritySearchWithScore'
|
|
157
139
|
}
|
|
158
140
|
|
|
159
141
|
module.exports = [
|
|
@@ -4,8 +4,8 @@ const { storage } = require('../../datadog-core')
|
|
|
4
4
|
const MySQLPlugin = require('../../datadog-plugin-mysql/src')
|
|
5
5
|
|
|
6
6
|
class MariadbPlugin extends MySQLPlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
7
|
+
static id = 'mariadb'
|
|
8
|
+
static system = 'mariadb'
|
|
9
9
|
|
|
10
10
|
constructor (...args) {
|
|
11
11
|
super(...args)
|
|
@@ -4,7 +4,7 @@ const { CLIENT_PORT_KEY } = require('../../dd-trace/src/constants')
|
|
|
4
4
|
const CachePlugin = require('../../dd-trace/src/plugins/cache')
|
|
5
5
|
|
|
6
6
|
class MemcachedPlugin extends CachePlugin {
|
|
7
|
-
static
|
|
7
|
+
static id = 'memcached'
|
|
8
8
|
|
|
9
9
|
bindStart (ctx) {
|
|
10
10
|
const { client, server, query } = ctx
|
|
@@ -4,9 +4,7 @@ const RouterPlugin = require('../../datadog-plugin-router/src')
|
|
|
4
4
|
const web = require('../../dd-trace/src/plugins/util/web')
|
|
5
5
|
|
|
6
6
|
class MicrogatewayCorePlugin extends RouterPlugin {
|
|
7
|
-
static
|
|
8
|
-
return 'microgateway-core'
|
|
9
|
-
}
|
|
7
|
+
static id = 'microgateway-core'
|
|
10
8
|
|
|
11
9
|
constructor (...args) {
|
|
12
10
|
super(...args)
|
|
@@ -19,7 +17,9 @@ class MicrogatewayCorePlugin extends RouterPlugin {
|
|
|
19
17
|
web.setRoute(req, route)
|
|
20
18
|
})
|
|
21
19
|
|
|
22
|
-
this.addSub('apm:microgateway-core:request:error',
|
|
20
|
+
this.addSub('apm:microgateway-core:request:error', ({ error }) => {
|
|
21
|
+
this.addError(error)
|
|
22
|
+
})
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -4,8 +4,8 @@ const ClientPlugin = require('../../dd-trace/src/plugins/client')
|
|
|
4
4
|
const { moleculerTags } = require('./util')
|
|
5
5
|
|
|
6
6
|
class MoleculerClientPlugin extends ClientPlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
7
|
+
static id = 'moleculer'
|
|
8
|
+
static operation = 'call'
|
|
9
9
|
|
|
10
10
|
bindStart (ctx) {
|
|
11
11
|
const { actionName, opts } = ctx
|
|
@@ -7,7 +7,7 @@ const MoleculerClientPlugin = require('./client')
|
|
|
7
7
|
const CompositePlugin = require('../../dd-trace/src/plugins/composite')
|
|
8
8
|
|
|
9
9
|
class MoleculerPlugin extends CompositePlugin {
|
|
10
|
-
static
|
|
10
|
+
static id = 'moleculer'
|
|
11
11
|
static get plugins () {
|
|
12
12
|
return {
|
|
13
13
|
server: MoleculerServerPlugin,
|
|
@@ -4,8 +4,8 @@ const ServerPlugin = require('../../dd-trace/src/plugins/server')
|
|
|
4
4
|
const { moleculerTags } = require('./util')
|
|
5
5
|
|
|
6
6
|
class MoleculerServerPlugin extends ServerPlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
7
|
+
static id = 'moleculer'
|
|
8
|
+
static operation = 'action'
|
|
9
9
|
|
|
10
10
|
bindStart (ctx) {
|
|
11
11
|
const { action, middlewareCtx, broker } = ctx
|
|
@@ -6,11 +6,11 @@ const coalesce = require('koalas')
|
|
|
6
6
|
const { getEnvironmentVariable } = require('../../dd-trace/src/config-helper')
|
|
7
7
|
|
|
8
8
|
class MongodbCorePlugin extends DatabasePlugin {
|
|
9
|
-
static
|
|
10
|
-
static
|
|
9
|
+
static id = 'mongodb-core'
|
|
10
|
+
static component = 'mongodb'
|
|
11
11
|
// avoid using db.name for peer.service since it includes the collection name
|
|
12
12
|
// should be removed if one day this will be fixed
|
|
13
|
-
static
|
|
13
|
+
static peerServicePrecursors = []
|
|
14
14
|
|
|
15
15
|
configure (config) {
|
|
16
16
|
super.configure(config)
|
|
@@ -24,7 +24,9 @@ class MongodbCorePlugin extends DatabasePlugin {
|
|
|
24
24
|
)
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
bindStart (ctx) {
|
|
28
|
+
const { ns, ops, options = {}, name } = ctx
|
|
29
|
+
|
|
28
30
|
// heartbeat commands can be disabled if this.config.heartbeatEnabled is false
|
|
29
31
|
if (!this.config.heartbeatEnabled && isHeartbeat(ops, this.config)) {
|
|
30
32
|
return
|
|
@@ -44,11 +46,13 @@ class MongodbCorePlugin extends DatabasePlugin {
|
|
|
44
46
|
'out.host': options.host,
|
|
45
47
|
'out.port': options.port
|
|
46
48
|
}
|
|
47
|
-
})
|
|
49
|
+
}, ctx)
|
|
48
50
|
const comment = this.injectDbmComment(span, ops.comment, service)
|
|
49
51
|
if (comment) {
|
|
50
52
|
ops.comment = comment
|
|
51
53
|
}
|
|
54
|
+
|
|
55
|
+
return ctx.currentStore
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
getPeerService (tags) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const DatabasePlugin = require('../../dd-trace/src/plugins/database')
|
|
4
|
+
const { storage } = require('../../datadog-core')
|
|
5
|
+
|
|
6
|
+
class MongoosePlugin extends DatabasePlugin {
|
|
7
|
+
static id = 'mongoose'
|
|
8
|
+
static operation = 'exec'
|
|
9
|
+
|
|
10
|
+
bindStart (ctx) {
|
|
11
|
+
ctx.parentStore = storage('legacy').getStore()
|
|
12
|
+
return ctx.parentStore
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
bindFinish (ctx) {
|
|
16
|
+
return ctx.parentStore
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = MongoosePlugin
|
|
@@ -5,8 +5,8 @@ const CLIENT_PORT_KEY = require('../../dd-trace/src/constants')
|
|
|
5
5
|
const DatabasePlugin = require('../../dd-trace/src/plugins/database')
|
|
6
6
|
|
|
7
7
|
class MySQLPlugin extends DatabasePlugin {
|
|
8
|
-
static
|
|
9
|
-
static
|
|
8
|
+
static id = 'mysql'
|
|
9
|
+
static system = 'mysql'
|
|
10
10
|
|
|
11
11
|
constructor () {
|
|
12
12
|
super(...arguments)
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const ClientPlugin = require('../../dd-trace/src/plugins/client')
|
|
4
4
|
|
|
5
5
|
class NetIPCPlugin extends ClientPlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
6
|
+
static id = 'net'
|
|
7
|
+
static operation = 'ipc'
|
|
8
8
|
|
|
9
9
|
bindStart (ctx) {
|
|
10
10
|
this.startSpan('ipc.connect', {
|
|
@@ -4,8 +4,8 @@ const { CLIENT_PORT_KEY } = require('../../dd-trace/src/constants')
|
|
|
4
4
|
const ClientPlugin = require('../../dd-trace/src/plugins/client')
|
|
5
5
|
|
|
6
6
|
class NetTCPPlugin extends ClientPlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
7
|
+
static id = 'net'
|
|
8
|
+
static operation = 'tcp'
|
|
9
9
|
|
|
10
10
|
constructor (...args) {
|
|
11
11
|
super(...args)
|
|
@@ -9,9 +9,7 @@ const web = require('../../dd-trace/src/plugins/util/web')
|
|
|
9
9
|
const errorPages = new Set(['/404', '/500', '/_error', '/_not-found', '/_not-found/page'])
|
|
10
10
|
|
|
11
11
|
class NextPlugin extends ServerPlugin {
|
|
12
|
-
static
|
|
13
|
-
return 'next'
|
|
14
|
-
}
|
|
12
|
+
static id = 'next'
|
|
15
13
|
|
|
16
14
|
constructor (...args) {
|
|
17
15
|
super(...args)
|
|
@@ -5,7 +5,7 @@ const OpenAiTracingPlugin = require('./tracing')
|
|
|
5
5
|
const OpenAiLLMObsPlugin = require('../../dd-trace/src/llmobs/plugins/openai')
|
|
6
6
|
|
|
7
7
|
class OpenAiPlugin extends CompositePlugin {
|
|
8
|
-
static
|
|
8
|
+
static id = 'openai'
|
|
9
9
|
static get plugins () {
|
|
10
10
|
return {
|
|
11
11
|
llmobs: OpenAiLLMObsPlugin,
|