dd-trace 5.101.0 → 5.102.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 +9 -7
- package/packages/datadog-instrumentations/src/aerospike.js +2 -2
- package/packages/datadog-instrumentations/src/ai.js +8 -8
- package/packages/datadog-instrumentations/src/amqplib.js +6 -7
- package/packages/datadog-instrumentations/src/anthropic.js +10 -10
- package/packages/datadog-instrumentations/src/apollo-server-core.js +3 -3
- package/packages/datadog-instrumentations/src/apollo-server.js +5 -5
- package/packages/datadog-instrumentations/src/avsc.js +6 -6
- package/packages/datadog-instrumentations/src/aws-sdk.js +151 -67
- package/packages/datadog-instrumentations/src/azure-durable-functions.js +8 -8
- package/packages/datadog-instrumentations/src/bluebird.js +2 -2
- package/packages/datadog-instrumentations/src/body-parser.js +2 -2
- package/packages/datadog-instrumentations/src/cassandra-driver.js +7 -7
- package/packages/datadog-instrumentations/src/child_process.js +12 -12
- package/packages/datadog-instrumentations/src/confluentinc-kafka-javascript.js +9 -9
- package/packages/datadog-instrumentations/src/connect.js +7 -7
- package/packages/datadog-instrumentations/src/cookie-parser.js +4 -4
- package/packages/datadog-instrumentations/src/cookie.js +2 -2
- package/packages/datadog-instrumentations/src/couchbase.js +16 -30
- package/packages/datadog-instrumentations/src/crypto.js +4 -4
- package/packages/datadog-instrumentations/src/cucumber.js +77 -16
- package/packages/datadog-instrumentations/src/dns.js +0 -3
- package/packages/datadog-instrumentations/src/elasticsearch.js +8 -11
- package/packages/datadog-instrumentations/src/express-mongo-sanitize.js +6 -6
- package/packages/datadog-instrumentations/src/express-session.js +4 -4
- package/packages/datadog-instrumentations/src/express.js +10 -11
- package/packages/datadog-instrumentations/src/fastify.js +2 -2
- package/packages/datadog-instrumentations/src/fs.js +14 -14
- package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +5 -7
- package/packages/datadog-instrumentations/src/google-genai.js +4 -4
- package/packages/datadog-instrumentations/src/grpc/server.js +2 -2
- package/packages/datadog-instrumentations/src/hapi.js +2 -2
- package/packages/datadog-instrumentations/src/helpers/callback-instrumentor.js +8 -8
- package/packages/datadog-instrumentations/src/helpers/promise.js +2 -2
- package/packages/datadog-instrumentations/src/hono.js +2 -2
- package/packages/datadog-instrumentations/src/http/client.js +6 -6
- package/packages/datadog-instrumentations/src/http/server.js +9 -9
- package/packages/datadog-instrumentations/src/jest.js +31 -31
- package/packages/datadog-instrumentations/src/kafkajs.js +9 -9
- package/packages/datadog-instrumentations/src/knex.js +17 -17
- package/packages/datadog-instrumentations/src/koa.js +12 -12
- package/packages/datadog-instrumentations/src/ldapjs.js +5 -5
- package/packages/datadog-instrumentations/src/light-my-request.js +2 -2
- package/packages/datadog-instrumentations/src/limitd-client.js +4 -4
- package/packages/datadog-instrumentations/src/lodash.js +4 -4
- package/packages/datadog-instrumentations/src/mariadb.js +13 -13
- package/packages/datadog-instrumentations/src/memcached.js +2 -2
- package/packages/datadog-instrumentations/src/microgateway-core.js +2 -2
- package/packages/datadog-instrumentations/src/mocha/common.js +3 -3
- package/packages/datadog-instrumentations/src/mocha/main.js +12 -10
- package/packages/datadog-instrumentations/src/mocha/utils.js +133 -16
- package/packages/datadog-instrumentations/src/mocha/worker.js +7 -5
- package/packages/datadog-instrumentations/src/mongodb-core.js +9 -22
- package/packages/datadog-instrumentations/src/mongodb.js +5 -5
- package/packages/datadog-instrumentations/src/mongoose.js +21 -21
- package/packages/datadog-instrumentations/src/mquery.js +5 -5
- package/packages/datadog-instrumentations/src/multer.js +4 -4
- package/packages/datadog-instrumentations/src/mysql.js +16 -16
- package/packages/datadog-instrumentations/src/mysql2.js +4 -4
- package/packages/datadog-instrumentations/src/net.js +14 -8
- package/packages/datadog-instrumentations/src/nyc.js +5 -5
- package/packages/datadog-instrumentations/src/openai.js +19 -19
- package/packages/datadog-instrumentations/src/oracledb.js +6 -6
- package/packages/datadog-instrumentations/src/passport-utils.js +5 -5
- package/packages/datadog-instrumentations/src/pg.js +15 -15
- package/packages/datadog-instrumentations/src/pino.js +6 -10
- package/packages/datadog-instrumentations/src/playwright.js +20 -15
- package/packages/datadog-instrumentations/src/protobufjs.js +16 -16
- package/packages/datadog-instrumentations/src/redis.js +1 -2
- package/packages/datadog-instrumentations/src/restify.js +2 -2
- package/packages/datadog-instrumentations/src/router.js +12 -12
- package/packages/datadog-instrumentations/src/stripe.js +12 -12
- package/packages/datadog-instrumentations/src/vitest.js +107 -26
- package/packages/datadog-instrumentations/src/winston.js +4 -4
- package/packages/datadog-instrumentations/src/ws.js +7 -7
- package/packages/datadog-plugin-aws-sdk/src/base.js +52 -4
- package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +19 -12
- package/packages/datadog-plugin-aws-sdk/src/services/kinesis.js +45 -35
- package/packages/datadog-plugin-aws-sdk/src/services/lambda.js +33 -22
- package/packages/datadog-plugin-aws-sdk/src/services/sns.js +12 -13
- package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +73 -54
- package/packages/datadog-plugin-aws-sdk/src/services/stepfunctions.js +19 -17
- package/packages/datadog-plugin-aws-sdk/src/util.js +22 -0
- package/packages/datadog-plugin-child_process/src/scrub-cmd-params.js +6 -6
- package/packages/datadog-plugin-cucumber/src/index.js +4 -0
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +1 -4
- package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +1 -5
- package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-push-subscription.js +3 -1
- package/packages/datadog-plugin-http/src/client.js +1 -5
- package/packages/datadog-plugin-jest/src/util.js +1 -2
- package/packages/datadog-plugin-mocha/src/index.js +4 -0
- package/packages/datadog-plugin-mongodb-core/src/index.js +2 -1
- package/packages/datadog-plugin-openai/src/tracing.js +12 -23
- package/packages/datadog-plugin-playwright/src/index.js +1 -1
- package/packages/datadog-plugin-vitest/src/index.js +8 -1
- package/packages/datadog-shimmer/src/shimmer.js +7 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-password-rules.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-secret-rules.js +81 -81
- package/packages/dd-trace/src/appsec/iast/security-controls/index.js +2 -2
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugins/kafka.js +2 -2
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +2 -2
- package/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js +2 -2
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +2 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/index.js +1 -3
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +83 -48
- package/packages/dd-trace/src/appsec/index.js +21 -24
- package/packages/dd-trace/src/appsec/reporter.js +3 -1
- package/packages/dd-trace/src/appsec/rule_manager.js +4 -2
- package/packages/dd-trace/src/appsec/waf/waf_context_wrapper.js +31 -16
- package/packages/dd-trace/src/config/git_properties.js +2 -2
- package/packages/dd-trace/src/datastreams/index.js +2 -1
- package/packages/dd-trace/src/datastreams/processor.js +1 -2
- package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +1 -0
- package/packages/dd-trace/src/encode/0.4.js +757 -232
- package/packages/dd-trace/src/encode/0.5.js +13 -7
- package/packages/dd-trace/src/llmobs/plugins/ai/util.js +1 -2
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +6 -3
- package/packages/dd-trace/src/llmobs/sdk.js +24 -26
- package/packages/dd-trace/src/llmobs/span_processor.js +25 -5
- package/packages/dd-trace/src/llmobs/util.js +1 -0
- package/packages/dd-trace/src/msgpack/chunk.js +6 -3
- package/packages/dd-trace/src/openfeature/noop.js +40 -36
- package/packages/dd-trace/src/openfeature/writers/exposures.js +33 -52
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +1 -2
- package/packages/dd-trace/src/opentelemetry/tracer.js +0 -22
- package/packages/dd-trace/src/opentracing/propagation/text_map_dsm.js +2 -11
- package/packages/dd-trace/src/plugins/util/ci.js +1 -1
- package/packages/dd-trace/src/plugins/util/git-cache.js +3 -5
- package/packages/dd-trace/src/plugins/util/test.js +19 -7
- package/packages/dd-trace/src/plugins/util/url.js +1 -3
- package/packages/dd-trace/src/plugins/util/user-provided-git.js +1 -1
- package/packages/dd-trace/src/plugins/util/web.js +5 -7
- package/packages/dd-trace/src/profiling/profilers/events.js +3 -23
- package/packages/dd-trace/src/profiling/profilers/wall.js +4 -5
- package/packages/dd-trace/src/runtime_metrics/index.js +2 -2
- package/packages/dd-trace/src/scope.js +3 -10
- package/packages/dd-trace/src/serverless.js +1 -4
- package/packages/dd-trace/src/service-naming/schemas/v0/messaging.js +7 -1
- package/packages/dd-trace/src/service-naming/schemas/v1/messaging.js +4 -0
- package/packages/dd-trace/src/tracer.js +7 -7
|
@@ -10,6 +10,8 @@ const pushReceiveSpans = new WeakMap()
|
|
|
10
10
|
|
|
11
11
|
class GoogleCloudPubsubPushSubscriptionPlugin extends TracingPlugin {
|
|
12
12
|
static get id () { return 'google-cloud-pubsub-push-subscription' }
|
|
13
|
+
static type = 'messaging'
|
|
14
|
+
static kind = 'consumer'
|
|
13
15
|
|
|
14
16
|
constructor (...args) {
|
|
15
17
|
super(...args)
|
|
@@ -150,7 +152,7 @@ class GoogleCloudPubsubPushSubscriptionPlugin extends TracingPlugin {
|
|
|
150
152
|
childOf: parentContext,
|
|
151
153
|
startTime,
|
|
152
154
|
kind: 'consumer',
|
|
153
|
-
service: this.config.service ||
|
|
155
|
+
service: this.config.service || this.serviceName(),
|
|
154
156
|
meta: {
|
|
155
157
|
component: 'google-cloud-pubsub',
|
|
156
158
|
'pubsub.method': 'receive',
|
|
@@ -79,11 +79,7 @@ class HttpClientPlugin extends ClientPlugin {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
shouldInjectTraceHeaders (options, uri) {
|
|
82
|
-
|
|
83
|
-
return false
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return true
|
|
82
|
+
return Boolean(this.config.propagationFilter(uri))
|
|
87
83
|
}
|
|
88
84
|
|
|
89
85
|
bindAsyncStart ({ parentStore }) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const { readFileSync } = require('fs')
|
|
4
4
|
const { parse } = require('../../../vendor/dist/jest-docblock')
|
|
5
5
|
|
|
6
|
-
const { getTestSuitePath
|
|
6
|
+
const { getTestSuitePath } = require('../../dd-trace/src/plugins/util/test')
|
|
7
7
|
const log = require('../../dd-trace/src/log')
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -172,5 +172,4 @@ module.exports = {
|
|
|
172
172
|
getJestTestName,
|
|
173
173
|
getJestSuitesToRun,
|
|
174
174
|
isMarkedAsUnskippable,
|
|
175
|
-
getEfdRetryCount,
|
|
176
175
|
}
|
|
@@ -218,12 +218,16 @@ class MochaPlugin extends CiPlugin {
|
|
|
218
218
|
isAttemptToFixRetry,
|
|
219
219
|
isAtrRetry,
|
|
220
220
|
finalStatus,
|
|
221
|
+
earlyFlakeAbortReason,
|
|
221
222
|
}) => {
|
|
222
223
|
if (span) {
|
|
223
224
|
span.setTag(TEST_STATUS, status)
|
|
224
225
|
if (finalStatus) {
|
|
225
226
|
span.setTag(TEST_FINAL_STATUS, finalStatus)
|
|
226
227
|
}
|
|
228
|
+
if (earlyFlakeAbortReason) {
|
|
229
|
+
span.setTag(TEST_EARLY_FLAKE_ABORT_REASON, earlyFlakeAbortReason)
|
|
230
|
+
}
|
|
227
231
|
if (hasBeenRetried) {
|
|
228
232
|
span.setTag(TEST_IS_RETRY, 'true')
|
|
229
233
|
if (isAtrRetry) {
|
|
@@ -173,9 +173,10 @@ function limitDepth (input) {
|
|
|
173
173
|
} else if (shouldSimplify(child)) {
|
|
174
174
|
output[key] = child
|
|
175
175
|
} else {
|
|
176
|
+
output[key] = {}
|
|
176
177
|
queue.push({
|
|
177
178
|
input: child,
|
|
178
|
-
output: output[key]
|
|
179
|
+
output: output[key],
|
|
179
180
|
depth: nextDepth,
|
|
180
181
|
})
|
|
181
182
|
}
|
|
@@ -560,9 +560,8 @@ function createResponseResponseExtraction (tags, body, openaiStore) {
|
|
|
560
560
|
|
|
561
561
|
// The server almost always responds with JSON
|
|
562
562
|
function coerceResponseBody (body, methodName) {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
return { file: body }
|
|
563
|
+
if (methodName === 'downloadFile') {
|
|
564
|
+
return { file: body }
|
|
566
565
|
}
|
|
567
566
|
|
|
568
567
|
const type = typeof body
|
|
@@ -574,9 +573,8 @@ function coerceResponseBody (body, methodName) {
|
|
|
574
573
|
}
|
|
575
574
|
} else if (type === 'object') {
|
|
576
575
|
return body
|
|
577
|
-
} else {
|
|
578
|
-
return {}
|
|
579
576
|
}
|
|
577
|
+
return {}
|
|
580
578
|
}
|
|
581
579
|
|
|
582
580
|
// This method is used to replace a dynamic URL segment with an asterisk
|
|
@@ -594,28 +592,19 @@ function lookupOperationEndpoint (operationId, methodName, url) {
|
|
|
594
592
|
return '/v1/files/*/content'
|
|
595
593
|
|
|
596
594
|
case 'retrieveFineTune':
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
default:
|
|
601
|
-
return '/v1/fine-tunes/*'
|
|
602
|
-
}
|
|
595
|
+
return methodName === 'fine_tuning.jobs.retrieve'
|
|
596
|
+
? '/v1/fine_tuning/jobs/*'
|
|
597
|
+
: '/v1/fine-tunes/*'
|
|
603
598
|
|
|
604
599
|
case 'listFineTuneEvents':
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
default:
|
|
609
|
-
return '/v1/fine-tunes/*/events'
|
|
610
|
-
}
|
|
600
|
+
return methodName === 'fine_tuning.jobs.listEvents'
|
|
601
|
+
? '/v1/fine_tuning/jobs/*/events'
|
|
602
|
+
: '/v1/fine-tunes/*/events'
|
|
611
603
|
|
|
612
604
|
case 'cancelFineTune':
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
default:
|
|
617
|
-
return '/v1/fine-tunes/*/cancel'
|
|
618
|
-
}
|
|
605
|
+
return methodName === 'fine_tuning.jobs.cancel'
|
|
606
|
+
? '/v1/fine_tuning/jobs/*/cancel'
|
|
607
|
+
: '/v1/fine-tunes/*/cancel'
|
|
619
608
|
}
|
|
620
609
|
|
|
621
610
|
return url
|
|
@@ -491,7 +491,7 @@ class PlaywrightPlugin extends CiPlugin {
|
|
|
491
491
|
[TEST_SOURCE_START]: testSourceLine,
|
|
492
492
|
}
|
|
493
493
|
if (testSourceFile) {
|
|
494
|
-
extraTags[TEST_SOURCE_FILE] = testSourceFile
|
|
494
|
+
extraTags[TEST_SOURCE_FILE] = testSourceFile
|
|
495
495
|
}
|
|
496
496
|
if (browserName) {
|
|
497
497
|
// Added as parameter too because it should affect the test fingerprint
|
|
@@ -213,13 +213,16 @@ class VitestPlugin extends CiPlugin {
|
|
|
213
213
|
return ctx.currentStore
|
|
214
214
|
})
|
|
215
215
|
|
|
216
|
-
this.addSub('ci:vitest:test:pass', ({ span, task, finalStatus }) => {
|
|
216
|
+
this.addSub('ci:vitest:test:pass', ({ span, task, finalStatus, earlyFlakeAbortReason }) => {
|
|
217
217
|
if (span) {
|
|
218
218
|
this.telemetry.ciVisEvent(TELEMETRY_EVENT_FINISHED, 'test', this.getTestTelemetryTags(span))
|
|
219
219
|
span.setTag(TEST_STATUS, 'pass')
|
|
220
220
|
if (finalStatus) {
|
|
221
221
|
span.setTag(TEST_FINAL_STATUS, finalStatus)
|
|
222
222
|
}
|
|
223
|
+
if (earlyFlakeAbortReason) {
|
|
224
|
+
span.setTag(TEST_EARLY_FLAKE_ABORT_REASON, earlyFlakeAbortReason)
|
|
225
|
+
}
|
|
223
226
|
span.finish(this.taskToFinishTime.get(task))
|
|
224
227
|
finishAllTraceSpans(span)
|
|
225
228
|
}
|
|
@@ -234,6 +237,7 @@ class VitestPlugin extends CiPlugin {
|
|
|
234
237
|
hasFailedAllRetries,
|
|
235
238
|
attemptToFixFailed,
|
|
236
239
|
finalStatus,
|
|
240
|
+
earlyFlakeAbortReason,
|
|
237
241
|
}) => {
|
|
238
242
|
if (!span) {
|
|
239
243
|
return
|
|
@@ -262,6 +266,9 @@ class VitestPlugin extends CiPlugin {
|
|
|
262
266
|
if (finalStatus) {
|
|
263
267
|
span.setTag(TEST_FINAL_STATUS, finalStatus)
|
|
264
268
|
}
|
|
269
|
+
if (earlyFlakeAbortReason) {
|
|
270
|
+
span.setTag(TEST_EARLY_FLAKE_ABORT_REASON, earlyFlakeAbortReason)
|
|
271
|
+
}
|
|
265
272
|
if (duration) {
|
|
266
273
|
span.finish(span._startTime + duration - MILLISECONDS_TO_SUBTRACT_FROM_FAILED_TEST_DURATION) // milliseconds
|
|
267
274
|
} else {
|
|
@@ -267,7 +267,13 @@ function assertMethod (target, name, method) {
|
|
|
267
267
|
* @throws {Error} If the target is a class constructor.
|
|
268
268
|
*/
|
|
269
269
|
function assertNotClass (target) {
|
|
270
|
-
|
|
270
|
+
// Class constructors have a non-writable `prototype` property; functions have a
|
|
271
|
+
// writable one and arrows / async / method-shorthand have none at all. The
|
|
272
|
+
// `'prototype' in target` gate skips the descriptor lookup for the no-prototype
|
|
273
|
+
// shapes; the `in` operator is cheaper than reading `target.prototype` since
|
|
274
|
+
// it returns a boolean instead of materialising the prototype reference.
|
|
275
|
+
if ('prototype' in target &&
|
|
276
|
+
Object.getOwnPropertyDescriptor(target, 'prototype').writable === false) {
|
|
271
277
|
throw new TypeError('Target is a native class constructor and cannot be wrapped.')
|
|
272
278
|
}
|
|
273
279
|
}
|
|
@@ -5,7 +5,7 @@ const { NameAndValue } = require('./hardcoded-rule-type')
|
|
|
5
5
|
module.exports = [
|
|
6
6
|
{
|
|
7
7
|
id: 'hardcoded-password',
|
|
8
|
-
regex: /(?:pwd|pswd|pass|secret)(?:[0-9a-z\-_\t.]{0,20})(?:[\s|']|[\s|"
|
|
8
|
+
regex: /(?:pwd|pswd|pass|secret)(?:[0-9a-z\-_\t.]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|""|\s|=|\x60){0,5}([0-9a-z\-_.=]{10,150})(?:['"\s\x60;]|$)/i,
|
|
9
9
|
type: NameAndValue,
|
|
10
10
|
},
|
|
11
11
|
]
|