dd-trace 5.54.0 → 5.56.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/LICENSE-3rdparty.csv +1 -0
- package/ci/cypress/plugin.js +8 -0
- package/ci/cypress/polyfills.js +23 -0
- package/ci/init.js +8 -7
- package/initialize.mjs +2 -2
- package/package.json +10 -9
- package/packages/datadog-code-origin/index.js +22 -4
- package/packages/datadog-core/src/utils/src/kebabcase.js +3 -3
- package/packages/datadog-core/src/utils/src/set.js +8 -10
- package/packages/datadog-instrumentations/src/cassandra-driver.js +5 -6
- package/packages/datadog-instrumentations/src/confluentinc-kafka-javascript.js +2 -3
- package/packages/datadog-instrumentations/src/cookie-parser.js +1 -1
- package/packages/datadog-instrumentations/src/couchbase.js +3 -6
- package/packages/datadog-instrumentations/src/cucumber.js +21 -28
- package/packages/datadog-instrumentations/src/dns.js +4 -4
- package/packages/datadog-instrumentations/src/elasticsearch.js +9 -10
- package/packages/datadog-instrumentations/src/fastify.js +7 -9
- package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +14 -16
- package/packages/datadog-instrumentations/src/hapi.js +10 -11
- package/packages/datadog-instrumentations/src/helpers/fetch.js +4 -5
- package/packages/datadog-instrumentations/src/helpers/hook.js +1 -2
- package/packages/datadog-instrumentations/src/helpers/register.js +6 -5
- package/packages/datadog-instrumentations/src/jest.js +421 -376
- package/packages/datadog-instrumentations/src/koa.js +2 -3
- package/packages/datadog-instrumentations/src/mariadb.js +11 -4
- package/packages/datadog-instrumentations/src/mocha/main.js +79 -75
- package/packages/datadog-instrumentations/src/mocha.js +3 -1
- package/packages/datadog-instrumentations/src/mysql.js +11 -2
- package/packages/datadog-instrumentations/src/nyc.js +2 -1
- package/packages/datadog-instrumentations/src/openai.js +2 -2
- package/packages/datadog-instrumentations/src/otel-sdk-trace.js +4 -3
- package/packages/datadog-instrumentations/src/pg.js +2 -3
- package/packages/datadog-instrumentations/src/playwright.js +19 -22
- package/packages/datadog-instrumentations/src/protobufjs.js +3 -4
- package/packages/datadog-instrumentations/src/redis.js +1 -1
- package/packages/datadog-instrumentations/src/restify.js +9 -13
- package/packages/datadog-instrumentations/src/router.js +12 -11
- package/packages/datadog-instrumentations/src/tedious.js +1 -2
- package/packages/datadog-instrumentations/src/vitest.js +15 -29
- package/packages/datadog-plugin-avsc/src/schema_iterator.js +12 -12
- package/packages/datadog-plugin-aws-sdk/src/base.js +12 -8
- package/packages/datadog-plugin-aws-sdk/src/services/cloudwatchlogs.js +3 -5
- package/packages/datadog-plugin-aws-sdk/src/services/dynamodb.js +12 -20
- package/packages/datadog-plugin-aws-sdk/src/services/kinesis.js +4 -5
- package/packages/datadog-plugin-aws-sdk/src/services/lambda.js +3 -5
- package/packages/datadog-plugin-aws-sdk/src/services/redshift.js +3 -5
- package/packages/datadog-plugin-aws-sdk/src/services/s3.js +3 -5
- package/packages/datadog-plugin-aws-sdk/src/services/sns.js +1 -2
- package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +7 -10
- package/packages/datadog-plugin-azure-functions/src/index.js +5 -4
- package/packages/datadog-plugin-cucumber/src/index.js +3 -2
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +2 -1
- package/packages/datadog-plugin-dd-trace-api/src/index.js +2 -1
- package/packages/datadog-plugin-elasticsearch/src/index.js +1 -1
- package/packages/datadog-plugin-google-cloud-vertexai/src/tracing.js +1 -1
- package/packages/datadog-plugin-graphql/src/index.js +3 -2
- package/packages/datadog-plugin-graphql/src/resolve.js +17 -10
- package/packages/datadog-plugin-http/src/client.js +5 -6
- package/packages/datadog-plugin-http2/src/client.js +7 -8
- package/packages/datadog-plugin-jest/src/index.js +3 -2
- package/packages/datadog-plugin-mocha/src/index.js +6 -1
- package/packages/datadog-plugin-mongodb-core/src/index.js +2 -1
- package/packages/datadog-plugin-mysql/src/index.js +11 -0
- package/packages/datadog-plugin-next/src/index.js +1 -1
- package/packages/datadog-plugin-openai/src/tracing.js +2 -4
- package/packages/datadog-plugin-oracledb/src/index.js +2 -1
- package/packages/datadog-plugin-playwright/src/index.js +3 -2
- package/packages/datadog-plugin-protobufjs/src/schema_iterator.js +8 -9
- package/packages/datadog-plugin-redis/src/index.js +1 -3
- package/packages/datadog-plugin-vitest/src/index.js +5 -4
- package/packages/dd-trace/src/appsec/iast/analyzers/analyzers.js +0 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-password-rules.js +0 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-secret-rules.js +0 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-secrets-rules.js +0 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/missing-header-analyzer.js +1 -2
- package/packages/dd-trace/src/appsec/iast/analyzers/sql-injection-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/security-controls/index.js +12 -13
- package/packages/dd-trace/src/appsec/iast/taint-tracking/operations-taint-object.js +44 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/operations.js +2 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +8 -3
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +2 -1
- package/packages/dd-trace/src/appsec/iast/telemetry/span-tags.js +1 -1
- package/packages/dd-trace/src/appsec/iast/telemetry/verbosity.js +1 -2
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/range-utils.js +10 -11
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +0 -4
- package/packages/dd-trace/src/appsec/iast/vulnerabilities.js +0 -1
- package/packages/dd-trace/src/appsec/index.js +16 -5
- package/packages/dd-trace/src/appsec/reporter.js +11 -11
- package/packages/dd-trace/src/appsec/sdk/set_user.js +2 -2
- package/packages/dd-trace/src/appsec/sdk/track_event.js +3 -3
- package/packages/dd-trace/src/appsec/telemetry/index.js +31 -1
- package/packages/dd-trace/src/appsec/waf/waf_context_wrapper.js +6 -2
- package/packages/dd-trace/src/azure_metadata.js +8 -3
- package/packages/dd-trace/src/baggage.js +2 -2
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/index.js +8 -7
- package/packages/dd-trace/src/ci-visibility/early-flake-detection/get-known-tests.js +2 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +2 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +2 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +2 -1
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +4 -3
- package/packages/dd-trace/src/ci-visibility/exporters/test-worker/index.js +7 -6
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +2 -1
- package/packages/dd-trace/src/ci-visibility/log-submission/log-submission-plugin.js +4 -3
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +4 -3
- package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +2 -1
- package/packages/dd-trace/src/config-helper.js +89 -0
- package/packages/dd-trace/src/config.js +120 -115
- package/packages/dd-trace/src/config_stable.js +7 -4
- package/packages/dd-trace/src/datastreams/fnv.js +1 -1
- package/packages/dd-trace/src/datastreams/schemas/schema_builder.js +6 -6
- package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +1 -2
- package/packages/dd-trace/src/debugger/devtools_client/condition.js +1 -2
- package/packages/dd-trace/src/debugger/devtools_client/index.js +2 -1
- package/packages/dd-trace/src/debugger/devtools_client/send.js +8 -3
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/collector.js +1 -2
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +3 -4
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/redaction.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/status.js +5 -1
- package/packages/dd-trace/src/debugger/index.js +1 -0
- package/packages/dd-trace/src/dogstatsd.js +2 -2
- package/packages/dd-trace/src/encode/0.4.js +5 -2
- package/packages/dd-trace/src/encode/0.5.js +3 -5
- package/packages/dd-trace/src/encode/agentless-ci-visibility.js +5 -5
- package/packages/dd-trace/src/exporter.js +2 -1
- package/packages/dd-trace/src/exporters/agent/writer.js +3 -1
- package/packages/dd-trace/src/exporters/common/docker.js +3 -2
- package/packages/dd-trace/src/exporters/common/request.js +4 -1
- package/packages/dd-trace/src/exporters/common/util.js +3 -1
- package/packages/dd-trace/src/id.js +3 -3
- package/packages/dd-trace/src/index.js +4 -3
- package/packages/dd-trace/src/lambda/handler.js +2 -1
- package/packages/dd-trace/src/lambda/index.js +2 -1
- package/packages/dd-trace/src/lambda/runtime/patch.js +3 -2
- package/packages/dd-trace/src/lambda/runtime/ritm.js +3 -2
- package/packages/dd-trace/src/llmobs/constants/tags.js +1 -0
- package/packages/dd-trace/src/llmobs/index.js +21 -5
- package/packages/dd-trace/src/llmobs/noop.js +18 -20
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/index.js +11 -13
- package/packages/dd-trace/src/llmobs/plugins/openai.js +1 -2
- package/packages/dd-trace/src/llmobs/sdk.js +2 -1
- package/packages/dd-trace/src/llmobs/span_processor.js +1 -1
- package/packages/dd-trace/src/llmobs/tagger.js +19 -6
- package/packages/dd-trace/src/llmobs/writers/base.js +1 -1
- package/packages/dd-trace/src/log/index.js +5 -4
- package/packages/dd-trace/src/log/writer.js +1 -2
- package/packages/dd-trace/src/msgpack/encoder.js +3 -3
- package/packages/dd-trace/src/noop/span.js +1 -1
- package/packages/dd-trace/src/opentelemetry/tracer.js +1 -1
- package/packages/dd-trace/src/opentracing/propagation/log.js +4 -5
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +35 -42
- package/packages/dd-trace/src/opentracing/span.js +7 -6
- package/packages/dd-trace/src/payload-tagging/config/index.js +17 -21
- package/packages/dd-trace/src/plugin_manager.js +4 -3
- package/packages/dd-trace/src/plugins/ci_plugin.js +25 -1
- package/packages/dd-trace/src/plugins/plugin.js +1 -1
- package/packages/dd-trace/src/plugins/util/ci.js +7 -7
- package/packages/dd-trace/src/plugins/util/git.js +1 -1
- package/packages/dd-trace/src/plugins/util/llm.js +2 -2
- package/packages/dd-trace/src/plugins/util/stacktrace.js +8 -1
- package/packages/dd-trace/src/plugins/util/test.js +4 -3
- package/packages/dd-trace/src/plugins/util/user-provided-git.js +2 -1
- package/packages/dd-trace/src/plugins/util/web.js +3 -4
- package/packages/dd-trace/src/priority_sampler.js +46 -35
- package/packages/dd-trace/src/profiling/config.js +12 -32
- package/packages/dd-trace/src/profiling/exporter_cli.js +20 -20
- package/packages/dd-trace/src/profiling/exporters/agent.js +1 -1
- package/packages/dd-trace/src/profiling/exporters/event_serializer.js +2 -1
- package/packages/dd-trace/src/profiling/index.js +2 -1
- package/packages/dd-trace/src/profiling/profiler.js +7 -4
- package/packages/dd-trace/src/profiling/profilers/events.js +10 -2
- package/packages/dd-trace/src/profiling/ssi-telemetry-mock-profiler.js +3 -1
- package/packages/dd-trace/src/profiling/tagger.js +22 -12
- package/packages/dd-trace/src/proxy.js +2 -1
- package/packages/dd-trace/src/ritm.js +4 -4
- package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +3 -2
- package/packages/dd-trace/src/sampler.js +10 -2
- package/packages/dd-trace/src/serverless.js +11 -4
- package/packages/dd-trace/src/span_processor.js +2 -1
- package/packages/dd-trace/src/standalone/tracesource.js +1 -2
- package/packages/dd-trace/src/standalone/tracesource_priority_sampler.js +1 -2
- package/packages/dd-trace/src/startup-log.js +5 -17
- package/packages/dd-trace/src/supported-configurations.json +440 -0
- package/packages/dd-trace/src/telemetry/dependencies.js +62 -57
- package/packages/dd-trace/src/telemetry/send-data.js +7 -6
- package/packages/dd-trace/src/telemetry/telemetry.js +16 -26
- package/packages/dd-trace/src/tracer.js +3 -7
- package/packages/dd-trace/src/util.js +0 -5
- package/packages/datadog-core/src/utils/src/get.js +0 -11
- package/packages/datadog-core/src/utils/src/has.js +0 -14
- package/packages/dd-trace/src/appsec/iast/analyzers/header-injection-analyzer.js +0 -120
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/header-sensitive-analyzer.js +0 -20
|
@@ -63,7 +63,6 @@ function getQueryOrProcedure (request) {
|
|
|
63
63
|
return [request.parametersByName.statement.value, request.parametersByName.statement, 'value']
|
|
64
64
|
} else if (request.parametersByName.stmt) {
|
|
65
65
|
return [request.parametersByName.stmt.value, request.parametersByName.stmt, 'value']
|
|
66
|
-
} else {
|
|
67
|
-
return [request.sqlTextOrProcedure, request, 'sqlTextOrProcedure']
|
|
68
66
|
}
|
|
67
|
+
return [request.sqlTextOrProcedure, request, 'sqlTextOrProcedure']
|
|
69
68
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { addHook, channel
|
|
1
|
+
const { addHook, channel } = require('./helpers/instrument')
|
|
2
2
|
const shimmer = require('../../datadog-shimmer')
|
|
3
3
|
const log = require('../../dd-trace/src/log')
|
|
4
4
|
|
|
@@ -38,7 +38,6 @@ const modifiedTasks = new WeakSet()
|
|
|
38
38
|
let isRetryReasonEfd = false
|
|
39
39
|
let isRetryReasonAttemptToFix = false
|
|
40
40
|
const switchedStatuses = new WeakSet()
|
|
41
|
-
const sessionAsyncResource = new AsyncResource('bound-anonymous-fn')
|
|
42
41
|
|
|
43
42
|
const BREAKPOINT_HIT_GRACE_PERIOD_MS = 400
|
|
44
43
|
|
|
@@ -116,9 +115,7 @@ function isBaseSequencer (vitestPackage) {
|
|
|
116
115
|
|
|
117
116
|
function getChannelPromise (channelToPublishTo) {
|
|
118
117
|
return new Promise(resolve => {
|
|
119
|
-
|
|
120
|
-
channelToPublishTo.publish({ onDone: resolve })
|
|
121
|
-
})
|
|
118
|
+
channelToPublishTo.publish({ onDone: resolve })
|
|
122
119
|
})
|
|
123
120
|
}
|
|
124
121
|
|
|
@@ -194,9 +191,6 @@ function getSortWrapper (sort) {
|
|
|
194
191
|
let isImpactedTestsEnabled = false
|
|
195
192
|
let testManagementAttemptToFixRetries = 0
|
|
196
193
|
let isDiEnabled = false
|
|
197
|
-
let knownTests = {}
|
|
198
|
-
let testManagementTests = {}
|
|
199
|
-
let modifiedTests = {}
|
|
200
194
|
|
|
201
195
|
try {
|
|
202
196
|
const { err, libraryConfig } = await getChannelPromise(libraryConfigurationCh)
|
|
@@ -233,9 +227,8 @@ function getSortWrapper (sort) {
|
|
|
233
227
|
const knownTestsResponse = await getChannelPromise(knownTestsCh)
|
|
234
228
|
if (knownTestsResponse.err) {
|
|
235
229
|
isEarlyFlakeDetectionEnabled = false
|
|
236
|
-
isKnownTestsEnabled = false
|
|
237
230
|
} else {
|
|
238
|
-
knownTests = knownTestsResponse.knownTests
|
|
231
|
+
const knownTests = knownTestsResponse.knownTests
|
|
239
232
|
const getFilePaths = this.ctx.getTestFilepaths || this.ctx._globTestFilepaths
|
|
240
233
|
|
|
241
234
|
const testFilepaths = await getFilePaths.call(this.ctx)
|
|
@@ -249,7 +242,6 @@ function getSortWrapper (sort) {
|
|
|
249
242
|
})
|
|
250
243
|
if (isEarlyFlakeDetectionFaulty) {
|
|
251
244
|
isEarlyFlakeDetectionEnabled = false
|
|
252
|
-
isKnownTestsEnabled = false
|
|
253
245
|
log.warn('New test detection is disabled because the number of new tests is too high.')
|
|
254
246
|
} else {
|
|
255
247
|
// TODO: use this to pass session and module IDs to the worker, instead of polluting process.env
|
|
@@ -282,7 +274,7 @@ function getSortWrapper (sort) {
|
|
|
282
274
|
isTestManagementTestsEnabled = false
|
|
283
275
|
log.error('Could not get test management tests.')
|
|
284
276
|
} else {
|
|
285
|
-
testManagementTests = receivedTestManagementTests
|
|
277
|
+
const testManagementTests = receivedTestManagementTests
|
|
286
278
|
try {
|
|
287
279
|
const workspaceProject = this.ctx.getCoreWorkspaceProject()
|
|
288
280
|
workspaceProject._provided._ddIsTestManagementTestsEnabled = isTestManagementTestsEnabled
|
|
@@ -295,12 +287,10 @@ function getSortWrapper (sort) {
|
|
|
295
287
|
}
|
|
296
288
|
|
|
297
289
|
if (isImpactedTestsEnabled) {
|
|
298
|
-
const { err, modifiedTests
|
|
290
|
+
const { err, modifiedTests } = await getChannelPromise(impactedTestsCh)
|
|
299
291
|
if (err) {
|
|
300
|
-
isImpactedTestsEnabled = false
|
|
301
292
|
log.error('Could not get modified tests.')
|
|
302
293
|
} else {
|
|
303
|
-
modifiedTests = receivedModifiedTests
|
|
304
294
|
try {
|
|
305
295
|
const workspaceProject = this.ctx.getCoreWorkspaceProject()
|
|
306
296
|
workspaceProject._provided._ddIsImpactedTestsEnabled = isImpactedTestsEnabled
|
|
@@ -338,16 +328,14 @@ function getSortWrapper (sort) {
|
|
|
338
328
|
error = new Error(`Test suites failed: ${failedSuites.length}.`)
|
|
339
329
|
}
|
|
340
330
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
onFinish
|
|
350
|
-
})
|
|
331
|
+
testSessionFinishCh.publish({
|
|
332
|
+
status: getSessionStatus(this.state),
|
|
333
|
+
testCodeCoverageLinesTotal,
|
|
334
|
+
error,
|
|
335
|
+
isEarlyFlakeDetectionEnabled,
|
|
336
|
+
isEarlyFlakeDetectionFaulty,
|
|
337
|
+
isTestManagementTestsEnabled,
|
|
338
|
+
onFinish
|
|
351
339
|
})
|
|
352
340
|
|
|
353
341
|
await flushPromise
|
|
@@ -364,10 +352,8 @@ function getCreateCliWrapper (vitestPackage, frameworkVersion) {
|
|
|
364
352
|
if (!testSessionStartCh.hasSubscribers) {
|
|
365
353
|
return oldCreateCli.apply(this, arguments)
|
|
366
354
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
testSessionStartCh.publish({ command: `vitest ${processArgv}`, frameworkVersion })
|
|
370
|
-
})
|
|
355
|
+
const processArgv = process.argv.slice(2).join(' ')
|
|
356
|
+
testSessionStartCh.publish({ command: `vitest ${processArgv}`, frameworkVersion })
|
|
371
357
|
return oldCreateCli.apply(this, arguments)
|
|
372
358
|
})
|
|
373
359
|
|
|
@@ -104,21 +104,21 @@ class SchemaExtractor {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
return true
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
107
|
+
}
|
|
108
|
+
if (!builder.shouldExtractSchema(schemaName, depth)) {
|
|
109
|
+
return false
|
|
110
|
+
}
|
|
111
|
+
if (schema.fields?.[Symbol.iterator]) {
|
|
112
|
+
for (const field of schema.fields) {
|
|
113
|
+
if (!this.extractProperty(field, schemaName, field.name, builder, depth)) {
|
|
114
|
+
log.warn('DSM: Unable to extract field with name: %s from Avro schema with name: %s', field.name,
|
|
115
|
+
schemaName)
|
|
117
116
|
}
|
|
118
|
-
} else {
|
|
119
|
-
log.warn('DSM: schema.fields is not iterable from Avro schema with name: %s', schemaName)
|
|
120
117
|
}
|
|
118
|
+
} else {
|
|
119
|
+
log.warn('DSM: schema.fields is not iterable from Avro schema with name: %s', schemaName)
|
|
121
120
|
}
|
|
121
|
+
|
|
122
122
|
return true
|
|
123
123
|
}
|
|
124
124
|
|
|
@@ -6,6 +6,7 @@ const { storage } = require('../../datadog-core')
|
|
|
6
6
|
const { isTrue } = require('../../dd-trace/src/util')
|
|
7
7
|
const coalesce = require('koalas')
|
|
8
8
|
const { tagsFromRequest, tagsFromResponse } = require('../../dd-trace/src/payload-tagging')
|
|
9
|
+
const { getEnvironmentVariable } = require('../../dd-trace/src/config-helper')
|
|
9
10
|
|
|
10
11
|
class BaseAwsSdkPlugin extends ClientPlugin {
|
|
11
12
|
static get id () { return 'aws' }
|
|
@@ -132,7 +133,7 @@ class BaseAwsSdkPlugin extends ClientPlugin {
|
|
|
132
133
|
|
|
133
134
|
isEnabled (request) {
|
|
134
135
|
const serviceId = this.serviceIdentifier.toUpperCase()
|
|
135
|
-
const envVarValue =
|
|
136
|
+
const envVarValue = getEnvironmentVariable(`DD_TRACE_AWS_SDK_${serviceId}_ENABLED`)
|
|
136
137
|
return envVarValue ? isTrue(envVarValue) : true
|
|
137
138
|
}
|
|
138
139
|
|
|
@@ -142,11 +143,12 @@ class BaseAwsSdkPlugin extends ClientPlugin {
|
|
|
142
143
|
const operation = response.request.operation
|
|
143
144
|
const extraTags = this.generateTags(params, operation, response) || {}
|
|
144
145
|
|
|
145
|
-
const tags =
|
|
146
|
+
const tags = {
|
|
146
147
|
'aws.response.request_id': response.requestId,
|
|
147
148
|
'resource.name': operation,
|
|
148
|
-
'span.kind': 'client'
|
|
149
|
-
|
|
149
|
+
'span.kind': 'client',
|
|
150
|
+
...extraTags
|
|
151
|
+
}
|
|
150
152
|
|
|
151
153
|
span.addTags(tags)
|
|
152
154
|
|
|
@@ -211,19 +213,21 @@ function normalizeConfig (config, serviceIdentifier) {
|
|
|
211
213
|
const batchPropagationEnabled = isTrue(
|
|
212
214
|
coalesce(
|
|
213
215
|
specificConfig.batchPropagationEnabled,
|
|
214
|
-
|
|
216
|
+
getEnvironmentVariable(`DD_TRACE_AWS_SDK_${serviceId}_BATCH_PROPAGATION_ENABLED`),
|
|
215
217
|
config.batchPropagationEnabled,
|
|
216
|
-
|
|
218
|
+
getEnvironmentVariable('DD_TRACE_AWS_SDK_BATCH_PROPAGATION_ENABLED'),
|
|
217
219
|
false
|
|
218
220
|
)
|
|
219
221
|
)
|
|
220
222
|
|
|
221
223
|
// Merge the specific config back into the main config
|
|
222
|
-
return
|
|
224
|
+
return {
|
|
225
|
+
...config,
|
|
226
|
+
...specificConfig,
|
|
223
227
|
splitByAwsService: config.splitByAwsService !== false,
|
|
224
228
|
batchPropagationEnabled,
|
|
225
229
|
hooks
|
|
226
|
-
}
|
|
230
|
+
}
|
|
227
231
|
}
|
|
228
232
|
|
|
229
233
|
const noop = () => {}
|
|
@@ -6,15 +6,13 @@ class CloudwatchLogs extends BaseAwsSdkPlugin {
|
|
|
6
6
|
static get id () { return 'cloudwatchlogs' }
|
|
7
7
|
|
|
8
8
|
generateTags (params, operation) {
|
|
9
|
-
|
|
9
|
+
if (!params?.logGroupName) return {}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return Object.assign(tags, {
|
|
11
|
+
return {
|
|
14
12
|
'resource.name': `${operation} ${params.logGroupName}`,
|
|
15
13
|
'aws.cloudwatch.logs.log_group_name': params.logGroupName,
|
|
16
14
|
loggroupname: params.logGroupName
|
|
17
|
-
}
|
|
15
|
+
}
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
|
|
@@ -14,40 +14,32 @@ class DynamoDb extends BaseAwsSdkPlugin {
|
|
|
14
14
|
const tags = {}
|
|
15
15
|
|
|
16
16
|
if (params) {
|
|
17
|
-
|
|
18
|
-
Object.assign(tags, {
|
|
19
|
-
'resource.name': `${operation} ${params.TableName}`,
|
|
20
|
-
'aws.dynamodb.table_name': params.TableName,
|
|
21
|
-
tablename: params.TableName
|
|
22
|
-
})
|
|
23
|
-
}
|
|
17
|
+
let tableName = params.TableName
|
|
24
18
|
|
|
25
|
-
// batch operations have different format
|
|
19
|
+
// Collect table name for batch operations which have different format
|
|
26
20
|
// https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#batchGetItem-property`
|
|
27
21
|
// dynamoDB batch TableName
|
|
28
22
|
if (params.RequestItems !== null && typeof params.RequestItems === 'object') {
|
|
29
23
|
const requestItemsKeys = Object.keys(params.RequestItems)
|
|
30
24
|
if (requestItemsKeys.length === 1) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// also add span type to match serverless convention
|
|
34
|
-
Object.assign(tags, {
|
|
35
|
-
'resource.name': `${operation} ${tableName}`,
|
|
36
|
-
'aws.dynamodb.table_name': tableName,
|
|
37
|
-
tablename: tableName
|
|
38
|
-
})
|
|
25
|
+
tableName = requestItemsKeys[0]
|
|
39
26
|
}
|
|
40
27
|
}
|
|
41
28
|
|
|
29
|
+
if (tableName) {
|
|
30
|
+
// Also add span type to match serverless convention
|
|
31
|
+
tags['resource.name'] = `${operation} ${tableName}`
|
|
32
|
+
tags['aws.dynamodb.table_name'] = tableName
|
|
33
|
+
tags.tablename = tableName
|
|
34
|
+
}
|
|
35
|
+
|
|
42
36
|
// TODO: DynamoDB.DocumentClient does batches on multiple tables
|
|
43
37
|
// https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#batchGet-property
|
|
44
38
|
// it may be useful to have a different resource naming convention here to show all table names
|
|
45
39
|
}
|
|
46
40
|
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
'span.type': 'dynamodb'
|
|
50
|
-
})
|
|
41
|
+
// Also add span type to match serverless convention
|
|
42
|
+
tags['span.type'] = 'dynamodb'
|
|
51
43
|
|
|
52
44
|
return tags
|
|
53
45
|
}
|
|
@@ -35,11 +35,10 @@ class Kinesis extends BaseAwsSdkPlugin {
|
|
|
35
35
|
obj.needsFinish = true
|
|
36
36
|
const options = {
|
|
37
37
|
childOf: responseExtraction.maybeChildOf,
|
|
38
|
-
tags:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
)
|
|
38
|
+
tags: {
|
|
39
|
+
...this.requestTags.get(request),
|
|
40
|
+
'span.kind': 'server'
|
|
41
|
+
}
|
|
43
42
|
}
|
|
44
43
|
span = plugin.tracer.startSpan('aws.response', options)
|
|
45
44
|
this.enter(span, store)
|
|
@@ -7,15 +7,13 @@ class Lambda extends BaseAwsSdkPlugin {
|
|
|
7
7
|
static get id () { return 'lambda' }
|
|
8
8
|
|
|
9
9
|
generateTags (params, operation, response) {
|
|
10
|
-
|
|
10
|
+
if (!params?.FunctionName) return {}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return Object.assign(tags, {
|
|
12
|
+
return {
|
|
15
13
|
'resource.name': `${operation} ${params.FunctionName}`,
|
|
16
14
|
functionname: params.FunctionName,
|
|
17
15
|
'aws.lambda': params.FunctionName
|
|
18
|
-
}
|
|
16
|
+
}
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
requestInject (span, request) {
|
|
@@ -6,15 +6,13 @@ class Redshift extends BaseAwsSdkPlugin {
|
|
|
6
6
|
static get id () { return 'redshift' }
|
|
7
7
|
|
|
8
8
|
generateTags (params, operation, response) {
|
|
9
|
-
|
|
9
|
+
if (!params?.ClusterIdentifier) return {}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return Object.assign(tags, {
|
|
11
|
+
return {
|
|
14
12
|
'resource.name': `${operation} ${params.ClusterIdentifier}`,
|
|
15
13
|
'aws.redshift.cluster_identifier': params.ClusterIdentifier,
|
|
16
14
|
clusteridentifier: params.ClusterIdentifier
|
|
17
|
-
}
|
|
15
|
+
}
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
|
|
@@ -11,15 +11,13 @@ class S3 extends BaseAwsSdkPlugin {
|
|
|
11
11
|
static get isPayloadReporter () { return true }
|
|
12
12
|
|
|
13
13
|
generateTags (params, operation, response) {
|
|
14
|
-
|
|
14
|
+
if (!params?.Bucket) return {}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return Object.assign(tags, {
|
|
16
|
+
return {
|
|
19
17
|
'resource.name': `${operation} ${params.Bucket}`,
|
|
20
18
|
'aws.s3.bucket_name': params.Bucket,
|
|
21
19
|
bucketname: params.Bucket
|
|
22
|
-
}
|
|
20
|
+
}
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
addSpanPointers (span, response) {
|
|
@@ -74,8 +74,7 @@ class Sns extends BaseAwsSdkPlugin {
|
|
|
74
74
|
injectToMessage (span, params, topicArn, injectTraceContext) {
|
|
75
75
|
if (!params.MessageAttributes) {
|
|
76
76
|
params.MessageAttributes = {}
|
|
77
|
-
}
|
|
78
|
-
if (Object.keys(params.MessageAttributes).length >= 10) { // SNS quota
|
|
77
|
+
} else if (Object.keys(params.MessageAttributes).length >= 10) { // SNS quota
|
|
79
78
|
log.info('Message attributes full, skipping trace context injection')
|
|
80
79
|
return
|
|
81
80
|
}
|
|
@@ -27,11 +27,10 @@ class Sqs extends BaseAwsSdkPlugin {
|
|
|
27
27
|
obj.needsFinish = true
|
|
28
28
|
const options = {
|
|
29
29
|
childOf: contextExtraction.datadogContext,
|
|
30
|
-
tags:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
)
|
|
30
|
+
tags: {
|
|
31
|
+
...this.requestTags.get(request),
|
|
32
|
+
'span.kind': 'server'
|
|
33
|
+
}
|
|
35
34
|
}
|
|
36
35
|
parsedMessageAttributes = contextExtraction.parsedAttributes
|
|
37
36
|
span = this.tracer.startSpan('aws.response', options)
|
|
@@ -89,20 +88,18 @@ class Sqs extends BaseAwsSdkPlugin {
|
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
generateTags (params, operation, response) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (!params || (!params.QueueName && !params.QueueUrl)) return tags
|
|
91
|
+
if (!params || (!params.QueueName && !params.QueueUrl)) return {}
|
|
95
92
|
// 'https://sqs.us-east-1.amazonaws.com/123456789012/my-queue';
|
|
96
93
|
let queueName = params.QueueName
|
|
97
94
|
if (params.QueueUrl) {
|
|
98
95
|
queueName = params.QueueUrl.split('/').at(-1)
|
|
99
96
|
}
|
|
100
97
|
|
|
101
|
-
|
|
98
|
+
const tags = {
|
|
102
99
|
'resource.name': `${operation} ${params.QueueName || params.QueueUrl}`,
|
|
103
100
|
'aws.sqs.queue_name': params.QueueName || params.QueueUrl,
|
|
104
101
|
queuename: queueName
|
|
105
|
-
}
|
|
102
|
+
}
|
|
106
103
|
|
|
107
104
|
switch (operation) {
|
|
108
105
|
case 'receiveMessage':
|
|
@@ -19,14 +19,15 @@ class AzureFunctionsPlugin extends TracingPlugin {
|
|
|
19
19
|
static get operation () { return 'invoke' }
|
|
20
20
|
static get kind () { return 'server' }
|
|
21
21
|
static get type () { return 'serverless' }
|
|
22
|
-
|
|
23
22
|
static get prefix () { return 'tracing:datadog:azure:functions:invoke' }
|
|
24
23
|
|
|
25
24
|
bindStart (ctx) {
|
|
26
|
-
const { functionName, methodName } = ctx
|
|
25
|
+
const { functionName, methodName, httpRequest } = ctx
|
|
27
26
|
const store = storage('legacy').getStore()
|
|
28
|
-
|
|
27
|
+
// httpRequest.headers is a map
|
|
28
|
+
const childOf = this._tracer.extract('http_headers', Object.fromEntries(httpRequest.headers))
|
|
29
29
|
const span = this.startSpan(this.operationName(), {
|
|
30
|
+
childOf,
|
|
30
31
|
service: this.serviceName(),
|
|
31
32
|
type: 'serverless',
|
|
32
33
|
meta: {
|
|
@@ -52,7 +53,7 @@ class AzureFunctionsPlugin extends TracingPlugin {
|
|
|
52
53
|
const path = (new URL(httpRequest.url)).pathname
|
|
53
54
|
const req = {
|
|
54
55
|
method: httpRequest.method,
|
|
55
|
-
headers: Object.fromEntries(httpRequest.headers
|
|
56
|
+
headers: Object.fromEntries(httpRequest.headers),
|
|
56
57
|
url: path
|
|
57
58
|
}
|
|
58
59
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const CiPlugin = require('../../dd-trace/src/plugins/ci_plugin')
|
|
4
4
|
const { storage } = require('../../datadog-core')
|
|
5
|
+
const { getEnvironmentVariable } = require('../../dd-trace/src/config-helper')
|
|
5
6
|
|
|
6
7
|
const {
|
|
7
8
|
TEST_SKIP_REASON,
|
|
@@ -58,7 +59,7 @@ const id = require('../../dd-trace/src/id')
|
|
|
58
59
|
|
|
59
60
|
const BREAKPOINT_HIT_GRACE_PERIOD_MS = 200
|
|
60
61
|
const BREAKPOINT_SET_GRACE_PERIOD_MS = 200
|
|
61
|
-
const isCucumberWorker = !!
|
|
62
|
+
const isCucumberWorker = !!getEnvironmentVariable('CUCUMBER_WORKER_ID')
|
|
62
63
|
|
|
63
64
|
function getTestSuiteTags (testSuiteSpan) {
|
|
64
65
|
const suiteTags = {
|
|
@@ -134,7 +135,7 @@ class CucumberPlugin extends CiPlugin {
|
|
|
134
135
|
finishAllTraceSpans(this.testSessionSpan)
|
|
135
136
|
this.telemetry.count(TELEMETRY_TEST_SESSION, {
|
|
136
137
|
provider: this.ciProviderName,
|
|
137
|
-
autoInjected: !!
|
|
138
|
+
autoInjected: !!getEnvironmentVariable('DD_CIVISIBILITY_AUTO_INSTRUMENTATION_PROVIDER')
|
|
138
139
|
})
|
|
139
140
|
|
|
140
141
|
this.libraryConfig = null
|
|
@@ -49,6 +49,7 @@ const {
|
|
|
49
49
|
} = require('../../dd-trace/src/plugins/util/test')
|
|
50
50
|
const { isMarkedAsUnskippable } = require('../../datadog-plugin-jest/src/util')
|
|
51
51
|
const { ORIGIN_KEY, COMPONENT } = require('../../dd-trace/src/constants')
|
|
52
|
+
const { getEnvironmentVariable } = require('../../dd-trace/src/config-helper')
|
|
52
53
|
const { appClosing: appClosingTelemetry } = require('../../dd-trace/src/telemetry')
|
|
53
54
|
const log = require('../../dd-trace/src/log')
|
|
54
55
|
|
|
@@ -615,7 +616,7 @@ class CypressPlugin {
|
|
|
615
616
|
this.ciVisEvent(TELEMETRY_EVENT_FINISHED, 'session')
|
|
616
617
|
incrementCountMetric(TELEMETRY_TEST_SESSION, {
|
|
617
618
|
provider: this.ciProviderName,
|
|
618
|
-
autoInjected: !!
|
|
619
|
+
autoInjected: !!getEnvironmentVariable('DD_CIVISIBILITY_AUTO_INSTRUMENTATION_PROVIDER')
|
|
619
620
|
})
|
|
620
621
|
|
|
621
622
|
finishAllTraceSpans(this.testSessionSpan)
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
const Plugin = require('../../dd-trace/src/plugins/plugin')
|
|
4
4
|
const telemetryMetrics = require('../../dd-trace/src/telemetry/metrics')
|
|
5
5
|
const apiMetrics = telemetryMetrics.manager.namespace('tracers')
|
|
6
|
+
const { getEnvironmentVariable } = require('../../dd-trace/src/config-helper')
|
|
6
7
|
|
|
7
8
|
// api ==> here
|
|
8
9
|
const objectMap = new WeakMap()
|
|
9
10
|
|
|
10
11
|
const injectionEnabledTag =
|
|
11
|
-
`injection_enabled:${
|
|
12
|
+
`injection_enabled:${getEnvironmentVariable('DD_INJECTION_ENABLED') ? 'yes' : 'no'}`
|
|
12
13
|
|
|
13
14
|
module.exports = class DdTraceApiPlugin extends Plugin {
|
|
14
15
|
static get id () {
|
|
@@ -82,7 +82,7 @@ class GoogleCloudVertexAITracingPlugin extends TracingPlugin {
|
|
|
82
82
|
|
|
83
83
|
const generationConfig = instance.generationConfig || {}
|
|
84
84
|
for (const key of Object.keys(generationConfig)) {
|
|
85
|
-
const transformedKey = key.
|
|
85
|
+
const transformedKey = key.replaceAll(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase()
|
|
86
86
|
tags[`vertexai.request.generation_config.${transformedKey}`] = JSON.stringify(generationConfig[key])
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -27,12 +27,13 @@ class GraphQLPlugin extends CompositePlugin {
|
|
|
27
27
|
// config validator helpers
|
|
28
28
|
|
|
29
29
|
function validateConfig (config) {
|
|
30
|
-
return
|
|
30
|
+
return {
|
|
31
|
+
...config,
|
|
31
32
|
depth: getDepth(config),
|
|
32
33
|
variables: getVariablesFilter(config),
|
|
33
34
|
collapse: config.collapse === undefined || !!config.collapse,
|
|
34
35
|
hooks: getHooks(config)
|
|
35
|
-
}
|
|
36
|
+
}
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
function getDepth (config) {
|
|
@@ -16,13 +16,14 @@ class GraphQLResolvePlugin extends TracingPlugin {
|
|
|
16
16
|
const computedPathString = path.join('.')
|
|
17
17
|
|
|
18
18
|
if (this.config.collapse) {
|
|
19
|
+
if (context.fields[computedPathString]) return
|
|
20
|
+
|
|
19
21
|
if (!context[collapsedPathSym]) {
|
|
20
22
|
context[collapsedPathSym] = {}
|
|
23
|
+
} else if (context[collapsedPathSym][computedPathString]) {
|
|
24
|
+
return
|
|
21
25
|
}
|
|
22
26
|
|
|
23
|
-
if (context.fields[computedPathString]) return
|
|
24
|
-
if (context[collapsedPathSym][computedPathString]) return
|
|
25
|
-
|
|
26
27
|
context[collapsedPathSym][computedPathString] = true
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -47,10 +48,9 @@ class GraphQLResolvePlugin extends TracingPlugin {
|
|
|
47
48
|
const variables = this.config.variables(info.variableValues)
|
|
48
49
|
|
|
49
50
|
fieldNode.arguments
|
|
50
|
-
.filter(arg => arg.value && arg.value.kind === 'Variable')
|
|
51
|
-
.
|
|
52
|
-
|
|
53
|
-
.forEach(name => {
|
|
51
|
+
.filter(arg => arg.value?.name && arg.value.kind === 'Variable' && variables[arg.value.name.value])
|
|
52
|
+
.forEach(arg => {
|
|
53
|
+
const name = arg.value.name.value
|
|
54
54
|
span.setTag(`graphql.variables.${name}`, variables[name])
|
|
55
55
|
})
|
|
56
56
|
}
|
|
@@ -89,7 +89,12 @@ class GraphQLResolvePlugin extends TracingPlugin {
|
|
|
89
89
|
// helpers
|
|
90
90
|
|
|
91
91
|
function shouldInstrument (config, path) {
|
|
92
|
-
|
|
92
|
+
let depth = 0
|
|
93
|
+
for (const item of path) {
|
|
94
|
+
if (typeof item === 'string') {
|
|
95
|
+
depth += 1
|
|
96
|
+
}
|
|
97
|
+
}
|
|
93
98
|
|
|
94
99
|
return config.depth < 0 || config.depth >= depth
|
|
95
100
|
}
|
|
@@ -126,6 +131,7 @@ function getResolverInfo (info, args) {
|
|
|
126
131
|
Object.assign(resolverVars, args)
|
|
127
132
|
}
|
|
128
133
|
|
|
134
|
+
let hasResolvers = false
|
|
129
135
|
const directives = info.fieldNodes?.[0]?.directives
|
|
130
136
|
if (Array.isArray(directives)) {
|
|
131
137
|
for (const directive of directives) {
|
|
@@ -134,13 +140,14 @@ function getResolverInfo (info, args) {
|
|
|
134
140
|
argList[argument.name.value] = argument.value.value
|
|
135
141
|
}
|
|
136
142
|
|
|
137
|
-
if (
|
|
143
|
+
if (directive.arguments.length > 0) {
|
|
144
|
+
hasResolvers = true
|
|
138
145
|
resolverVars[directive.name.value] = argList
|
|
139
146
|
}
|
|
140
147
|
}
|
|
141
148
|
}
|
|
142
149
|
|
|
143
|
-
if (Object.keys(resolverVars).length) {
|
|
150
|
+
if (hasResolvers || args && Object.keys(resolverVars).length) {
|
|
144
151
|
resolverInfo = { [info.fieldName]: resolverVars }
|
|
145
152
|
}
|
|
146
153
|
|
|
@@ -63,7 +63,7 @@ class HttpClientPlugin extends ClientPlugin {
|
|
|
63
63
|
// Implemented due to aws-sdk issue where request signing is broken if we mutate the headers
|
|
64
64
|
// Explained further in:
|
|
65
65
|
// https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1609#issuecomment-1826167348
|
|
66
|
-
options.headers =
|
|
66
|
+
options.headers = { ...options.headers }
|
|
67
67
|
this.tracer.inject(span, HTTP_HEADERS, options.headers)
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -173,13 +173,14 @@ function normalizeClientConfig (config) {
|
|
|
173
173
|
const headers = getHeaders(config)
|
|
174
174
|
const hooks = getHooks(config)
|
|
175
175
|
|
|
176
|
-
return
|
|
176
|
+
return {
|
|
177
|
+
...config,
|
|
177
178
|
validateStatus,
|
|
178
179
|
filter,
|
|
179
180
|
propagationFilter,
|
|
180
181
|
headers,
|
|
181
182
|
hooks
|
|
182
|
-
}
|
|
183
|
+
}
|
|
183
184
|
}
|
|
184
185
|
|
|
185
186
|
function getStatusValidator (config) {
|
|
@@ -192,9 +193,7 @@ function getStatusValidator (config) {
|
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
function getFilter (config) {
|
|
195
|
-
config =
|
|
196
|
-
blocklist: config.blocklist || []
|
|
197
|
-
})
|
|
196
|
+
config = { ...config, blocklist: config.blocklist || [] }
|
|
198
197
|
|
|
199
198
|
return urlFilter.getFilter(config)
|
|
200
199
|
}
|