dd-trace 5.96.0 → 5.97.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.
Files changed (114) hide show
  1. package/index.d.ts +34 -0
  2. package/package.json +9 -7
  3. package/packages/datadog-esbuild/index.js +20 -9
  4. package/packages/datadog-instrumentations/src/child_process.js +7 -17
  5. package/packages/datadog-instrumentations/src/crypto.js +1 -2
  6. package/packages/datadog-instrumentations/src/cucumber.js +4 -1
  7. package/packages/datadog-instrumentations/src/cypress-config.js +324 -0
  8. package/packages/datadog-instrumentations/src/cypress.js +86 -4
  9. package/packages/datadog-instrumentations/src/dns.js +1 -2
  10. package/packages/datadog-instrumentations/src/express.js +4 -4
  11. package/packages/datadog-instrumentations/src/fs.js +27 -29
  12. package/packages/datadog-instrumentations/src/graphql.js +1 -1
  13. package/packages/datadog-instrumentations/src/helpers/bundler-register.js +41 -13
  14. package/packages/datadog-instrumentations/src/helpers/hook.js +31 -6
  15. package/packages/datadog-instrumentations/src/helpers/hooks.js +12 -19
  16. package/packages/datadog-instrumentations/src/helpers/instrument.js +27 -13
  17. package/packages/datadog-instrumentations/src/helpers/register.js +103 -142
  18. package/packages/datadog-instrumentations/src/http/client.js +2 -3
  19. package/packages/datadog-instrumentations/src/http/server.js +2 -5
  20. package/packages/datadog-instrumentations/src/http2/client.js +1 -3
  21. package/packages/datadog-instrumentations/src/http2/server.js +1 -3
  22. package/packages/datadog-instrumentations/src/jest.js +13 -4
  23. package/packages/datadog-instrumentations/src/limitd-client.js +1 -1
  24. package/packages/datadog-instrumentations/src/mocha/utils.js +4 -1
  25. package/packages/datadog-instrumentations/src/net.js +2 -8
  26. package/packages/datadog-instrumentations/src/pino.js +1 -1
  27. package/packages/datadog-instrumentations/src/playwright.js +4 -1
  28. package/packages/datadog-instrumentations/src/prisma.js +1 -2
  29. package/packages/datadog-instrumentations/src/selenium.js +4 -1
  30. package/packages/datadog-instrumentations/src/sequelize.js +1 -1
  31. package/packages/datadog-instrumentations/src/url.js +1 -3
  32. package/packages/datadog-instrumentations/src/vitest.js +5 -1
  33. package/packages/datadog-instrumentations/src/vm.js +1 -3
  34. package/packages/datadog-plugin-aws-sdk/src/base.js +4 -3
  35. package/packages/datadog-plugin-cucumber/src/index.js +7 -3
  36. package/packages/datadog-plugin-cypress/src/cypress-plugin.js +57 -5
  37. package/packages/datadog-plugin-graphql/src/resolve.js +1 -1
  38. package/packages/datadog-plugin-jest/src/index.js +4 -2
  39. package/packages/datadog-plugin-kafkajs/src/batch-consumer.js +31 -4
  40. package/packages/datadog-plugin-mocha/src/index.js +5 -2
  41. package/packages/datadog-plugin-next/src/index.js +2 -14
  42. package/packages/datadog-plugin-openai/src/services.js +1 -0
  43. package/packages/datadog-webpack/index.js +3 -3
  44. package/packages/dd-trace/index.js +12 -10
  45. package/packages/dd-trace/src/agent/url.js +2 -2
  46. package/packages/dd-trace/src/aiguard/sdk.js +4 -0
  47. package/packages/dd-trace/src/appsec/blocking.js +3 -0
  48. package/packages/dd-trace/src/appsec/iast/iast-plugin.js +1 -1
  49. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +1 -1
  50. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +1 -1
  51. package/packages/dd-trace/src/appsec/remote_config.js +1 -0
  52. package/packages/dd-trace/src/appsec/sdk/index.js +4 -0
  53. package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/index.js +6 -1
  54. package/packages/dd-trace/src/ci-visibility/test-api-manual/test-api-manual-plugin.js +4 -0
  55. package/packages/dd-trace/src/config/defaults.js +316 -146
  56. package/packages/dd-trace/src/config/generated-config-types.d.ts +4 -1
  57. package/packages/dd-trace/src/config/helper.js +59 -10
  58. package/packages/dd-trace/src/config/index.js +569 -1505
  59. package/packages/dd-trace/src/config/parsers.js +256 -0
  60. package/packages/dd-trace/src/config/remote_config.js +59 -2
  61. package/packages/dd-trace/src/config/supported-configurations.json +350 -433
  62. package/packages/dd-trace/src/crashtracking/crashtracker.js +7 -1
  63. package/packages/dd-trace/src/crashtracking/index.js +1 -7
  64. package/packages/dd-trace/src/debugger/index.js +1 -1
  65. package/packages/dd-trace/src/dogstatsd.js +12 -9
  66. package/packages/dd-trace/src/encode/0.4.js +1 -1
  67. package/packages/dd-trace/src/exporters/agent/writer.js +7 -1
  68. package/packages/dd-trace/src/exporters/common/request.js +9 -0
  69. package/packages/dd-trace/src/exporters/common/writer.js +12 -2
  70. package/packages/dd-trace/src/heap_snapshots.js +3 -0
  71. package/packages/dd-trace/src/index.js +5 -2
  72. package/packages/dd-trace/src/lambda/runtime/ritm.js +6 -6
  73. package/packages/dd-trace/src/llmobs/index.js +4 -1
  74. package/packages/dd-trace/src/llmobs/plugins/ai/index.js +5 -1
  75. package/packages/dd-trace/src/llmobs/plugins/ai/util.js +60 -12
  76. package/packages/dd-trace/src/llmobs/plugins/bedrockruntime.js +4 -2
  77. package/packages/dd-trace/src/llmobs/sdk.js +12 -8
  78. package/packages/dd-trace/src/llmobs/span_processor.js +1 -1
  79. package/packages/dd-trace/src/llmobs/tagger.js +9 -6
  80. package/packages/dd-trace/src/llmobs/writers/base.js +2 -0
  81. package/packages/dd-trace/src/llmobs/writers/util.js +3 -0
  82. package/packages/dd-trace/src/log/index.js +26 -55
  83. package/packages/dd-trace/src/log/writer.js +7 -19
  84. package/packages/dd-trace/src/noop/proxy.js +8 -0
  85. package/packages/dd-trace/src/opentelemetry/logs/index.js +1 -1
  86. package/packages/dd-trace/src/opentelemetry/metrics/index.js +1 -1
  87. package/packages/dd-trace/src/opentracing/propagation/text_map.js +9 -4
  88. package/packages/dd-trace/src/payload-tagging/config/index.js +6 -5
  89. package/packages/dd-trace/src/plugin_manager.js +8 -6
  90. package/packages/dd-trace/src/plugins/ci_plugin.js +4 -0
  91. package/packages/dd-trace/src/plugins/plugin.js +7 -4
  92. package/packages/dd-trace/src/process-tags/index.js +3 -0
  93. package/packages/dd-trace/src/profiler.js +27 -2
  94. package/packages/dd-trace/src/profiling/config.js +73 -241
  95. package/packages/dd-trace/src/profiling/exporter_cli.js +1 -4
  96. package/packages/dd-trace/src/profiling/exporters/event_serializer.js +6 -2
  97. package/packages/dd-trace/src/profiling/profiler.js +56 -44
  98. package/packages/dd-trace/src/profiling/profilers/events.js +2 -3
  99. package/packages/dd-trace/src/profiling/profilers/wall.js +89 -6
  100. package/packages/dd-trace/src/profiling/ssi-heuristics.js +4 -1
  101. package/packages/dd-trace/src/propagation-hash/index.js +2 -1
  102. package/packages/dd-trace/src/proxy.js +32 -3
  103. package/packages/dd-trace/src/remote_config/index.js +3 -0
  104. package/packages/dd-trace/src/require-package-json.js +8 -4
  105. package/packages/dd-trace/src/ritm.js +58 -26
  106. package/packages/dd-trace/src/runtime_metrics/index.js +3 -0
  107. package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +3 -0
  108. package/packages/dd-trace/src/sampler.js +1 -1
  109. package/packages/dd-trace/src/standalone/index.js +3 -0
  110. package/packages/dd-trace/src/telemetry/index.js +2 -3
  111. package/packages/dd-trace/src/telemetry/send-data.js +5 -19
  112. package/packages/dd-trace/src/telemetry/session-propagation.js +19 -44
  113. package/packages/dd-trace/src/telemetry/telemetry.js +28 -171
  114. package/packages/dd-trace/src/util.js +0 -9
@@ -1,5 +1,9 @@
1
1
  'use strict'
2
2
 
3
+ // Capture real timers at module load time, before any test can install fake timers.
4
+ const realDateNow = Date.now.bind(Date)
5
+ const realSetTimeout = setTimeout
6
+
3
7
  const CiPlugin = require('../../dd-trace/src/plugins/ci_plugin')
4
8
  const { storage } = require('../../datadog-core')
5
9
  const { getEnvironmentVariable, getValueFromEnvSources } = require('../../dd-trace/src/config/helper')
@@ -229,7 +233,7 @@ class CucumberPlugin extends CiPlugin {
229
233
  // Time we give the breakpoint to be hit
230
234
  if (promises && this.runningTestProbe) {
231
235
  promises.hitBreakpointPromise = new Promise((resolve) => {
232
- setTimeout(resolve, BREAKPOINT_HIT_GRACE_PERIOD_MS)
236
+ realSetTimeout(resolve, BREAKPOINT_HIT_GRACE_PERIOD_MS)
233
237
  })
234
238
  }
235
239
 
@@ -252,8 +256,8 @@ class CucumberPlugin extends CiPlugin {
252
256
  const { file, line, stackIndex } = probeInformation
253
257
  this.runningTestProbe = { file, line }
254
258
  this.testErrorStackIndex = stackIndex
255
- const waitUntil = Date.now() + BREAKPOINT_SET_GRACE_PERIOD_MS
256
- while (Date.now() < waitUntil) {
259
+ const waitUntil = realDateNow() + BREAKPOINT_SET_GRACE_PERIOD_MS
260
+ while (realDateNow() < waitUntil) {
257
261
  // TODO: To avoid a race condition, we should wait until `probeInformation.setProbePromise` has resolved.
258
262
  // However, Cucumber doesn't have a mechanism for waiting asyncrounously here, so for now, we'll have to
259
263
  // fall back to a fixed syncronous delay.
@@ -307,10 +307,55 @@ class CypressPlugin {
307
307
  }
308
308
  }
309
309
 
310
+ /**
311
+ * Resets state that is scoped to a single Cypress run so the singleton plugin
312
+ * can be reused safely across multiple programmatic cypress.run() calls.
313
+ *
314
+ * @returns {void}
315
+ */
316
+ resetRunState () {
317
+ this._isInit = false
318
+ this.finishedTestsByFile = {}
319
+ this.testStatuses = {}
320
+ this.isTestsSkipped = false
321
+ this.isSuitesSkippingEnabled = false
322
+ this.isCodeCoverageEnabled = false
323
+ this.isFlakyTestRetriesEnabled = false
324
+ this.flakyTestRetriesCount = 0
325
+ this.isEarlyFlakeDetectionEnabled = false
326
+ this.isKnownTestsEnabled = false
327
+ this.earlyFlakeDetectionNumRetries = 0
328
+ this.testsToSkip = []
329
+ this.skippedTests = []
330
+ this.hasForcedToRunSuites = false
331
+ this.hasUnskippableSuites = false
332
+ this.unskippableSuites = []
333
+ this.knownTests = []
334
+ this.knownTestsByTestSuite = undefined
335
+ this.isTestManagementTestsEnabled = false
336
+ this.testManagementAttemptToFixRetries = 0
337
+ this.testManagementTests = undefined
338
+ this.isImpactedTestsEnabled = false
339
+ this.modifiedFiles = []
340
+ this.activeTestSpan = null
341
+ this.testSuiteSpan = null
342
+ this.testModuleSpan = null
343
+ this.testSessionSpan = null
344
+ this.command = undefined
345
+ this.frameworkVersion = undefined
346
+ this.rootDir = undefined
347
+ this.itrCorrelationId = undefined
348
+ this.isTestIsolationEnabled = undefined
349
+ this.rumFlushWaitMillis = undefined
350
+ this._pendingRequestErrorTags = []
351
+ this.libraryConfigurationPromise = undefined
352
+ }
353
+
310
354
  // Init function returns a promise that resolves with the Cypress configuration
311
355
  // Depending on the received configuration, the Cypress configuration can be modified:
312
356
  // for example, to enable retries for failed tests.
313
357
  init (tracer, cypressConfig) {
358
+ this.resetRunState()
314
359
  this._isInit = true
315
360
  this.tracer = tracer
316
361
  this.cypressConfig = cypressConfig
@@ -694,20 +739,27 @@ class CypressPlugin {
694
739
  }
695
740
 
696
741
  return new Promise(resolve => {
742
+ const finishAfterRun = () => {
743
+ this._isInit = false
744
+ appClosingTelemetry()
745
+ resolve(null)
746
+ }
747
+
697
748
  const exporter = this.tracer._tracer._exporter
698
749
  if (!exporter) {
699
- return resolve(null)
750
+ finishAfterRun()
751
+ return
700
752
  }
701
753
  if (exporter.flush) {
702
754
  exporter.flush(() => {
703
- appClosingTelemetry()
704
- resolve(null)
755
+ finishAfterRun()
705
756
  })
706
757
  } else if (exporter._writer) {
707
758
  exporter._writer.flush(() => {
708
- appClosingTelemetry()
709
- resolve(null)
759
+ finishAfterRun()
710
760
  })
761
+ } else {
762
+ finishAfterRun()
711
763
  }
712
764
  })
713
765
  }
@@ -28,7 +28,7 @@ class GraphQLResolvePlugin extends TracingPlugin {
28
28
  if (rootCtx.fields[computedPathString]) return
29
29
 
30
30
  if (!rootCtx[collapsedPathSym]) {
31
- rootCtx[collapsedPathSym] = {}
31
+ rootCtx[collapsedPathSym] = Object.create(null)
32
32
  } else if (rootCtx[collapsedPathSym][computedPathString]) {
33
33
  return
34
34
  }
@@ -1,5 +1,8 @@
1
1
  'use strict'
2
2
 
3
+ // Capture real timers at module load time, before any test can install fake timers.
4
+ const realSetTimeout = setTimeout
5
+
3
6
  const CiPlugin = require('../../dd-trace/src/plugins/ci_plugin')
4
7
  const { storage } = require('../../datadog-core')
5
8
  const { getEnvironmentVariable, getValueFromEnvSources } = require('../../dd-trace/src/config/helper')
@@ -60,8 +63,7 @@ const CHILD_MESSAGE_END = 2
60
63
 
61
64
  function withTimeout (promise, timeoutMs) {
62
65
  return new Promise(resolve => {
63
- // Set a timeout to resolve after 1s
64
- setTimeout(resolve, timeoutMs)
66
+ realSetTimeout(resolve, timeoutMs)
65
67
 
66
68
  // Also resolve if the original promise resolves
67
69
  promise.then(resolve)
@@ -8,20 +8,47 @@ class KafkajsBatchConsumerPlugin extends ConsumerPlugin {
8
8
  static id = 'kafkajs'
9
9
  static operation = 'consume-batch'
10
10
 
11
- start (ctx) {
12
- const { topic, messages, groupId, clusterId } = ctx.extractedArgs || ctx
11
+ bindStart (ctx) {
12
+ const { topic, partition, messages, groupId, clusterId } = ctx.extractedArgs || ctx
13
+
14
+ const span = this.startSpan({
15
+ resource: topic,
16
+ type: 'worker',
17
+ meta: {
18
+ component: this.constructor.id,
19
+ 'kafka.topic': topic,
20
+ 'kafka.cluster_id': clusterId,
21
+ 'messaging.destination.name': topic,
22
+ 'messaging.system': 'kafka',
23
+ },
24
+ metrics: {
25
+ 'kafka.partition': partition,
26
+ 'messaging.batch.message_count': messages.length,
27
+ },
28
+ }, ctx)
13
29
 
14
- if (!this.config.dsmEnabled) return
15
30
  for (const message of messages) {
16
31
  if (!message || !message.headers) continue
32
+
33
+ const headers = convertToTextMap(message.headers)
34
+ if (headers) {
35
+ const childOf = this.tracer.extract('text_map', headers)
36
+ if (childOf) {
37
+ span.addLink(childOf)
38
+ }
39
+ }
40
+
41
+ if (!this.config.dsmEnabled) continue
17
42
  const payloadSize = getMessageSize(message)
18
- this.tracer.decodeDataStreamsContext(convertToTextMap(message.headers))
43
+ this.tracer.decodeDataStreamsContext(headers)
19
44
  const edgeTags = ['direction:in', `group:${groupId}`, `topic:${topic}`, 'type:kafka']
20
45
  if (clusterId) {
21
46
  edgeTags.push(`kafka_cluster_id:${clusterId}`)
22
47
  }
23
48
  this.tracer.setCheckpoint(edgeTags, null, payloadSize)
24
49
  }
50
+
51
+ return ctx.currentStore
25
52
  }
26
53
  }
27
54
 
@@ -1,5 +1,8 @@
1
1
  'use strict'
2
2
 
3
+ // Capture real Date.now at module load time, before any test can install fake timers.
4
+ const realDateNow = Date.now.bind(Date)
5
+
3
6
  const CiPlugin = require('../../dd-trace/src/plugins/ci_plugin')
4
7
  const { storage } = require('../../datadog-core')
5
8
  const { getValueFromEnvSources } = require('../../dd-trace/src/config/helper')
@@ -323,8 +326,8 @@ class MochaPlugin extends CiPlugin {
323
326
  this.runningTestProbe = { file, line }
324
327
  this.testErrorStackIndex = stackIndex
325
328
  test._ddShouldWaitForHitProbe = true
326
- const waitUntil = Date.now() + BREAKPOINT_SET_GRACE_PERIOD_MS
327
- while (Date.now() < waitUntil) {
329
+ const waitUntil = realDateNow() + BREAKPOINT_SET_GRACE_PERIOD_MS
330
+ while (realDateNow() < waitUntil) {
328
331
  // TODO: To avoid a race condition, we should wait until `probeInformation.setProbePromise` has resolved.
329
332
  // However, Mocha doesn't have a mechanism for waiting asyncrounously here, so for now, we'll have to
330
333
  // fall back to a fixed syncronous delay.
@@ -10,7 +10,6 @@ const errorPages = new Set(['/404', '/500', '/_error', '/_not-found', '/_not-fou
10
10
 
11
11
  class NextPlugin extends ServerPlugin {
12
12
  static id = 'next'
13
- #requestsBySpanId = new WeakMap()
14
13
 
15
14
  constructor (...args) {
16
15
  super(...args)
@@ -35,11 +34,7 @@ class NextPlugin extends ServerPlugin {
35
34
 
36
35
  analyticsSampler.sample(span, this.config.measured, true)
37
36
 
38
- // Store request by span ID to handle cases where child spans are activated
39
- const spanId = span.context()._spanId
40
- this.#requestsBySpanId.set(spanId, req)
41
-
42
- return { ...store, span }
37
+ return { ...store, span, req }
43
38
  }
44
39
 
45
40
  error ({ span, error }) {
@@ -90,14 +85,7 @@ class NextPlugin extends ServerPlugin {
90
85
 
91
86
  if (!store) return
92
87
 
93
- const span = store.span
94
-
95
- const spanId = span.context()._spanId
96
- const parentSpanId = span.context()._parentId
97
-
98
- // Try current span first, then parent span.
99
- // This handles cases where pageLoad runs in a child span context
100
- const req = this.#requestsBySpanId.get(spanId) ?? this.#requestsBySpanId.get(parentSpanId)
88
+ const { span, req } = store
101
89
 
102
90
  // safeguard against missing req in complicated timeout scenarios
103
91
  if (!req) return
@@ -20,6 +20,7 @@ module.exports.init = function (tracerConfig) {
20
20
  `env:${tracerConfig.tags.env}`,
21
21
  `version:${tracerConfig.tags.version}`,
22
22
  ],
23
+ lookup: tracerConfig.lookup,
23
24
  })
24
25
  : new NoopDogStatsDClient()
25
26
 
@@ -21,12 +21,12 @@ for (const hook of Object.values(hooks)) {
21
21
 
22
22
  const modulesOfInterest = new Set()
23
23
 
24
- for (const instrumentation of Object.values(instrumentations)) {
24
+ for (const [name, instrumentation] of Object.entries(instrumentations)) {
25
25
  for (const entry of instrumentation) {
26
26
  if (entry.file) {
27
- modulesOfInterest.add(`${entry.name}/${entry.file}`) // e.g. "redis/my/file.js"
27
+ modulesOfInterest.add(`${name}/${entry.file}`) // e.g. "redis/my/file.js"
28
28
  } else {
29
- modulesOfInterest.add(entry.name) // e.g. "redis"
29
+ modulesOfInterest.add(name) // e.g. "redis"
30
30
  }
31
31
  }
32
32
  }
@@ -1,23 +1,16 @@
1
1
  'use strict'
2
2
 
3
3
  if (!global._ddtrace) {
4
- const TracerProxy = require('./src')
5
-
6
- Object.defineProperty(global, '_ddtrace', {
7
- value: new TracerProxy(),
8
- enumerable: false,
9
- configurable: true,
10
- writable: true,
11
- })
12
-
13
4
  const ddTraceSymbol = Symbol.for('dd-trace')
14
5
 
6
+ // Set up beforeExitHandlers before loading the tracer so that modules loaded
7
+ // during require('./src') can register handlers.
15
8
  Object.defineProperty(globalThis, ddTraceSymbol, {
16
9
  value: {
17
10
  beforeExitHandlers: new Set(),
18
11
  },
19
12
  enumerable: false,
20
- configurable: true, // Allow this to be overridden by loading the tracer
13
+ configurable: true,
21
14
  writable: false,
22
15
  })
23
16
 
@@ -29,6 +22,15 @@ if (!global._ddtrace) {
29
22
  }
30
23
  })
31
24
 
25
+ const TracerProxy = require('./src')
26
+
27
+ Object.defineProperty(global, '_ddtrace', {
28
+ value: new TracerProxy(),
29
+ enumerable: false,
30
+ configurable: true,
31
+ writable: true,
32
+ })
33
+
32
34
  global._ddtrace.default = global._ddtrace
33
35
  global._ddtrace.tracer = global._ddtrace
34
36
  }
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  const { URL, format } = require('url')
4
- const defaults = require('../config/defaults')
4
+ const { defaults } = require('../config/defaults')
5
5
 
6
6
  module.exports = { getAgentUrl }
7
7
 
@@ -12,7 +12,7 @@ module.exports = { getAgentUrl }
12
12
 
13
13
  /**
14
14
  * Gets the agent URL from config, constructing it from hostname/port if needed
15
- * @param {ReturnType<import('../config')>} config - Tracer configuration object
15
+ * @param {Partial<import('../config/config-base')>} config - Tracer configuration object
16
16
  * @returns {URL} The agent URL
17
17
  */
18
18
  function getAgentUrl (config) {
@@ -57,6 +57,10 @@ class AIGuard extends NoopAIGuard {
57
57
  #maxContentSize
58
58
  #meta
59
59
 
60
+ /**
61
+ * @param {import('../tracer')} tracer - Tracer instance
62
+ * @param {import('../config/config-base')} config - Tracer configuration
63
+ */
60
64
  constructor (tracer, config) {
61
65
  super()
62
66
 
@@ -164,6 +164,9 @@ function getBlockingAction (actions) {
164
164
  return actions?.redirect_request || actions?.block_request
165
165
  }
166
166
 
167
+ /**
168
+ * @param {import('../config/config-base')} config - Tracer configuration
169
+ */
167
170
  function setTemplates (config) {
168
171
  templateHtml = config.appsec.blockedTemplateHtml || blockedTemplates.html
169
172
 
@@ -168,7 +168,7 @@ class IastPlugin extends Plugin {
168
168
  loadChannel.subscribe(this.onInstrumentationLoadedListener)
169
169
 
170
170
  // check for already instrumented modules
171
- for (const name in instrumentations) {
171
+ for (const name of Object.keys(instrumentations)) {
172
172
  this._onInstrumentationLoaded(name)
173
173
  }
174
174
  }
@@ -3,7 +3,7 @@
3
3
 
4
4
  const log = require('../../../../log')
5
5
  const vulnerabilities = require('../../vulnerabilities')
6
- const defaults = require('../../../../config/defaults')
6
+ const { defaults } = require('../../../../config/defaults')
7
7
 
8
8
  const { contains, intersects, remove } = require('./range-utils')
9
9
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  const crypto = require('crypto')
4
4
 
5
- const defaults = require('../../../config/defaults')
5
+ const { defaults } = require('../../../config/defaults')
6
6
 
7
7
  const STRINGIFY_RANGE_KEY = 'DD_' + crypto.randomBytes(20).toString('hex')
8
8
  const STRINGIFY_SENSITIVE_KEY = STRINGIFY_RANGE_KEY + 'SENSITIVE'
@@ -76,6 +76,7 @@ function enableOrDisableAppsec (action, rcConfig, config, appsec) {
76
76
  appsec.disable()
77
77
  }
78
78
 
79
+ // TODO: Use configWithOrigin /generateTelemetry instead of manually constructing the change.
79
80
  updateConfig([
80
81
  {
81
82
  name: 'appsec.enabled',
@@ -26,6 +26,10 @@ class EventTrackingV2 {
26
26
  }
27
27
 
28
28
  class AppsecSdk {
29
+ /**
30
+ * @param {import('../../tracer')} tracer - Tracer instance
31
+ * @param {import('../../config/config-base')} config - Tracer configuration
32
+ */
29
33
  constructor (tracer, config) {
30
34
  this._tracer = tracer
31
35
  if (config) {
@@ -11,6 +11,9 @@ const probeIdToResolveBreakpointSet = new Map()
11
11
  const probeIdToResolveBreakpointRemove = new Map()
12
12
 
13
13
  class TestVisDynamicInstrumentation {
14
+ /**
15
+ * @param {import('../../config/config-base')} config - Tracer configuration
16
+ */
14
17
  constructor (config) {
15
18
  this._config = config
16
19
  this.worker = null
@@ -83,7 +86,6 @@ class TestVisDynamicInstrumentation {
83
86
  DD_TRACE_ENABLED: 'false',
84
87
  DD_TEST_FAILED_TEST_REPLAY_ENABLED: 'false',
85
88
  DD_CIVISIBILITY_MANUAL_API_ENABLED: 'false',
86
- DD_TRACING_ENABLED: 'false',
87
89
  DD_INSTRUMENTATION_TELEMETRY_ENABLED: 'false',
88
90
  },
89
91
  workerData: {
@@ -150,6 +152,9 @@ class TestVisDynamicInstrumentation {
150
152
 
151
153
  let dynamicInstrumentation
152
154
 
155
+ /**
156
+ * @param {import('../../config/config-base')} config - Tracer configuration
157
+ */
153
158
  module.exports = function createAndGetTestVisDynamicInstrumentation (config) {
154
159
  if (dynamicInstrumentation) {
155
160
  return dynamicInstrumentation
@@ -54,6 +54,10 @@ class TestApiManualPlugin extends CiPlugin {
54
54
  })
55
55
  }
56
56
 
57
+ /**
58
+ * @param {import('../../config/config-base')} config - Tracer configuration
59
+ * @param {boolean} shouldGetEnvironmentData - Whether to get environment data
60
+ */
57
61
  configure (config, shouldGetEnvironmentData) {
58
62
  this._config = config
59
63
  super.configure(config, shouldGetEnvironmentData)