dd-trace 5.8.0 → 5.9.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 +0 -1
- package/ci/init.js +3 -3
- package/package.json +4 -5
- package/packages/datadog-esbuild/index.js +2 -2
- package/packages/datadog-instrumentations/src/apollo-server.js +1 -1
- package/packages/datadog-instrumentations/src/apollo.js +5 -3
- package/packages/datadog-instrumentations/src/aws-sdk.js +4 -1
- package/packages/datadog-instrumentations/src/cassandra-driver.js +1 -1
- package/packages/datadog-instrumentations/src/cucumber.js +6 -2
- package/packages/datadog-instrumentations/src/fs.js +0 -1
- package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/hooks.js +56 -56
- package/packages/datadog-instrumentations/src/helpers/instrument.js +2 -2
- package/packages/datadog-instrumentations/src/http/client.js +1 -0
- package/packages/datadog-instrumentations/src/jest.js +12 -13
- package/packages/datadog-instrumentations/src/kafkajs.js +2 -1
- package/packages/datadog-instrumentations/src/ldapjs.js +2 -1
- package/packages/datadog-instrumentations/src/mocha.js +1 -1
- package/packages/datadog-instrumentations/src/mongodb-core.js +3 -3
- package/packages/datadog-instrumentations/src/net.js +1 -1
- package/packages/datadog-instrumentations/src/passport-utils.js +1 -0
- package/packages/datadog-instrumentations/src/playwright.js +8 -2
- package/packages/datadog-instrumentations/src/rhea.js +5 -2
- package/packages/datadog-instrumentations/src/tedious.js +1 -1
- package/packages/datadog-plugin-apollo/src/gateway/fetch.js +1 -1
- package/packages/datadog-plugin-apollo/src/gateway/plan.js +0 -1
- package/packages/datadog-plugin-apollo/src/gateway/request.js +2 -17
- package/packages/datadog-plugin-apollo/src/gateway/validate.js +6 -2
- package/packages/datadog-plugin-aws-sdk/src/base.js +3 -3
- package/packages/datadog-plugin-aws-sdk/src/services/cloudwatchlogs.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/dynamodb.js +2 -2
- package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/kinesis.js +1 -1
- 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 +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/sns.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +2 -2
- package/packages/datadog-plugin-child_process/src/index.js +1 -1
- package/packages/datadog-plugin-couchbase/src/index.js +2 -1
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +1 -0
- package/packages/datadog-plugin-fetch/src/index.js +1 -1
- package/packages/datadog-plugin-graphql/src/resolve.js +1 -1
- package/packages/datadog-plugin-grpc/src/client.js +2 -2
- package/packages/datadog-plugin-grpc/src/server.js +2 -2
- package/packages/datadog-plugin-http/src/client.js +2 -2
- package/packages/datadog-plugin-http2/src/client.js +4 -3
- package/packages/datadog-plugin-jest/src/index.js +1 -0
- package/packages/datadog-plugin-kafkajs/src/consumer.js +1 -1
- package/packages/datadog-plugin-kafkajs/src/producer.js +1 -1
- package/packages/datadog-plugin-next/src/index.js +1 -1
- package/packages/datadog-plugin-openai/src/index.js +4 -4
- package/packages/datadog-plugin-playwright/src/index.js +7 -2
- package/packages/datadog-plugin-rhea/src/consumer.js +1 -1
- package/packages/datadog-plugin-rhea/src/producer.js +1 -1
- package/packages/datadog-plugin-router/src/index.js +1 -1
- package/packages/datadog-plugin-tedious/src/index.js +1 -1
- package/packages/dd-trace/src/appsec/blocking.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/analyzers.js +17 -17
- package/packages/dd-trace/src/appsec/iast/analyzers/cookie-analyzer.js +1 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-secrets-rules.js +132 -132
- package/packages/dd-trace/src/appsec/iast/analyzers/hsts-header-missing-analyzer.js +1 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/nosql-injection-mongodb-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/overhead-controller.js +2 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/index.js +3 -3
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +4 -4
- package/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js +1 -1
- package/packages/dd-trace/src/appsec/iast/telemetry/namespaces.js +27 -18
- package/packages/dd-trace/src/appsec/iast/telemetry/span-tags.js +1 -1
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/sql-sensitive-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +7 -4
- package/packages/dd-trace/src/appsec/waf/waf_context_wrapper.js +2 -2
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +0 -1
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +2 -1
- package/packages/dd-trace/src/ci-visibility/test-api-manual/test-api-manual-plugin.js +1 -0
- package/packages/dd-trace/src/config.js +13 -13
- package/packages/dd-trace/src/datastreams/pathway.js +1 -1
- package/packages/dd-trace/src/datastreams/processor.js +15 -15
- package/packages/dd-trace/src/encode/agentless-ci-visibility.js +2 -2
- package/packages/dd-trace/src/encode/coverage-ci-visibility.js +1 -1
- package/packages/dd-trace/src/exporters/common/request.js +1 -0
- package/packages/dd-trace/src/exporters/span-stats/writer.js +0 -1
- package/packages/dd-trace/src/external-logger/src/index.js +5 -5
- package/packages/dd-trace/src/opentelemetry/span.js +2 -0
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +1 -1
- package/packages/dd-trace/src/opentracing/span.js +1 -1
- package/packages/dd-trace/src/plugins/apollo.js +3 -1
- package/packages/dd-trace/src/plugins/ci_plugin.js +2 -1
- package/packages/dd-trace/src/plugins/composite.js +3 -4
- package/packages/dd-trace/src/plugins/database.js +1 -0
- package/packages/dd-trace/src/plugins/index.js +43 -43
- package/packages/dd-trace/src/plugins/plugin.js +1 -1
- package/packages/dd-trace/src/plugins/tracing.js +1 -1
- package/packages/dd-trace/src/plugins/util/test.js +2 -1
- package/packages/dd-trace/src/plugins/util/web.js +4 -4
- package/packages/dd-trace/src/profiling/config.js +1 -1
- package/packages/dd-trace/src/profiling/loggers/console.js +1 -1
- package/packages/dd-trace/src/runtime_metrics.js +8 -5
- package/packages/dd-trace/src/serverless.js +3 -2
- package/packages/dd-trace/src/service-naming/schemas/v1/storage.js +0 -1
- package/packages/dd-trace/src/span_processor.js +2 -2
- package/packages/dd-trace/src/span_stats.js +1 -1
- package/packages/dd-trace/src/telemetry/dependencies.js +4 -5
- package/packages/dd-trace/src/telemetry/index.js +12 -13
- package/packages/dd-trace/src/telemetry/send-data.js +0 -1
- package/packages/dd-trace/src/util.js +7 -7
|
@@ -23,13 +23,10 @@ const fromEntries = Object.fromEntries || (entries =>
|
|
|
23
23
|
|
|
24
24
|
// eslint-disable-next-line max-len
|
|
25
25
|
const qsRegex = '(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?|public_?|access_?|secret_?)key(?:_?id)?|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:(?:\\s|%20)*(?:=|%3D)[^&]+|(?:"|%22)(?:\\s|%20)*(?::|%3A)(?:\\s|%20)*(?:"|%22)(?:%2[^2]|%[^2]|[^"%])+(?:"|%22))|bearer(?:\\s|%20)+[a-z0-9\\._\\-]+|token(?::|%3A)[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L](?:[\\w=-]|%3D)+\\.ey[I-L](?:[\\w=-]|%3D)+(?:\\.(?:[\\w.+\\/=-]|%3D|%2F|%2B)+)?|[\\-]{5}BEGIN(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY[\\-]{5}[^\\-]+[\\-]{5}END(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY|ssh-rsa(?:\\s|%20)*(?:[a-z0-9\\/\\.+]|%2F|%5C|%2B){100,}'
|
|
26
|
-
|
|
27
|
-
|public_?)key)|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)|bearer|authorization
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
ken|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:\\s*=[^;]|"\\s*:\\s*"[^"]+")|bearer\
|
|
31
|
-
\\s+[a-z0-9\\._\\-]+|token:[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L][\\w=-]+\\.ey[I-L][\\w=-]+(?:\\.[\\w.+\\/=-]+)?\
|
|
32
|
-
|[\\-]{5}BEGIN[a-z\\s]+PRIVATE\\sKEY[\\-]{5}[^\\-]+[\\-]{5}END[a-z\\s]+PRIVATE\\sKEY|ssh-rsa\\s*[a-z0-9\\/\\.+]{100,}`
|
|
26
|
+
// eslint-disable-next-line max-len
|
|
27
|
+
const defaultWafObfuscatorKeyRegex = '(?i)(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?|public_?)key)|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)|bearer|authorization'
|
|
28
|
+
// eslint-disable-next-line max-len
|
|
29
|
+
const defaultWafObfuscatorValueRegex = '(?i)(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?|public_?|access_?|secret_?)key(?:_?id)?|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:\\s*=[^;]|"\\s*:\\s*"[^"]+")|bearer\\s+[a-z0-9\\._\\-]+|token:[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L][\\w=-]+\\.ey[I-L][\\w=-]+(?:\\.[\\w.+\\/=-]+)?|[\\-]{5}BEGIN[a-z\\s]+PRIVATE\\sKEY[\\-]{5}[^\\-]+[\\-]{5}END[a-z\\s]+PRIVATE\\sKEY|ssh-rsa\\s*[a-z0-9\\/\\.+]{100,}'
|
|
33
30
|
|
|
34
31
|
function maybeFile (filepath) {
|
|
35
32
|
if (!filepath) return
|
|
@@ -132,9 +129,11 @@ class Config {
|
|
|
132
129
|
|
|
133
130
|
const DD_SERVICE_MAPPING = coalesce(
|
|
134
131
|
options.serviceMapping,
|
|
135
|
-
process.env.DD_SERVICE_MAPPING
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
process.env.DD_SERVICE_MAPPING
|
|
133
|
+
? fromEntries(
|
|
134
|
+
process.env.DD_SERVICE_MAPPING.split(',').map(x => x.trim().split(':'))
|
|
135
|
+
)
|
|
136
|
+
: {}
|
|
138
137
|
)
|
|
139
138
|
|
|
140
139
|
const DD_API_KEY = coalesce(
|
|
@@ -704,7 +703,7 @@ class Config {
|
|
|
704
703
|
_isCiVisibility () {
|
|
705
704
|
return coalesce(
|
|
706
705
|
this.options.isCiVisibility,
|
|
707
|
-
this._defaults
|
|
706
|
+
this._defaults.isCiVisibility
|
|
708
707
|
)
|
|
709
708
|
}
|
|
710
709
|
|
|
@@ -717,7 +716,8 @@ class Config {
|
|
|
717
716
|
|
|
718
717
|
_getHostname () {
|
|
719
718
|
const DD_CIVISIBILITY_AGENTLESS_URL = process.env.DD_CIVISIBILITY_AGENTLESS_URL
|
|
720
|
-
const url = DD_CIVISIBILITY_AGENTLESS_URL
|
|
719
|
+
const url = DD_CIVISIBILITY_AGENTLESS_URL
|
|
720
|
+
? new URL(DD_CIVISIBILITY_AGENTLESS_URL)
|
|
721
721
|
: getAgentUrl(this._getTraceAgentUrl(), this.options)
|
|
722
722
|
const DD_AGENT_HOST = coalesce(
|
|
723
723
|
this.options.hostname,
|
|
@@ -808,7 +808,7 @@ class Config {
|
|
|
808
808
|
}
|
|
809
809
|
this._setString(calc, 'dogstatsd.hostname', this._getHostname())
|
|
810
810
|
this._setBoolean(calc, 'isGitUploadEnabled',
|
|
811
|
-
calc
|
|
811
|
+
calc.isIntelligentTestRunnerEnabled && !isFalse(this._isCiVisibilityGitUploadEnabled()))
|
|
812
812
|
this._setBoolean(calc, 'spanComputePeerService', this._getSpanComputePeerService())
|
|
813
813
|
this._setBoolean(calc, 'stats.enabled', this._isTraceStatsComputationEnabled())
|
|
814
814
|
}
|
|
@@ -22,7 +22,7 @@ function computeHash (service, env, edgeTags, parentHash) {
|
|
|
22
22
|
return cache.get(key)
|
|
23
23
|
}
|
|
24
24
|
const currentHash = shaHash(`${service}${env}` + edgeTags.join(''))
|
|
25
|
-
const buf = Buffer.concat([
|
|
25
|
+
const buf = Buffer.concat([currentHash, parentHash], 16)
|
|
26
26
|
const val = shaHash(buf.toString())
|
|
27
27
|
cache.set(key, val)
|
|
28
28
|
return val
|
|
@@ -273,12 +273,12 @@ class DataStreamsProcessor {
|
|
|
273
273
|
const edgeLatencyNs = nowNs - edgeStartNs
|
|
274
274
|
const pathwayLatencyNs = nowNs - pathwayStartNs
|
|
275
275
|
const dataStreamsContext = {
|
|
276
|
-
hash
|
|
277
|
-
edgeStartNs
|
|
278
|
-
pathwayStartNs
|
|
276
|
+
hash,
|
|
277
|
+
edgeStartNs,
|
|
278
|
+
pathwayStartNs,
|
|
279
279
|
previousDirection: direction,
|
|
280
|
-
closestOppositeDirectionHash
|
|
281
|
-
closestOppositeDirectionEdgeStart
|
|
280
|
+
closestOppositeDirectionHash,
|
|
281
|
+
closestOppositeDirectionEdgeStart
|
|
282
282
|
}
|
|
283
283
|
if (direction === 'direction:out') {
|
|
284
284
|
// Add the header for this now, as the callee doesn't have access to context when producing
|
|
@@ -289,12 +289,12 @@ class DataStreamsProcessor {
|
|
|
289
289
|
}
|
|
290
290
|
const checkpoint = {
|
|
291
291
|
currentTimestamp: nowNs,
|
|
292
|
-
parentHash
|
|
293
|
-
hash
|
|
294
|
-
edgeTags
|
|
295
|
-
edgeLatencyNs
|
|
296
|
-
pathwayLatencyNs
|
|
297
|
-
payloadSize
|
|
292
|
+
parentHash,
|
|
293
|
+
hash,
|
|
294
|
+
edgeTags,
|
|
295
|
+
edgeLatencyNs,
|
|
296
|
+
pathwayLatencyNs,
|
|
297
|
+
payloadSize
|
|
298
298
|
}
|
|
299
299
|
this.recordCheckpoint(checkpoint, span)
|
|
300
300
|
return dataStreamsContext
|
|
@@ -320,7 +320,7 @@ class DataStreamsProcessor {
|
|
|
320
320
|
// TimeBuckets
|
|
321
321
|
const serializedBuckets = []
|
|
322
322
|
|
|
323
|
-
for (const [
|
|
323
|
+
for (const [timeNs, bucket] of this.buckets.entries()) {
|
|
324
324
|
const points = []
|
|
325
325
|
|
|
326
326
|
// bucket: StatsBucket
|
|
@@ -354,9 +354,9 @@ class DataStreamsProcessor {
|
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
module.exports = {
|
|
357
|
-
DataStreamsProcessor
|
|
358
|
-
StatsPoint
|
|
359
|
-
StatsBucket
|
|
357
|
+
DataStreamsProcessor,
|
|
358
|
+
StatsPoint,
|
|
359
|
+
StatsBucket,
|
|
360
360
|
Backlog,
|
|
361
361
|
TimeBuckets,
|
|
362
362
|
getMessageSize,
|
|
@@ -328,8 +328,8 @@ class AgentlessCiVisibilityEncoder extends AgentEncoder {
|
|
|
328
328
|
version: ENCODING_VERSION,
|
|
329
329
|
metadata: {
|
|
330
330
|
'*': {
|
|
331
|
-
|
|
332
|
-
|
|
331
|
+
language: 'javascript',
|
|
332
|
+
library_version: ddTraceVersion
|
|
333
333
|
}
|
|
334
334
|
},
|
|
335
335
|
events: []
|
|
@@ -51,11 +51,11 @@ class ExternalLogger {
|
|
|
51
51
|
|
|
52
52
|
const payload = {
|
|
53
53
|
...log,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
timestamp: Date.now(),
|
|
55
|
+
hostname: log.hostname || this.hostname,
|
|
56
|
+
ddsource: log.ddsource || this.ddsource,
|
|
57
|
+
service: log.service || this.service,
|
|
58
|
+
ddtags: logTags || undefined
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
this.enqueue(payload)
|
|
@@ -161,9 +161,11 @@ class Span {
|
|
|
161
161
|
get resource () {
|
|
162
162
|
return this._parentTracer.resource
|
|
163
163
|
}
|
|
164
|
+
|
|
164
165
|
get instrumentationLibrary () {
|
|
165
166
|
return this._parentTracer.instrumentationLibrary
|
|
166
167
|
}
|
|
168
|
+
|
|
167
169
|
get _spanProcessor () {
|
|
168
170
|
return this._parentTracer.getActiveSpanProcessor()
|
|
169
171
|
}
|
|
@@ -321,7 +321,7 @@ class TextMapPropagator {
|
|
|
321
321
|
}
|
|
322
322
|
const matches = headerValue.trim().match(traceparentExpr)
|
|
323
323
|
if (matches.length) {
|
|
324
|
-
const [
|
|
324
|
+
const [version, traceId, spanId, flags, tail] = matches.slice(1)
|
|
325
325
|
const traceparent = { version }
|
|
326
326
|
const tracestate = TraceState.fromString(carrier.tracestate)
|
|
327
327
|
if (invalidSegment.test(traceId)) return null
|
|
@@ -210,7 +210,7 @@ class DatadogSpan {
|
|
|
210
210
|
// Wrap the value as a string if it's not already a string
|
|
211
211
|
sanitizedAttributes[key] = typeof maybeScalar === 'string' ? maybeScalar : String(maybeScalar)
|
|
212
212
|
} else {
|
|
213
|
-
log.warn(
|
|
213
|
+
log.warn('Dropping span link attribute. It is not of an allowed type')
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
}
|
|
@@ -25,7 +25,9 @@ class ApolloBasePlugin extends TracingPlugin {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
end (ctx) {
|
|
28
|
-
|
|
28
|
+
// Only synchronous operations would have `result` or `error` on `end`.
|
|
29
|
+
if (!ctx.hasOwnProperty('result') && !ctx.hasOwnProperty('error')) return
|
|
30
|
+
ctx?.currentStore?.span?.finish()
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
asyncStart (ctx) {
|
|
@@ -42,7 +42,7 @@ module.exports = class CiPlugin extends Plugin {
|
|
|
42
42
|
}
|
|
43
43
|
this.tracer._exporter.getLibraryConfiguration(this.testConfiguration, (err, libraryConfig) => {
|
|
44
44
|
if (err) {
|
|
45
|
-
log.error(`
|
|
45
|
+
log.error(`Library configuration could not be fetched. ${err.message}`)
|
|
46
46
|
} else {
|
|
47
47
|
this.libraryConfig = libraryConfig
|
|
48
48
|
}
|
|
@@ -123,6 +123,7 @@ module.exports = class CiPlugin extends Plugin {
|
|
|
123
123
|
this.tracer._exporter.getKnownTests(this.testConfiguration, (err, knownTests) => {
|
|
124
124
|
if (err) {
|
|
125
125
|
log.error(`Known tests could not be fetched. ${err.message}`)
|
|
126
|
+
this.libraryConfig.isEarlyFlakeDetectionEnabled = false
|
|
126
127
|
}
|
|
127
128
|
onDone({ err, knownTests })
|
|
128
129
|
})
|
|
@@ -14,10 +14,9 @@ class CompositePlugin extends Plugin {
|
|
|
14
14
|
configure (config) {
|
|
15
15
|
super.configure(config)
|
|
16
16
|
for (const name in this.constructor.plugins) {
|
|
17
|
-
const pluginConfig = config[name] === false
|
|
18
|
-
|
|
19
|
-
...config[name]
|
|
20
|
-
}
|
|
17
|
+
const pluginConfig = config[name] === false
|
|
18
|
+
? false
|
|
19
|
+
: { ...config, ...config[name] }
|
|
21
20
|
|
|
22
21
|
this[name].configure(pluginConfig)
|
|
23
22
|
}
|
|
@@ -18,66 +18,66 @@ module.exports = {
|
|
|
18
18
|
get '@opensearch-project/opensearch' () { return require('../../../datadog-plugin-opensearch/src') },
|
|
19
19
|
get '@redis/client' () { return require('../../../datadog-plugin-redis/src') },
|
|
20
20
|
get '@smithy/smithy-client' () { return require('../../../datadog-plugin-aws-sdk/src') },
|
|
21
|
-
get
|
|
22
|
-
get
|
|
23
|
-
get
|
|
21
|
+
get aerospike () { return require('../../../datadog-plugin-aerospike/src') },
|
|
22
|
+
get amqp10 () { return require('../../../datadog-plugin-amqp10/src') },
|
|
23
|
+
get amqplib () { return require('../../../datadog-plugin-amqplib/src') },
|
|
24
24
|
get 'aws-sdk' () { return require('../../../datadog-plugin-aws-sdk/src') },
|
|
25
|
-
get
|
|
25
|
+
get bunyan () { return require('../../../datadog-plugin-bunyan/src') },
|
|
26
26
|
get 'cassandra-driver' () { return require('../../../datadog-plugin-cassandra-driver/src') },
|
|
27
|
-
get
|
|
28
|
-
get
|
|
29
|
-
get
|
|
30
|
-
get
|
|
31
|
-
get
|
|
32
|
-
get
|
|
33
|
-
get
|
|
34
|
-
get
|
|
27
|
+
get child_process () { return require('../../../datadog-plugin-child_process/src') },
|
|
28
|
+
get connect () { return require('../../../datadog-plugin-connect/src') },
|
|
29
|
+
get couchbase () { return require('../../../datadog-plugin-couchbase/src') },
|
|
30
|
+
get cypress () { return require('../../../datadog-plugin-cypress/src') },
|
|
31
|
+
get dns () { return require('../../../datadog-plugin-dns/src') },
|
|
32
|
+
get elasticsearch () { return require('../../../datadog-plugin-elasticsearch/src') },
|
|
33
|
+
get express () { return require('../../../datadog-plugin-express/src') },
|
|
34
|
+
get fastify () { return require('../../../datadog-plugin-fastify/src') },
|
|
35
35
|
get 'find-my-way' () { return require('../../../datadog-plugin-find-my-way/src') },
|
|
36
|
-
get
|
|
37
|
-
get
|
|
38
|
-
get
|
|
39
|
-
get
|
|
40
|
-
get
|
|
41
|
-
get
|
|
42
|
-
get
|
|
36
|
+
get graphql () { return require('../../../datadog-plugin-graphql/src') },
|
|
37
|
+
get grpc () { return require('../../../datadog-plugin-grpc/src') },
|
|
38
|
+
get hapi () { return require('../../../datadog-plugin-hapi/src') },
|
|
39
|
+
get http () { return require('../../../datadog-plugin-http/src') },
|
|
40
|
+
get http2 () { return require('../../../datadog-plugin-http2/src') },
|
|
41
|
+
get https () { return require('../../../datadog-plugin-http/src') },
|
|
42
|
+
get ioredis () { return require('../../../datadog-plugin-ioredis/src') },
|
|
43
43
|
get 'jest-circus' () { return require('../../../datadog-plugin-jest/src') },
|
|
44
44
|
get 'jest-config' () { return require('../../../datadog-plugin-jest/src') },
|
|
45
45
|
get 'jest-environment-node' () { return require('../../../datadog-plugin-jest/src') },
|
|
46
46
|
get 'jest-environment-jsdom' () { return require('../../../datadog-plugin-jest/src') },
|
|
47
47
|
get 'jest-jasmine2' () { return require('../../../datadog-plugin-jest/src') },
|
|
48
48
|
get 'jest-worker' () { return require('../../../datadog-plugin-jest/src') },
|
|
49
|
-
get
|
|
49
|
+
get koa () { return require('../../../datadog-plugin-koa/src') },
|
|
50
50
|
get 'koa-router' () { return require('../../../datadog-plugin-koa/src') },
|
|
51
|
-
get
|
|
52
|
-
get
|
|
53
|
-
get
|
|
51
|
+
get kafkajs () { return require('../../../datadog-plugin-kafkajs/src') },
|
|
52
|
+
get mariadb () { return require('../../../datadog-plugin-mariadb/src') },
|
|
53
|
+
get memcached () { return require('../../../datadog-plugin-memcached/src') },
|
|
54
54
|
get 'microgateway-core' () { return require('../../../datadog-plugin-microgateway-core/src') },
|
|
55
|
-
get
|
|
55
|
+
get mocha () { return require('../../../datadog-plugin-mocha/src') },
|
|
56
56
|
get 'mocha-each' () { return require('../../../datadog-plugin-mocha/src') },
|
|
57
|
-
get
|
|
58
|
-
get
|
|
57
|
+
get moleculer () { return require('../../../datadog-plugin-moleculer/src') },
|
|
58
|
+
get mongodb () { return require('../../../datadog-plugin-mongodb-core/src') },
|
|
59
59
|
get 'mongodb-core' () { return require('../../../datadog-plugin-mongodb-core/src') },
|
|
60
|
-
get
|
|
61
|
-
get
|
|
62
|
-
get
|
|
63
|
-
get
|
|
60
|
+
get mysql () { return require('../../../datadog-plugin-mysql/src') },
|
|
61
|
+
get mysql2 () { return require('../../../datadog-plugin-mysql2/src') },
|
|
62
|
+
get net () { return require('../../../datadog-plugin-net/src') },
|
|
63
|
+
get next () { return require('../../../datadog-plugin-next/src') },
|
|
64
64
|
get 'node:dns' () { return require('../../../datadog-plugin-dns/src') },
|
|
65
65
|
get 'node:http' () { return require('../../../datadog-plugin-http/src') },
|
|
66
66
|
get 'node:http2' () { return require('../../../datadog-plugin-http2/src') },
|
|
67
67
|
get 'node:https' () { return require('../../../datadog-plugin-http/src') },
|
|
68
68
|
get 'node:net' () { return require('../../../datadog-plugin-net/src') },
|
|
69
|
-
get
|
|
70
|
-
get
|
|
71
|
-
get
|
|
72
|
-
get
|
|
73
|
-
get
|
|
69
|
+
get oracledb () { return require('../../../datadog-plugin-oracledb/src') },
|
|
70
|
+
get openai () { return require('../../../datadog-plugin-openai/src') },
|
|
71
|
+
get paperplane () { return require('../../../datadog-plugin-paperplane/src') },
|
|
72
|
+
get pg () { return require('../../../datadog-plugin-pg/src') },
|
|
73
|
+
get pino () { return require('../../../datadog-plugin-pino/src') },
|
|
74
74
|
get 'pino-pretty' () { return require('../../../datadog-plugin-pino/src') },
|
|
75
|
-
get
|
|
76
|
-
get
|
|
77
|
-
get
|
|
78
|
-
get
|
|
79
|
-
get
|
|
80
|
-
get
|
|
81
|
-
get
|
|
82
|
-
get
|
|
75
|
+
get playwright () { return require('../../../datadog-plugin-playwright/src') },
|
|
76
|
+
get redis () { return require('../../../datadog-plugin-redis/src') },
|
|
77
|
+
get restify () { return require('../../../datadog-plugin-restify/src') },
|
|
78
|
+
get rhea () { return require('../../../datadog-plugin-rhea/src') },
|
|
79
|
+
get router () { return require('../../../datadog-plugin-router/src') },
|
|
80
|
+
get sharedb () { return require('../../../datadog-plugin-sharedb/src') },
|
|
81
|
+
get tedious () { return require('../../../datadog-plugin-tedious/src') },
|
|
82
|
+
get winston () { return require('../../../datadog-plugin-winston/src') }
|
|
83
83
|
}
|
|
@@ -94,7 +94,7 @@ class TracingPlugin extends Plugin {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
addError (error, span = this.activeSpan) {
|
|
97
|
-
if (!span._spanContext._tags
|
|
97
|
+
if (!span._spanContext._tags.error) {
|
|
98
98
|
// Errors may be wrapped in a context.
|
|
99
99
|
error = (error && error.error) || error
|
|
100
100
|
span.setTag('error', error || 1)
|
|
@@ -288,7 +288,8 @@ function getTestSuitePath (testSuiteAbsolutePath, sourceRoot) {
|
|
|
288
288
|
return sourceRoot
|
|
289
289
|
}
|
|
290
290
|
const testSuitePath = testSuiteAbsolutePath === sourceRoot
|
|
291
|
-
? testSuiteAbsolutePath
|
|
291
|
+
? testSuiteAbsolutePath
|
|
292
|
+
: path.relative(sourceRoot, testSuiteAbsolutePath)
|
|
292
293
|
|
|
293
294
|
return testSuitePath.replace(path.sep, '/')
|
|
294
295
|
}
|
|
@@ -63,7 +63,7 @@ const web = {
|
|
|
63
63
|
if (!span) return
|
|
64
64
|
|
|
65
65
|
span.context()._name = `${name}.request`
|
|
66
|
-
span.context()._tags
|
|
66
|
+
span.context()._tags.component = name
|
|
67
67
|
|
|
68
68
|
web.setConfig(req, config)
|
|
69
69
|
},
|
|
@@ -263,7 +263,7 @@ const web = {
|
|
|
263
263
|
const context = contexts.get(req)
|
|
264
264
|
const span = context.span
|
|
265
265
|
const error = context.error
|
|
266
|
-
const hasExistingError = span.context()._tags
|
|
266
|
+
const hasExistingError = span.context()._tags.error || span.context()._tags[ERROR_MESSAGE]
|
|
267
267
|
|
|
268
268
|
if (!hasExistingError && !context.config.validateStatus(statusCode)) {
|
|
269
269
|
span.setTag(ERROR, error || true)
|
|
@@ -405,7 +405,7 @@ function addAllowHeaders (req, res, headers) {
|
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
function isOriginAllowed (req, headers) {
|
|
408
|
-
const origin = req.headers
|
|
408
|
+
const origin = req.headers.origin
|
|
409
409
|
const allowOrigin = headers['access-control-allow-origin']
|
|
410
410
|
|
|
411
411
|
return origin && (allowOrigin === '*' || allowOrigin === origin)
|
|
@@ -498,7 +498,7 @@ function extractURL (req) {
|
|
|
498
498
|
return `${headers[HTTP2_HEADER_SCHEME]}://${headers[HTTP2_HEADER_AUTHORITY]}${headers[HTTP2_HEADER_PATH]}`
|
|
499
499
|
} else {
|
|
500
500
|
const protocol = getProtocol(req)
|
|
501
|
-
return `${protocol}://${req.headers
|
|
501
|
+
return `${protocol}://${req.headers.host}${req.originalUrl || req.url}`
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
504
|
|
|
@@ -238,12 +238,15 @@ function captureHistograms () {
|
|
|
238
238
|
*
|
|
239
239
|
* performance.eventLoopUtilization available in Node.js >= v14.10, >= v12.19, >= v16
|
|
240
240
|
*/
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
let captureELU = () => {}
|
|
242
|
+
if ('eventLoopUtilization' in performance) {
|
|
243
|
+
captureELU = () => {
|
|
244
|
+
// if elu is undefined (first run) the measurement is from start of process
|
|
245
|
+
elu = performance.eventLoopUtilization(elu)
|
|
244
246
|
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
+
client.gauge('runtime.node.event_loop.utilization', elu.utilization)
|
|
248
|
+
}
|
|
249
|
+
}
|
|
247
250
|
|
|
248
251
|
function captureCommonMetrics () {
|
|
249
252
|
captureMemoryUsage()
|
|
@@ -4,7 +4,7 @@ const log = require('./log')
|
|
|
4
4
|
|
|
5
5
|
function maybeStartServerlessMiniAgent (config) {
|
|
6
6
|
if (process.platform !== 'win32' && process.platform !== 'linux') {
|
|
7
|
-
log.error(
|
|
7
|
+
log.error('Serverless Mini Agent is only supported on Windows and Linux.')
|
|
8
8
|
return
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -34,7 +34,8 @@ function getRustBinaryPath (config) {
|
|
|
34
34
|
|
|
35
35
|
const rustBinaryPathRoot = config.isGCPFunction ? '/workspace' : '/home/site/wwwroot'
|
|
36
36
|
const rustBinaryPathOsFolder = process.platform === 'win32'
|
|
37
|
-
? 'datadog-serverless-agent-windows-amd64'
|
|
37
|
+
? 'datadog-serverless-agent-windows-amd64'
|
|
38
|
+
: 'datadog-serverless-agent-linux-amd64'
|
|
38
39
|
|
|
39
40
|
const rustBinaryExtension = process.platform === 'win32' ? '.exe' : ''
|
|
40
41
|
|
|
@@ -181,7 +181,7 @@ class SpanStatsProcessor {
|
|
|
181
181
|
const { bucketSizeNs } = this
|
|
182
182
|
const serializedBuckets = []
|
|
183
183
|
|
|
184
|
-
for (const [
|
|
184
|
+
for (const [timeNs, bucket] of this.buckets.entries()) {
|
|
185
185
|
const bucketAggStats = []
|
|
186
186
|
|
|
187
187
|
for (const stats of bucket.values()) {
|
|
@@ -12,7 +12,7 @@ const savedDependenciesToSend = new Set()
|
|
|
12
12
|
const detectedDependencyKeys = new Set()
|
|
13
13
|
const detectedDependencyVersions = new Set()
|
|
14
14
|
|
|
15
|
-
const FILE_URI_START =
|
|
15
|
+
const FILE_URI_START = 'file://'
|
|
16
16
|
const moduleLoadStartChannel = dc.channel('dd-trace:moduleLoadStart')
|
|
17
17
|
|
|
18
18
|
let immediate, config, application, host, initialLoad
|
|
@@ -21,12 +21,11 @@ let getRetryData
|
|
|
21
21
|
let updateRetryData
|
|
22
22
|
|
|
23
23
|
function createBatchPayload (payload) {
|
|
24
|
-
const batchPayload =
|
|
25
|
-
|
|
26
|
-
batchPayload.push({
|
|
24
|
+
const batchPayload = payload.map(item => {
|
|
25
|
+
return {
|
|
27
26
|
request_type: item.reqType,
|
|
28
27
|
payload: item.payload
|
|
29
|
-
}
|
|
28
|
+
}
|
|
30
29
|
})
|
|
31
30
|
|
|
32
31
|
return batchPayload
|