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,8 +4,8 @@ const StoragePlugin = require('../../dd-trace/src/plugins/storage')
|
|
|
4
4
|
const { storage } = require('../../datadog-core')
|
|
5
5
|
|
|
6
6
|
class CouchBasePlugin extends StoragePlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
7
|
+
static id = 'couchbase'
|
|
8
|
+
static peerServicePrecursors = ['db.couchbase.seed.nodes']
|
|
9
9
|
|
|
10
10
|
addSubs (func, start) {
|
|
11
11
|
this.addSub(`apm:couchbase:${func}:start`, start)
|
|
@@ -5,9 +5,7 @@ const Plugin = require('../../dd-trace/src/plugins/plugin')
|
|
|
5
5
|
// Cypress plugin does not patch any library. This is just a placeholder to
|
|
6
6
|
// follow the structure of the plugins
|
|
7
7
|
class CypressPlugin extends Plugin {
|
|
8
|
-
static
|
|
9
|
-
return 'cypress'
|
|
10
|
-
}
|
|
8
|
+
static id = 'cypress'
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
module.exports = CypressPlugin
|
|
@@ -12,9 +12,7 @@ const injectionEnabledTag =
|
|
|
12
12
|
`injection_enabled:${getEnvironmentVariable('DD_INJECTION_ENABLED') ? 'yes' : 'no'}`
|
|
13
13
|
|
|
14
14
|
module.exports = class DdTraceApiPlugin extends Plugin {
|
|
15
|
-
static
|
|
16
|
-
return 'dd-trace-api'
|
|
17
|
-
}
|
|
15
|
+
static id = 'dd-trace-api'
|
|
18
16
|
|
|
19
17
|
constructor (...args) {
|
|
20
18
|
super(...args)
|
|
@@ -9,7 +9,7 @@ const DNSReversePlugin = require('./reverse')
|
|
|
9
9
|
// TODO: Are DNS spans really client spans?
|
|
10
10
|
|
|
11
11
|
class DNSPlugin extends CompositePlugin {
|
|
12
|
-
static
|
|
12
|
+
static id = 'dns'
|
|
13
13
|
static get plugins () {
|
|
14
14
|
return {
|
|
15
15
|
lookup: DNSLookupPlugin,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const ClientPlugin = require('../../dd-trace/src/plugins/client')
|
|
4
4
|
|
|
5
5
|
class DNSLookupPlugin extends ClientPlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
6
|
+
static id = 'dns'
|
|
7
|
+
static operation = 'lookup'
|
|
8
8
|
|
|
9
9
|
bindStart (ctx) {
|
|
10
10
|
const [hostname] = ctx.args
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const ClientPlugin = require('../../dd-trace/src/plugins/client')
|
|
4
4
|
|
|
5
5
|
class DNSLookupServicePlugin extends ClientPlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
6
|
+
static id = 'dns'
|
|
7
|
+
static operation = 'lookup_service'
|
|
8
8
|
|
|
9
9
|
bindStart (ctx) {
|
|
10
10
|
const [address, port] = ctx.args
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const ClientPlugin = require('../../dd-trace/src/plugins/client')
|
|
4
4
|
|
|
5
5
|
class DNSResolvePlugin extends ClientPlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
6
|
+
static id = 'dns'
|
|
7
|
+
static operation = 'resolve'
|
|
8
8
|
|
|
9
9
|
bindStart (ctx) {
|
|
10
10
|
const [hostname, maybeType] = ctx.args
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const ClientPlugin = require('../../dd-trace/src/plugins/client')
|
|
4
4
|
|
|
5
5
|
class DNSReversePlugin extends ClientPlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
6
|
+
static id = 'dns'
|
|
7
|
+
static operation = 'reverse'
|
|
8
8
|
|
|
9
9
|
bindStart (ctx) {
|
|
10
10
|
const [ip] = ctx.args
|
|
@@ -5,9 +5,7 @@ const Plugin = require('../../dd-trace/src/plugins/plugin')
|
|
|
5
5
|
const web = require('../../dd-trace/src/plugins/util/web')
|
|
6
6
|
|
|
7
7
|
class ExpressCodeOriginForSpansPlugin extends Plugin {
|
|
8
|
-
static
|
|
9
|
-
return 'express'
|
|
10
|
-
}
|
|
8
|
+
static id = 'express'
|
|
11
9
|
|
|
12
10
|
constructor (...args) {
|
|
13
11
|
super(...args)
|
|
@@ -5,7 +5,7 @@ const ExpressCodeOriginForSpansPlugin = require('./code_origin')
|
|
|
5
5
|
const CompositePlugin = require('../../dd-trace/src/plugins/composite')
|
|
6
6
|
|
|
7
7
|
class ExpressPlugin extends CompositePlugin {
|
|
8
|
-
static
|
|
8
|
+
static id = 'express'
|
|
9
9
|
static get plugins () {
|
|
10
10
|
return {
|
|
11
11
|
tracing: ExpressTracingPlugin,
|
|
@@ -7,9 +7,7 @@ const web = require('../../dd-trace/src/plugins/util/web')
|
|
|
7
7
|
const kCodeOriginForSpansTagsSym = Symbol('datadog.codeOriginForSpansTags')
|
|
8
8
|
|
|
9
9
|
class FastifyCodeOriginForSpansPlugin extends Plugin {
|
|
10
|
-
static
|
|
11
|
-
return 'fastify'
|
|
12
|
-
}
|
|
10
|
+
static id = 'fastify'
|
|
13
11
|
|
|
14
12
|
constructor (...args) {
|
|
15
13
|
super(...args)
|
|
@@ -5,7 +5,7 @@ const FastifyCodeOriginForSpansPlugin = require('./code_origin')
|
|
|
5
5
|
const CompositePlugin = require('../../dd-trace/src/plugins/composite')
|
|
6
6
|
|
|
7
7
|
class FastifyPlugin extends CompositePlugin {
|
|
8
|
-
static
|
|
8
|
+
static id = 'fastify'
|
|
9
9
|
static get plugins () {
|
|
10
10
|
return {
|
|
11
11
|
tracing: FastifyTracingPlugin,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const RouterPlugin = require('../../datadog-plugin-router/src')
|
|
4
|
+
const { storage } = require('../../datadog-core')
|
|
4
5
|
|
|
5
6
|
class FastifyTracingPlugin extends RouterPlugin {
|
|
6
|
-
static
|
|
7
|
-
return 'fastify'
|
|
8
|
-
}
|
|
7
|
+
static id = 'fastify'
|
|
9
8
|
|
|
10
9
|
constructor (...args) {
|
|
11
10
|
super(...args)
|
|
@@ -13,7 +12,23 @@ class FastifyTracingPlugin extends RouterPlugin {
|
|
|
13
12
|
this.addSub('apm:fastify:request:handle', ({ req }) => {
|
|
14
13
|
this.setFramework(req, 'fastify', this.config)
|
|
15
14
|
})
|
|
15
|
+
|
|
16
|
+
this.addBind('datadog:fastify:pre-parsing:start', getParentStore)
|
|
17
|
+
this.addBind('datadog:fastify:pre-validation:start', getParentStore)
|
|
18
|
+
|
|
19
|
+
this.addSub('datadog:fastify:pre-parsing:finish', (ctx) => {
|
|
20
|
+
return ctx.parentStore
|
|
21
|
+
})
|
|
22
|
+
this.addSub('datadog:fastify:pre-validation:finish', (ctx) => {
|
|
23
|
+
return ctx.parentStore
|
|
24
|
+
})
|
|
25
|
+
this.addSub('datadog:fastify:callback:execute', getParentStore)
|
|
16
26
|
}
|
|
17
27
|
}
|
|
18
28
|
|
|
29
|
+
function getParentStore (ctx) {
|
|
30
|
+
ctx.parentStore = ctx.parentStore ?? storage('legacy').getStore()
|
|
31
|
+
return ctx.parentStore
|
|
32
|
+
}
|
|
33
|
+
|
|
19
34
|
module.exports = FastifyTracingPlugin
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const HttpClientPlugin = require('../../datadog-plugin-http/src/client')
|
|
4
4
|
|
|
5
5
|
class FetchPlugin extends HttpClientPlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
6
|
+
static id = 'fetch'
|
|
7
|
+
static prefix = 'tracing:apm:fetch:request'
|
|
8
8
|
|
|
9
9
|
bindStart (ctx) {
|
|
10
10
|
const req = ctx.req
|
|
@@ -4,9 +4,7 @@ const Plugin = require('../../dd-trace/src/plugins/plugin')
|
|
|
4
4
|
const web = require('../../dd-trace/src/plugins/util/web')
|
|
5
5
|
|
|
6
6
|
class FindMyWayPlugin extends Plugin {
|
|
7
|
-
static
|
|
8
|
-
return 'find-my-way'
|
|
9
|
-
}
|
|
7
|
+
static id = 'find-my-way'
|
|
10
8
|
|
|
11
9
|
constructor (...args) {
|
|
12
10
|
super(...args)
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const TracingPlugin = require('../../dd-trace/src/plugins/tracing')
|
|
4
4
|
|
|
5
5
|
class FsPlugin extends TracingPlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
6
|
+
static id = 'fs'
|
|
7
|
+
static operation = 'operation'
|
|
8
8
|
|
|
9
9
|
configure (...args) {
|
|
10
10
|
return super.configure(...args)
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
const ClientPlugin = require('../../dd-trace/src/plugins/client')
|
|
4
4
|
|
|
5
5
|
class GoogleCloudPubsubClientPlugin extends ClientPlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
8
|
-
static
|
|
6
|
+
static id = 'google-cloud-pubsub'
|
|
7
|
+
static type = 'messaging'
|
|
8
|
+
static operation = 'request'
|
|
9
9
|
|
|
10
10
|
start (ctx) {
|
|
11
11
|
const { request, api, projectId } = ctx
|
|
@@ -4,8 +4,8 @@ const { getMessageSize } = require('../../dd-trace/src/datastreams')
|
|
|
4
4
|
const ConsumerPlugin = require('../../dd-trace/src/plugins/consumer')
|
|
5
5
|
|
|
6
6
|
class GoogleCloudPubsubConsumerPlugin extends ConsumerPlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
7
|
+
static id = 'google-cloud-pubsub'
|
|
8
|
+
static operation = 'receive'
|
|
9
9
|
|
|
10
10
|
bindStart (ctx) {
|
|
11
11
|
const { message } = 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 GoogleCloudPubsubPlugin extends CompositePlugin {
|
|
10
|
-
static
|
|
10
|
+
static id = 'google-cloud-pubsub'
|
|
11
11
|
static get plugins () {
|
|
12
12
|
return {
|
|
13
13
|
producer: ProducerPlugin,
|
|
@@ -4,8 +4,8 @@ const ProducerPlugin = require('../../dd-trace/src/plugins/producer')
|
|
|
4
4
|
const { DsmPathwayCodec, getHeadersSize } = require('../../dd-trace/src/datastreams')
|
|
5
5
|
|
|
6
6
|
class GoogleCloudPubsubProducerPlugin extends ProducerPlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
7
|
+
static id = 'google-cloud-pubsub'
|
|
8
|
+
static operation = 'request'
|
|
9
9
|
|
|
10
10
|
bindStart (ctx) {
|
|
11
11
|
const { request, api, projectId } = ctx
|
|
@@ -5,7 +5,7 @@ const GoogleVertexAITracingPlugin = require('./tracing')
|
|
|
5
5
|
const VertexAILLMObsPlugin = require('../../dd-trace/src/llmobs/plugins/vertexai')
|
|
6
6
|
|
|
7
7
|
class GoogleCloudVertexAIPlugin extends CompositePlugin {
|
|
8
|
-
static
|
|
8
|
+
static id = 'google-cloud-vertexai'
|
|
9
9
|
static get plugins () {
|
|
10
10
|
return {
|
|
11
11
|
llmobs: VertexAILLMObsPlugin,
|
|
@@ -10,10 +10,8 @@ const {
|
|
|
10
10
|
} = require('./utils')
|
|
11
11
|
|
|
12
12
|
class GoogleCloudVertexAITracingPlugin extends TracingPlugin {
|
|
13
|
-
static
|
|
14
|
-
static
|
|
15
|
-
return 'tracing:apm:vertexai:request'
|
|
16
|
-
}
|
|
13
|
+
static id = 'google-cloud-vertexai'
|
|
14
|
+
static prefix = 'tracing:apm:vertexai:request'
|
|
17
15
|
|
|
18
16
|
constructor () {
|
|
19
17
|
super(...arguments)
|
|
@@ -6,12 +6,14 @@ const { extractErrorIntoSpanEvent } = require('./utils')
|
|
|
6
6
|
let tools
|
|
7
7
|
|
|
8
8
|
class GraphQLExecutePlugin extends TracingPlugin {
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
12
|
-
static
|
|
9
|
+
static id = 'graphql'
|
|
10
|
+
static operation = 'execute'
|
|
11
|
+
static type = 'graphql'
|
|
12
|
+
static kind = 'server'
|
|
13
|
+
|
|
14
|
+
bindStart (ctx) {
|
|
15
|
+
const { operation, args, docSource } = ctx
|
|
13
16
|
|
|
14
|
-
start ({ operation, args, docSource }) {
|
|
15
17
|
const type = operation && operation.operation
|
|
16
18
|
const name = operation && operation.name && operation.name.value
|
|
17
19
|
const document = args.document
|
|
@@ -27,20 +29,25 @@ class GraphQLExecutePlugin extends TracingPlugin {
|
|
|
27
29
|
'graphql.operation.name': name,
|
|
28
30
|
'graphql.source': source
|
|
29
31
|
}
|
|
30
|
-
})
|
|
32
|
+
}, ctx)
|
|
31
33
|
|
|
32
34
|
addVariableTags(this.config, span, args.variableValues)
|
|
35
|
+
|
|
36
|
+
return ctx.currentStore
|
|
33
37
|
}
|
|
34
38
|
|
|
35
|
-
finish (
|
|
36
|
-
const
|
|
39
|
+
finish (ctx) {
|
|
40
|
+
const { res, args } = ctx
|
|
41
|
+
const span = ctx?.currentStore?.span || this.activeSpan
|
|
37
42
|
this.config.hooks.execute(span, args, res)
|
|
38
43
|
if (res?.errors) {
|
|
39
44
|
for (const err of res.errors) {
|
|
40
45
|
extractErrorIntoSpanEvent(this._tracerConfig, span, err)
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
|
-
super.finish()
|
|
48
|
+
super.finish(ctx)
|
|
49
|
+
|
|
50
|
+
return ctx.parentStore
|
|
44
51
|
}
|
|
45
52
|
}
|
|
46
53
|
|
|
@@ -9,7 +9,7 @@ const GraphQLValidatePlugin = require('./validate')
|
|
|
9
9
|
const GraphQLResolvePlugin = require('./resolve')
|
|
10
10
|
|
|
11
11
|
class GraphQLPlugin extends CompositePlugin {
|
|
12
|
-
static
|
|
12
|
+
static id = 'graphql'
|
|
13
13
|
static get plugins () {
|
|
14
14
|
return {
|
|
15
15
|
execute: GraphQLExecutePlugin,
|
|
@@ -3,19 +3,22 @@
|
|
|
3
3
|
const TracingPlugin = require('../../dd-trace/src/plugins/tracing')
|
|
4
4
|
|
|
5
5
|
class GraphQLParsePlugin extends TracingPlugin {
|
|
6
|
-
static
|
|
7
|
-
static
|
|
6
|
+
static id = 'graphql'
|
|
7
|
+
static operation = 'parser'
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
bindStart (ctx) {
|
|
10
10
|
this.startSpan('graphql.parse', {
|
|
11
11
|
service: this.config.service,
|
|
12
12
|
type: 'graphql',
|
|
13
13
|
meta: {}
|
|
14
|
-
})
|
|
14
|
+
}, ctx)
|
|
15
|
+
|
|
16
|
+
return ctx.currentStore
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
finish (
|
|
18
|
-
const
|
|
19
|
+
finish (ctx) {
|
|
20
|
+
const { source, document, docSource } = ctx
|
|
21
|
+
const span = ctx?.currentStore?.span || this.activeSpan
|
|
19
22
|
|
|
20
23
|
if (this.config.source && document) {
|
|
21
24
|
span.setTag('graphql.source', docSource)
|
|
@@ -23,7 +26,9 @@ class GraphQLParsePlugin extends TracingPlugin {
|
|
|
23
26
|
|
|
24
27
|
this.config.hooks.parse(span, source, document)
|
|
25
28
|
|
|
26
|
-
super.finish()
|
|
29
|
+
super.finish(ctx)
|
|
30
|
+
|
|
31
|
+
return ctx.parentStore
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
|
|
@@ -6,28 +6,37 @@ const dc = require('dc-polyfill')
|
|
|
6
6
|
const collapsedPathSym = Symbol('collapsedPaths')
|
|
7
7
|
|
|
8
8
|
class GraphQLResolvePlugin extends TracingPlugin {
|
|
9
|
-
static
|
|
10
|
-
static
|
|
9
|
+
static id = 'graphql'
|
|
10
|
+
static operation = 'resolve'
|
|
11
|
+
|
|
12
|
+
start (fieldCtx) {
|
|
13
|
+
const { info, rootCtx, args } = fieldCtx
|
|
11
14
|
|
|
12
|
-
start ({ info, context, args }) {
|
|
13
15
|
const path = getPath(info, this.config)
|
|
14
16
|
|
|
17
|
+
// we need to get the parent span to the field if it exists for correct span parenting
|
|
18
|
+
// of nested fields
|
|
19
|
+
const parentField = getParentField(rootCtx, pathToArray(info && info.path))
|
|
20
|
+
const childOf = parentField?.ctx?.currentStore?.span
|
|
21
|
+
|
|
22
|
+
fieldCtx.parent = parentField
|
|
23
|
+
|
|
15
24
|
if (!shouldInstrument(this.config, path)) return
|
|
16
25
|
const computedPathString = path.join('.')
|
|
17
26
|
|
|
18
27
|
if (this.config.collapse) {
|
|
19
|
-
if (
|
|
28
|
+
if (rootCtx.fields[computedPathString]) return
|
|
20
29
|
|
|
21
|
-
if (!
|
|
22
|
-
|
|
23
|
-
} else if (
|
|
30
|
+
if (!rootCtx[collapsedPathSym]) {
|
|
31
|
+
rootCtx[collapsedPathSym] = {}
|
|
32
|
+
} else if (rootCtx[collapsedPathSym][computedPathString]) {
|
|
24
33
|
return
|
|
25
34
|
}
|
|
26
35
|
|
|
27
|
-
|
|
36
|
+
rootCtx[collapsedPathSym][computedPathString] = true
|
|
28
37
|
}
|
|
29
38
|
|
|
30
|
-
const document =
|
|
39
|
+
const document = rootCtx.source
|
|
31
40
|
const fieldNode = info.fieldNodes.find(fieldNode => fieldNode.kind === 'Field')
|
|
32
41
|
const loc = this.config.source && document && fieldNode && fieldNode.loc
|
|
33
42
|
const source = loc && document.slice(loc.start, loc.end)
|
|
@@ -35,6 +44,7 @@ class GraphQLResolvePlugin extends TracingPlugin {
|
|
|
35
44
|
const span = this.startSpan('graphql.resolve', {
|
|
36
45
|
service: this.config.service,
|
|
37
46
|
resource: `${info.fieldName}:${info.returnType}`,
|
|
47
|
+
childOf,
|
|
38
48
|
type: 'graphql',
|
|
39
49
|
meta: {
|
|
40
50
|
'graphql.field.name': info.fieldName,
|
|
@@ -42,7 +52,7 @@ class GraphQLResolvePlugin extends TracingPlugin {
|
|
|
42
52
|
'graphql.field.type': info.returnType.name,
|
|
43
53
|
'graphql.source': source
|
|
44
54
|
}
|
|
45
|
-
})
|
|
55
|
+
}, fieldCtx)
|
|
46
56
|
|
|
47
57
|
if (fieldNode && this.config.variables && fieldNode.arguments) {
|
|
48
58
|
const variables = this.config.variables(info.variableValues)
|
|
@@ -56,21 +66,25 @@ class GraphQLResolvePlugin extends TracingPlugin {
|
|
|
56
66
|
}
|
|
57
67
|
|
|
58
68
|
if (this.resolverStartCh.hasSubscribers) {
|
|
59
|
-
this.resolverStartCh.publish({
|
|
69
|
+
this.resolverStartCh.publish({ ctx: rootCtx, resolverInfo: getResolverInfo(info, args) })
|
|
60
70
|
}
|
|
71
|
+
|
|
72
|
+
return fieldCtx.currentStore
|
|
61
73
|
}
|
|
62
74
|
|
|
63
75
|
constructor (...args) {
|
|
64
76
|
super(...args)
|
|
65
77
|
|
|
66
|
-
this.addTraceSub('updateField', (
|
|
78
|
+
this.addTraceSub('updateField', (ctx) => {
|
|
79
|
+
const { field, info, error } = ctx
|
|
80
|
+
|
|
67
81
|
const path = getPath(info, this.config)
|
|
68
82
|
|
|
69
83
|
if (!shouldInstrument(this.config, path)) return
|
|
70
84
|
|
|
71
|
-
const span = this.activeSpan
|
|
85
|
+
const span = ctx?.currentStore?.span || this.activeSpan
|
|
72
86
|
field.finishTime = span._getTime ? span._getTime() : 0
|
|
73
|
-
field.error = field.error ||
|
|
87
|
+
field.error = field.error || error
|
|
74
88
|
})
|
|
75
89
|
|
|
76
90
|
this.resolverStartCh = dc.channel('datadog:graphql:resolver:start')
|
|
@@ -81,8 +95,13 @@ class GraphQLResolvePlugin extends TracingPlugin {
|
|
|
81
95
|
super.configure(config.depth === 0 ? false : config)
|
|
82
96
|
}
|
|
83
97
|
|
|
84
|
-
finish (
|
|
85
|
-
|
|
98
|
+
finish (ctx) {
|
|
99
|
+
const { finishTime } = ctx
|
|
100
|
+
|
|
101
|
+
const span = ctx?.currentStore?.span || this.activeSpan
|
|
102
|
+
span.finish(finishTime)
|
|
103
|
+
|
|
104
|
+
return ctx.parentStore
|
|
86
105
|
}
|
|
87
106
|
}
|
|
88
107
|
|
|
@@ -154,4 +173,19 @@ function getResolverInfo (info, args) {
|
|
|
154
173
|
return resolverInfo
|
|
155
174
|
}
|
|
156
175
|
|
|
176
|
+
function getParentField (parentCtx, path) {
|
|
177
|
+
for (let i = path.length - 1; i > 0; i--) {
|
|
178
|
+
const field = getField(parentCtx, path.slice(0, i))
|
|
179
|
+
if (field) {
|
|
180
|
+
return field
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return null
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function getField (parentCtx, path) {
|
|
188
|
+
return parentCtx.fields[path.join('.')]
|
|
189
|
+
}
|
|
190
|
+
|
|
157
191
|
module.exports = GraphQLResolvePlugin
|
|
@@ -4,10 +4,11 @@ const TracingPlugin = require('../../dd-trace/src/plugins/tracing')
|
|
|
4
4
|
const { extractErrorIntoSpanEvent } = require('./utils')
|
|
5
5
|
|
|
6
6
|
class GraphQLValidatePlugin extends TracingPlugin {
|
|
7
|
-
static
|
|
8
|
-
static
|
|
7
|
+
static id = 'graphql'
|
|
8
|
+
static operation = 'validate'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
bindStart (ctx) {
|
|
11
|
+
const { docSource, document } = ctx
|
|
11
12
|
const source = this.config.source && document && docSource
|
|
12
13
|
|
|
13
14
|
this.startSpan('graphql.validate', {
|
|
@@ -16,18 +17,23 @@ class GraphQLValidatePlugin extends TracingPlugin {
|
|
|
16
17
|
meta: {
|
|
17
18
|
'graphql.source': source
|
|
18
19
|
}
|
|
19
|
-
})
|
|
20
|
+
}, ctx)
|
|
21
|
+
|
|
22
|
+
return ctx.currentStore
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
finish (
|
|
23
|
-
const
|
|
25
|
+
finish (ctx) {
|
|
26
|
+
const { document, errors } = ctx
|
|
27
|
+
const span = ctx?.currentStore?.span || this.activeSpan
|
|
24
28
|
this.config.hooks.validate(span, document, errors)
|
|
25
29
|
if (errors) {
|
|
26
30
|
for (const err of errors) {
|
|
27
31
|
extractErrorIntoSpanEvent(this._tracerConfig, span, err)
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
|
-
super.finish()
|
|
34
|
+
super.finish(ctx)
|
|
35
|
+
|
|
36
|
+
return ctx.parentStore
|
|
31
37
|
}
|
|
32
38
|
}
|
|
33
39
|
|
|
@@ -6,10 +6,10 @@ const { TEXT_MAP } = require('../../../ext/formats')
|
|
|
6
6
|
const { addMetadataTags, getFilter, getMethodMetadata } = require('./util')
|
|
7
7
|
|
|
8
8
|
class GrpcClientPlugin extends ClientPlugin {
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
12
|
-
static
|
|
9
|
+
static id = 'grpc'
|
|
10
|
+
static operation = 'client:request'
|
|
11
|
+
static prefix = 'apm:grpc:client:request'
|
|
12
|
+
static peerServicePrecursors = ['rpc.service']
|
|
13
13
|
|
|
14
14
|
constructor (...args) {
|
|
15
15
|
super(...args)
|
|
@@ -5,7 +5,7 @@ const GrpcClientPlugin = require('./client')
|
|
|
5
5
|
const CompositePlugin = require('../../dd-trace/src/plugins/composite')
|
|
6
6
|
|
|
7
7
|
class GrpcPlugin extends CompositePlugin {
|
|
8
|
-
static
|
|
8
|
+
static id = 'grpc'
|
|
9
9
|
static get plugins () {
|
|
10
10
|
return {
|
|
11
11
|
server: GrpcServerPlugin,
|
|
@@ -6,9 +6,9 @@ const { TEXT_MAP } = require('../../../ext/formats')
|
|
|
6
6
|
const { addMetadataTags, getFilter, getMethodMetadata } = require('./util')
|
|
7
7
|
|
|
8
8
|
class GrpcServerPlugin extends ServerPlugin {
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
9
|
+
static id = 'grpc'
|
|
10
|
+
static operation = 'server:request'
|
|
11
|
+
static prefix = 'apm:grpc:server:request'
|
|
12
12
|
|
|
13
13
|
constructor (...args) {
|
|
14
14
|
super(...args)
|
|
@@ -5,9 +5,7 @@ const RouterPlugin = require('../../datadog-plugin-router/src')
|
|
|
5
5
|
const web = require('../../dd-trace/src/plugins/util/web')
|
|
6
6
|
|
|
7
7
|
class HapiPlugin extends RouterPlugin {
|
|
8
|
-
static
|
|
9
|
-
return 'hapi'
|
|
10
|
-
}
|
|
8
|
+
static id = 'hapi'
|
|
11
9
|
|
|
12
10
|
constructor (...args) {
|
|
13
11
|
super(...args)
|