dd-trace 5.57.1 → 5.59.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 +3 -1
- package/ci/cypress/after-run.js +2 -0
- package/ci/cypress/after-spec.js +2 -0
- package/ci/cypress/plugin.js +2 -0
- package/ci/cypress/polyfills.js +2 -0
- package/ci/cypress/support.js +2 -0
- package/ci/init.js +2 -0
- package/index.d.ts +7 -0
- package/init.js +1 -6
- package/initialize.mjs +2 -0
- package/package.json +40 -9
- package/packages/datadog-code-origin/index.js +14 -9
- package/packages/datadog-instrumentations/src/apollo.js +7 -10
- package/packages/datadog-instrumentations/src/avsc.js +2 -0
- package/packages/datadog-instrumentations/src/azure-functions.js +1 -1
- package/packages/datadog-instrumentations/src/child_process.js +22 -43
- package/packages/datadog-instrumentations/src/cucumber.js +10 -8
- package/packages/datadog-instrumentations/src/cypress.js +2 -0
- package/packages/datadog-instrumentations/src/fastify.js +19 -1
- package/packages/datadog-instrumentations/src/graphql.js +9 -0
- package/packages/datadog-instrumentations/src/helpers/hooks.js +1 -0
- package/packages/datadog-instrumentations/src/helpers/register.js +2 -2
- package/packages/datadog-instrumentations/src/hono.js +102 -0
- package/packages/datadog-instrumentations/src/jest.js +1 -1
- package/packages/datadog-instrumentations/src/langchain.js +21 -0
- package/packages/datadog-instrumentations/src/mocha/common.js +2 -0
- package/packages/datadog-instrumentations/src/mocha.js +2 -0
- package/packages/datadog-instrumentations/src/mysql2.js +6 -6
- package/packages/datadog-instrumentations/src/next.js +3 -1
- package/packages/datadog-instrumentations/src/nyc.js +2 -0
- package/packages/datadog-instrumentations/src/oracledb.js +24 -2
- package/packages/datadog-instrumentations/src/orchestrion-config/index.js +32 -0
- package/packages/datadog-instrumentations/src/playwright.js +5 -1
- package/packages/datadog-instrumentations/src/protobufjs.js +2 -0
- package/packages/datadog-instrumentations/src/selenium.js +2 -0
- package/packages/datadog-instrumentations/src/tedious.js +12 -17
- package/packages/datadog-instrumentations/src/vitest.js +2 -0
- package/packages/datadog-plugin-avsc/src/index.js +2 -0
- package/packages/datadog-plugin-avsc/src/schema_iterator.js +2 -0
- package/packages/datadog-plugin-aws-sdk/src/base.js +51 -1
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/index.js +2 -0
- package/packages/datadog-plugin-child_process/src/index.js +30 -10
- package/packages/datadog-plugin-child_process/src/scrub-cmd-params.js +1 -1
- package/packages/datadog-plugin-cypress/src/after-run.js +2 -0
- package/packages/datadog-plugin-cypress/src/after-spec.js +2 -0
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +8 -3
- package/packages/datadog-plugin-cypress/src/index.js +2 -0
- package/packages/datadog-plugin-cypress/src/plugin.js +2 -0
- package/packages/datadog-plugin-cypress/src/support.js +21 -25
- package/packages/datadog-plugin-google-cloud-vertexai/src/utils.js +2 -0
- package/packages/datadog-plugin-graphql/src/tools/index.js +0 -2
- package/packages/datadog-plugin-graphql/src/tools/signature.js +0 -2
- package/packages/datadog-plugin-graphql/src/tools/transforms.js +0 -2
- package/packages/datadog-plugin-graphql/src/utils.js +2 -0
- package/packages/datadog-plugin-hono/src/index.js +28 -0
- package/packages/datadog-plugin-http/src/client.js +3 -4
- package/packages/datadog-plugin-http2/src/client.js +9 -8
- package/packages/datadog-plugin-jest/src/index.js +2 -0
- package/packages/datadog-plugin-jest/src/util.js +2 -0
- package/packages/datadog-plugin-kafkajs/src/batch-consumer.js +2 -0
- package/packages/datadog-plugin-langchain/src/handlers/chain.js +1 -1
- package/packages/datadog-plugin-langchain/src/handlers/language_models/chat_model.js +1 -1
- package/packages/datadog-plugin-langchain/src/handlers/language_models/llm.js +1 -1
- package/packages/datadog-plugin-langchain/src/tracing.js +36 -4
- package/packages/datadog-plugin-nyc/src/index.js +2 -0
- package/packages/datadog-plugin-oracledb/src/connection-parser.js +37 -0
- package/packages/datadog-plugin-oracledb/src/index.js +15 -17
- package/packages/datadog-plugin-protobufjs/src/index.js +2 -0
- package/packages/datadog-plugin-protobufjs/src/schema_iterator.js +2 -0
- package/packages/datadog-plugin-selenium/src/index.js +2 -0
- package/packages/datadog-plugin-tedious/src/index.js +10 -9
- package/packages/datadog-plugin-vitest/src/index.js +2 -0
- package/packages/dd-trace/src/appsec/iast/analyzers/injection-analyzer.js +6 -4
- package/packages/dd-trace/src/appsec/iast/analyzers/ssrf-analyzer.js +9 -0
- package/packages/dd-trace/src/appsec/iast/iast-context.js +5 -1
- package/packages/dd-trace/src/appsec/iast/index.js +2 -0
- package/packages/dd-trace/src/appsec/iast/overhead-controller.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/operations-taint-object.js +5 -2
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter-esm.mjs +0 -2
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +2 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-regex.js +2 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/index.js +1 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities.js +2 -0
- package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +3 -3
- package/packages/dd-trace/src/appsec/rasp/fs-plugin.js +18 -11
- package/packages/dd-trace/src/appsec/rasp/utils.js +1 -1
- package/packages/dd-trace/src/appsec/recommended.json +88 -2
- package/packages/dd-trace/src/appsec/reporter.js +68 -14
- package/packages/dd-trace/src/appsec/rule_manager.js +63 -171
- package/packages/dd-trace/src/appsec/sdk/track_event.js +3 -5
- package/packages/dd-trace/src/appsec/stack_trace.js +11 -11
- package/packages/dd-trace/src/appsec/telemetry/common.js +2 -2
- package/packages/dd-trace/src/appsec/telemetry/index.js +8 -0
- package/packages/dd-trace/src/appsec/telemetry/waf.js +5 -3
- package/packages/dd-trace/src/appsec/waf/diagnostics.js +15 -0
- package/packages/dd-trace/src/appsec/waf/index.js +47 -6
- package/packages/dd-trace/src/appsec/waf/waf_context_wrapper.js +2 -2
- package/packages/dd-trace/src/appsec/waf/waf_manager.js +22 -12
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/index.js +3 -3
- package/packages/dd-trace/src/ci-visibility/early-flake-detection/get-known-tests.js +2 -0
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +3 -1
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +2 -0
- package/packages/dd-trace/src/ci-visibility/log-submission/log-submission-plugin.js +2 -0
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +2 -0
- package/packages/dd-trace/src/ci-visibility/telemetry.js +2 -0
- package/packages/dd-trace/src/ci-visibility/test-api-manual/test-api-manual-plugin.js +2 -0
- package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +7 -3
- package/packages/dd-trace/src/config.js +15 -4
- package/packages/dd-trace/src/config_stable.js +2 -0
- package/packages/dd-trace/src/constants.js +1 -2
- package/packages/dd-trace/src/datastreams/checkpointer.js +2 -0
- package/packages/dd-trace/src/datastreams/context.js +2 -0
- package/packages/dd-trace/src/datastreams/encoding.js +2 -0
- package/packages/dd-trace/src/datastreams/fnv.js +2 -0
- package/packages/dd-trace/src/datastreams/pathway.js +11 -9
- package/packages/dd-trace/src/datastreams/processor.js +8 -7
- package/packages/dd-trace/src/datastreams/schemas/schema.js +2 -0
- package/packages/dd-trace/src/datastreams/schemas/schema_builder.js +45 -36
- package/packages/dd-trace/src/datastreams/schemas/schema_sampler.js +2 -0
- package/packages/dd-trace/src/datastreams/writer.js +2 -0
- package/packages/dd-trace/src/debugger/devtools_client/index.js +12 -4
- package/packages/dd-trace/src/debugger/devtools_client/inspector_promises_polyfill.js +2 -0
- package/packages/dd-trace/src/debugger/devtools_client/remote_config.js +8 -5
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/symbols.js +1 -1
- package/packages/dd-trace/src/debugger/index.js +36 -9
- package/packages/dd-trace/src/encode/tags-processors.js +2 -0
- package/packages/dd-trace/src/exporters/common/agent-info-exporter.js +2 -0
- package/packages/dd-trace/src/exporters/common/request.js +1 -1
- package/packages/dd-trace/src/exporters/common/util.js +2 -0
- package/packages/dd-trace/src/exporters/span-stats/index.js +2 -0
- package/packages/dd-trace/src/exporters/span-stats/writer.js +2 -0
- package/packages/dd-trace/src/external-logger/src/index.js +2 -0
- package/packages/dd-trace/src/git_metadata_tagger.js +2 -0
- package/packages/dd-trace/src/git_properties.js +2 -0
- package/packages/dd-trace/src/guardrails/index.js +3 -4
- package/packages/dd-trace/src/guardrails/log.js +2 -2
- package/packages/dd-trace/src/guardrails/telemetry.js +16 -14
- package/packages/dd-trace/src/guardrails/util.js +0 -2
- package/packages/dd-trace/src/heap_snapshots.js +58 -0
- package/packages/dd-trace/src/llmobs/noop.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/bedrockruntime.js +2 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/index.js +5 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/tool.js +15 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/vectorstore.js +36 -0
- package/packages/dd-trace/src/llmobs/plugins/langchain/index.js +47 -4
- package/packages/dd-trace/src/llmobs/span_processor.js +1 -1
- package/packages/dd-trace/src/llmobs/tagger.js +10 -1
- package/packages/dd-trace/src/log/log.js +1 -1
- package/packages/dd-trace/src/noop/dogstatsd.js +2 -0
- package/packages/dd-trace/src/opentracing/propagation/text_map_dsm.js +2 -0
- package/packages/dd-trace/src/opentracing/span.js +1 -1
- package/packages/dd-trace/src/payload-tagging/config/index.js +2 -0
- package/packages/dd-trace/src/payload-tagging/index.js +3 -1
- package/packages/dd-trace/src/payload-tagging/tagging.js +4 -2
- package/packages/dd-trace/src/plugins/apollo.js +2 -0
- package/packages/dd-trace/src/plugins/ci_plugin.js +8 -3
- package/packages/dd-trace/src/plugins/index.js +1 -0
- package/packages/dd-trace/src/plugins/outbound.js +7 -0
- package/packages/dd-trace/src/plugins/util/ci.js +2 -0
- package/packages/dd-trace/src/plugins/util/env.js +2 -0
- package/packages/dd-trace/src/plugins/util/git.js +40 -5
- package/packages/dd-trace/src/plugins/util/inferred_proxy.js +2 -0
- package/packages/dd-trace/src/plugins/util/llm.js +2 -0
- package/packages/dd-trace/src/plugins/util/serverless.js +2 -0
- package/packages/dd-trace/src/plugins/util/stacktrace.js +178 -50
- package/packages/dd-trace/src/plugins/util/tags.js +17 -1
- package/packages/dd-trace/src/plugins/util/test.js +9 -4
- package/packages/dd-trace/src/plugins/util/url.js +2 -0
- package/packages/dd-trace/src/plugins/util/user-provided-git.js +2 -0
- package/packages/dd-trace/src/profiling/exporters/event_serializer.js +4 -0
- package/packages/dd-trace/src/profiling/profiler.js +89 -70
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns.js +2 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns_lookup.js +2 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns_lookupservice.js +2 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns_resolve.js +2 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/dns_reverse.js +2 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/event.js +2 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/fs.js +2 -0
- package/packages/dd-trace/src/profiling/profilers/event_plugins/net.js +2 -0
- package/packages/dd-trace/src/profiling/profilers/events.js +2 -0
- package/packages/dd-trace/src/profiling/profilers/wall.js +2 -2
- package/packages/dd-trace/src/profiling/webspan-utils.js +2 -0
- package/packages/dd-trace/src/proxy.js +4 -0
- package/packages/dd-trace/src/remote_config/capabilities.js +3 -1
- package/packages/dd-trace/src/remote_config/index.js +4 -0
- package/packages/dd-trace/src/service-naming/index.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/definition.js +4 -9
- package/packages/dd-trace/src/service-naming/schemas/util.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/graphql.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/index.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/messaging.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/serverless.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/storage.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/web.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/graphql.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/index.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/messaging.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/serverless.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/storage.js +4 -1
- package/packages/dd-trace/src/service-naming/schemas/v1/web.js +2 -0
- package/packages/dd-trace/src/span_stats.js +2 -0
- package/packages/dd-trace/src/supported-configurations.json +5 -0
- package/packages/dd-trace/src/telemetry/send-data.js +2 -0
- package/register.js +4 -0
- package/version.js +0 -3
- package/packages/dd-trace/src/payload-tagging/jsonpath-plus.js +0 -2094
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const shimmer = require('../../datadog-shimmer')
|
|
4
|
+
const {
|
|
5
|
+
addHook,
|
|
6
|
+
channel
|
|
7
|
+
} = require('./helpers/instrument')
|
|
8
|
+
|
|
9
|
+
const routeChannel = channel('apm:hono:request:route')
|
|
10
|
+
const handleChannel = channel('apm:hono:request:handle')
|
|
11
|
+
const errorChannel = channel('apm:hono:request:error')
|
|
12
|
+
|
|
13
|
+
function wrapFetch (fetch) {
|
|
14
|
+
return function (request, env, executionCtx) {
|
|
15
|
+
handleChannel.publish({ req: env.incoming })
|
|
16
|
+
return fetch.apply(this, arguments)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function wrapCompose (compose) {
|
|
21
|
+
return function (middleware, onError, onNotFound) {
|
|
22
|
+
const instrumentedOnError = (...args) => {
|
|
23
|
+
const [error, context] = args
|
|
24
|
+
const req = context.env.incoming
|
|
25
|
+
errorChannel.publish({ req, error })
|
|
26
|
+
return onError(...args)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const instrumentedMiddlewares = middleware.map(h => {
|
|
30
|
+
const [[fn, meta], params] = h
|
|
31
|
+
|
|
32
|
+
// TODO: handle middleware instrumentation
|
|
33
|
+
const instrumentedFn = (...args) => {
|
|
34
|
+
const context = args[0]
|
|
35
|
+
const req = context.env.incoming
|
|
36
|
+
const route = meta.path
|
|
37
|
+
routeChannel.publish({
|
|
38
|
+
req,
|
|
39
|
+
route
|
|
40
|
+
})
|
|
41
|
+
return fn(...args)
|
|
42
|
+
}
|
|
43
|
+
return [[instrumentedFn, meta], params]
|
|
44
|
+
})
|
|
45
|
+
return compose.apply(this, [instrumentedMiddlewares, instrumentedOnError, onNotFound])
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
addHook({
|
|
50
|
+
name: 'hono',
|
|
51
|
+
versions: ['>=4'],
|
|
52
|
+
file: 'dist/hono.js'
|
|
53
|
+
}, hono => {
|
|
54
|
+
class Hono extends hono.Hono {
|
|
55
|
+
constructor (...args) {
|
|
56
|
+
super(...args)
|
|
57
|
+
shimmer.wrap(this, 'fetch', wrapFetch)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
hono.Hono = Hono
|
|
62
|
+
|
|
63
|
+
return hono
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
addHook({
|
|
67
|
+
name: 'hono',
|
|
68
|
+
versions: ['>=4'],
|
|
69
|
+
file: 'dist/cjs/hono.js'
|
|
70
|
+
}, hono => {
|
|
71
|
+
class Hono extends hono.Hono {
|
|
72
|
+
constructor (...args) {
|
|
73
|
+
super(...args)
|
|
74
|
+
shimmer.wrap(this, 'fetch', wrapFetch)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return Object.create(hono, {
|
|
79
|
+
Hono: {
|
|
80
|
+
get () {
|
|
81
|
+
return Hono
|
|
82
|
+
},
|
|
83
|
+
enumerable: true,
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
addHook({
|
|
89
|
+
name: 'hono',
|
|
90
|
+
versions: ['>=4'],
|
|
91
|
+
file: 'dist/cjs/compose.js'
|
|
92
|
+
}, Compose => {
|
|
93
|
+
return shimmer.wrap(Compose, 'compose', wrapCompose, { replaceGetter: true })
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
addHook({
|
|
97
|
+
name: 'hono',
|
|
98
|
+
versions: ['>=4'],
|
|
99
|
+
file: 'dist/compose.js'
|
|
100
|
+
}, Compose => {
|
|
101
|
+
return shimmer.wrap(Compose, 'compose', wrapCompose)
|
|
102
|
+
})
|
|
@@ -1071,7 +1071,7 @@ function jestAdapterWrapper (jestAdapter, jestVersion) {
|
|
|
1071
1071
|
const adapter = jestAdapter.default ?? jestAdapter
|
|
1072
1072
|
const newAdapter = shimmer.wrapFunction(adapter, adapter => function () {
|
|
1073
1073
|
const environment = arguments[2]
|
|
1074
|
-
if (!environment) {
|
|
1074
|
+
if (!environment || !environment.testEnvironmentOptions) {
|
|
1075
1075
|
return adapter.apply(this, arguments)
|
|
1076
1076
|
}
|
|
1077
1077
|
testSuiteStartCh.publish({
|
|
@@ -53,6 +53,27 @@ for (const extension of extensions) {
|
|
|
53
53
|
return exports
|
|
54
54
|
})
|
|
55
55
|
|
|
56
|
+
addHook({ name: '@langchain/core', file: `dist/tools/index.${extension}`, versions: ['>=0.1'] }, exports => {
|
|
57
|
+
if (extension === 'cjs') {
|
|
58
|
+
wrap(exports.StructuredTool.prototype, 'invoke', 'orchestrion:@langchain/core:Tool_invoke')
|
|
59
|
+
}
|
|
60
|
+
return exports
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
addHook({ name: '@langchain/core', file: `dist/vectorstores.${extension}`, versions: ['>=0.1'] }, exports => {
|
|
64
|
+
if (extension === 'cjs') {
|
|
65
|
+
wrap(
|
|
66
|
+
exports.VectorStore.prototype, 'similaritySearch', 'orchestrion:@langchain/core:VectorStore_similaritySearch'
|
|
67
|
+
)
|
|
68
|
+
wrap(
|
|
69
|
+
exports.VectorStore.prototype, 'similaritySearchWithScore',
|
|
70
|
+
'orchestrion:@langchain/core:VectorStore_similaritySearchWithScore'
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return exports
|
|
75
|
+
})
|
|
76
|
+
|
|
56
77
|
addHook({ name: '@langchain/core', file: `dist/embeddings.${extension}`, versions: ['>=0.1'] }, exports => {
|
|
57
78
|
if (extension === 'cjs') {
|
|
58
79
|
shimmer.wrap(exports, 'Embeddings', Embeddings => {
|
|
@@ -35,7 +35,7 @@ function wrapConnection (Connection, version) {
|
|
|
35
35
|
shimmer.wrap(Connection.prototype, 'query', query => function (sql, values, cb) {
|
|
36
36
|
if (!startOuterQueryCh.hasSubscribers) return query.apply(this, arguments)
|
|
37
37
|
|
|
38
|
-
if (typeof sql === 'object') sql = sql
|
|
38
|
+
if (sql !== null && typeof sql === 'object') sql = sql.sql
|
|
39
39
|
|
|
40
40
|
if (!sql) return query.apply(this, arguments)
|
|
41
41
|
|
|
@@ -76,7 +76,7 @@ function wrapConnection (Connection, version) {
|
|
|
76
76
|
shimmer.wrap(Connection.prototype, 'execute', execute => function (sql, values, cb) {
|
|
77
77
|
if (!startOuterQueryCh.hasSubscribers) return execute.apply(this, arguments)
|
|
78
78
|
|
|
79
|
-
if (typeof sql === 'object') sql = sql
|
|
79
|
+
if (sql !== null && typeof sql === 'object') sql = sql.sql
|
|
80
80
|
|
|
81
81
|
if (!sql) return execute.apply(this, arguments)
|
|
82
82
|
|
|
@@ -167,7 +167,7 @@ function wrapPool (Pool, version) {
|
|
|
167
167
|
shimmer.wrap(Pool.prototype, 'query', query => function (sql, values, cb) {
|
|
168
168
|
if (!startOuterQueryCh.hasSubscribers) return query.apply(this, arguments)
|
|
169
169
|
|
|
170
|
-
if (typeof sql === 'object') sql = sql
|
|
170
|
+
if (sql !== null && typeof sql === 'object') sql = sql.sql
|
|
171
171
|
|
|
172
172
|
if (!sql) return query.apply(this, arguments)
|
|
173
173
|
|
|
@@ -206,7 +206,7 @@ function wrapPool (Pool, version) {
|
|
|
206
206
|
shimmer.wrap(Pool.prototype, 'execute', execute => function (sql, values, cb) {
|
|
207
207
|
if (!startOuterQueryCh.hasSubscribers) return execute.apply(this, arguments)
|
|
208
208
|
|
|
209
|
-
if (typeof sql === 'object') sql = sql
|
|
209
|
+
if (sql !== null && typeof sql === 'object') sql = sql.sql
|
|
210
210
|
|
|
211
211
|
if (!sql) return execute.apply(this, arguments)
|
|
212
212
|
|
|
@@ -239,7 +239,7 @@ function wrapPoolCluster (PoolCluster) {
|
|
|
239
239
|
|
|
240
240
|
if (startOuterQueryCh.hasSubscribers && !wrappedPoolNamespaces.has(poolNamespace)) {
|
|
241
241
|
shimmer.wrap(poolNamespace, 'query', query => function (sql, values, cb) {
|
|
242
|
-
if (typeof sql === 'object') sql = sql
|
|
242
|
+
if (sql !== null && typeof sql === 'object') sql = sql.sql
|
|
243
243
|
|
|
244
244
|
if (!sql) return query.apply(this, arguments)
|
|
245
245
|
|
|
@@ -274,7 +274,7 @@ function wrapPoolCluster (PoolCluster) {
|
|
|
274
274
|
})
|
|
275
275
|
|
|
276
276
|
shimmer.wrap(poolNamespace, 'execute', execute => function (sql, values, cb) {
|
|
277
|
-
if (typeof sql === 'object') sql = sql
|
|
277
|
+
if (sql !== null && typeof sql === 'object') sql = sql.sql
|
|
278
278
|
|
|
279
279
|
if (!sql) return execute.apply(this, arguments)
|
|
280
280
|
|
|
@@ -51,7 +51,9 @@ function wrapHandleApiRequest (handleApiRequest) {
|
|
|
51
51
|
function wrapHandleApiRequestWithMatch (handleApiRequest) {
|
|
52
52
|
return function (req, res, query, match) {
|
|
53
53
|
return instrument(req, res, () => {
|
|
54
|
-
const page = (
|
|
54
|
+
const page = (
|
|
55
|
+
match !== null && typeof match === 'object' && match.definition !== null && typeof match.definition === 'object'
|
|
56
|
+
)
|
|
55
57
|
? match.definition.pathname
|
|
56
58
|
: undefined
|
|
57
59
|
|
|
@@ -38,12 +38,34 @@ addHook({ name: 'oracledb', versions: ['>=5'] }, oracledb => {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
return new AsyncResource('apm:oracledb:inner-scope').runInAsyncScope(() => {
|
|
41
|
+
// The connAttrs are used to pass through the argument to the potential
|
|
42
|
+
// serviceName method a user might have passed through as well as parsing
|
|
43
|
+
// the connection string in v5.
|
|
41
44
|
const connAttrs = connectionAttributes.get(this)
|
|
42
|
-
|
|
45
|
+
|
|
46
|
+
const details = typeof this.hostName === 'string' ? this : this._impl
|
|
47
|
+
|
|
48
|
+
let hostname
|
|
49
|
+
let port
|
|
50
|
+
let dbInstance
|
|
51
|
+
|
|
52
|
+
if (details) {
|
|
53
|
+
dbInstance = details.serviceName
|
|
54
|
+
hostname = details.hostName ?? details.nscon?.ntAdapter?.hostName
|
|
55
|
+
port = String(details.port ?? details.nscon?.ntAdapter?.port ?? '')
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
startChannel.publish({
|
|
59
|
+
query: dbQuery,
|
|
60
|
+
connAttrs,
|
|
61
|
+
dbInstance,
|
|
62
|
+
port,
|
|
63
|
+
hostname,
|
|
64
|
+
})
|
|
43
65
|
try {
|
|
44
66
|
let result = execute.apply(this, arguments)
|
|
45
67
|
|
|
46
|
-
if (
|
|
68
|
+
if (typeof result?.then === 'function') {
|
|
47
69
|
result = result.then(
|
|
48
70
|
x => {
|
|
49
71
|
finish()
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
1
3
|
module.exports = `
|
|
2
4
|
version: 1
|
|
3
5
|
dc_module: dc-polyfill
|
|
@@ -51,4 +53,34 @@ instrumentations:
|
|
|
51
53
|
class: Embeddings
|
|
52
54
|
operator: traceSync
|
|
53
55
|
channel_name: "Embeddings_constructor"
|
|
56
|
+
- module_name: "@langchain/core"
|
|
57
|
+
version_range: ">=0.1.0"
|
|
58
|
+
file_path: dist/tools/index.js
|
|
59
|
+
function_query:
|
|
60
|
+
name: invoke
|
|
61
|
+
type: method
|
|
62
|
+
kind: async
|
|
63
|
+
class: StructuredTool
|
|
64
|
+
operator: tracePromise
|
|
65
|
+
channel_name: "Tool_invoke"
|
|
66
|
+
- module_name: "@langchain/core"
|
|
67
|
+
version_range: ">=0.1.0"
|
|
68
|
+
file_path: dist/vectorstores.js
|
|
69
|
+
function_query:
|
|
70
|
+
name: similaritySearch
|
|
71
|
+
type: method
|
|
72
|
+
kind: async
|
|
73
|
+
class: VectorStore
|
|
74
|
+
operator: tracePromise
|
|
75
|
+
channel_name: "VectorStore_similaritySearch"
|
|
76
|
+
- module_name: "@langchain/core"
|
|
77
|
+
version_range: ">=0.1.0"
|
|
78
|
+
file_path: dist/vectorstores.js
|
|
79
|
+
function_query:
|
|
80
|
+
name: similaritySearchWithScore
|
|
81
|
+
type: method
|
|
82
|
+
kind: async
|
|
83
|
+
class: VectorStore
|
|
84
|
+
operator: tracePromise
|
|
85
|
+
channel_name: "VectorStore_similaritySearchWithScore"
|
|
54
86
|
`
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
1
3
|
const satisfies = require('semifies')
|
|
2
4
|
|
|
3
5
|
const { addHook, channel } = require('./helpers/instrument')
|
|
@@ -335,7 +337,9 @@ function testEndHandler (test, annotations, testStatus, error, isTimeout, isMain
|
|
|
335
337
|
testStatuses.push(testStatus)
|
|
336
338
|
}
|
|
337
339
|
|
|
338
|
-
|
|
340
|
+
const testProperties = getTestProperties(test)
|
|
341
|
+
|
|
342
|
+
if (testStatuses.length === testManagementAttemptToFixRetries + 1 && testProperties.attemptToFix) {
|
|
339
343
|
if (testStatuses.includes('fail')) {
|
|
340
344
|
test._ddHasFailedAttemptToFixRetries = true
|
|
341
345
|
}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const {
|
|
4
4
|
channel,
|
|
5
|
-
addHook
|
|
6
|
-
AsyncResource
|
|
5
|
+
addHook
|
|
7
6
|
} = require('./helpers/instrument')
|
|
8
7
|
const shimmer = require('../../datadog-shimmer')
|
|
9
8
|
|
|
@@ -22,30 +21,26 @@ addHook({ name: 'tedious', versions: ['>=1.0.0'] }, tedious => {
|
|
|
22
21
|
return makeRequest.apply(this, arguments)
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
const callbackResource = new AsyncResource('bound-anonymous-fn')
|
|
26
|
-
const asyncResource = new AsyncResource('bound-anonymous-fn')
|
|
27
|
-
|
|
28
24
|
const connectionConfig = this.config
|
|
25
|
+
const ctx = { queryOrProcedure, connectionConfig }
|
|
29
26
|
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
startCh.publish(payload)
|
|
33
|
-
queryParent[queryField] = payload.sql
|
|
27
|
+
return startCh.runStores(ctx, () => {
|
|
28
|
+
queryParent[queryField] = ctx.sql
|
|
34
29
|
|
|
35
|
-
const cb =
|
|
36
|
-
request.callback =
|
|
30
|
+
const cb = request.callback
|
|
31
|
+
request.callback = function (error, ...args) {
|
|
37
32
|
if (error) {
|
|
38
|
-
|
|
33
|
+
ctx.error = error
|
|
34
|
+
errorCh.publish(ctx)
|
|
39
35
|
}
|
|
40
|
-
finishCh.
|
|
41
|
-
|
|
42
|
-
return cb.apply(this, arguments)
|
|
43
|
-
}, null, request)
|
|
36
|
+
return finishCh.runStores(ctx, cb, this, error, ...args)
|
|
37
|
+
}
|
|
44
38
|
|
|
45
39
|
try {
|
|
46
40
|
return makeRequest.apply(this, arguments)
|
|
47
41
|
} catch (error) {
|
|
48
|
-
|
|
42
|
+
ctx.error = error
|
|
43
|
+
errorCh.publish(ctx)
|
|
49
44
|
|
|
50
45
|
throw error
|
|
51
46
|
}
|
|
@@ -73,9 +73,25 @@ class BaseAwsSdkPlugin extends ClientPlugin {
|
|
|
73
73
|
span.addTags(requestTags)
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
this.enter(span)
|
|
76
77
|
const store = storage('legacy').getStore()
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
const peerServerlessStorage = storage('peerServerless')
|
|
80
|
+
if (!this._tracerConfig?._isInServerlessEnvironment()) return
|
|
81
|
+
|
|
82
|
+
// Try to resolve the hostname immediately; if not possible, keep enough
|
|
83
|
+
// information so the region callback can resolve it later.
|
|
84
|
+
const hostname = getHostname({ awsParams: request.params, awsService }, awsRegion)
|
|
85
|
+
const peerServerlessStore = {}
|
|
86
|
+
peerServerlessStorage.enterWith(peerServerlessStore)
|
|
87
|
+
|
|
88
|
+
if (hostname) {
|
|
89
|
+
span.setTag('peer.service', hostname)
|
|
90
|
+
peerServerlessStore.peerHostname = hostname
|
|
91
|
+
} else {
|
|
92
|
+
store.awsParams = request.params
|
|
93
|
+
store.awsService = awsService
|
|
94
|
+
}
|
|
79
95
|
})
|
|
80
96
|
|
|
81
97
|
this.addSub(`apm:aws:request:region:${this.serviceIdentifier}`, region => {
|
|
@@ -85,6 +101,17 @@ class BaseAwsSdkPlugin extends ClientPlugin {
|
|
|
85
101
|
if (!span) return
|
|
86
102
|
span.setTag('aws.region', region)
|
|
87
103
|
span.setTag('region', region)
|
|
104
|
+
|
|
105
|
+
if (!this._tracerConfig?._isInServerlessEnvironment()) return
|
|
106
|
+
|
|
107
|
+
const hostname = getHostname(store, region)
|
|
108
|
+
if (!hostname) return
|
|
109
|
+
|
|
110
|
+
span.setTag('peer.service', hostname)
|
|
111
|
+
const peerServerlessStore = storage('peerServerless').getStore()
|
|
112
|
+
if (peerServerlessStore) {
|
|
113
|
+
peerServerlessStore.peerHostname = hostname
|
|
114
|
+
}
|
|
88
115
|
})
|
|
89
116
|
|
|
90
117
|
this.addSub(`apm:aws:request:complete:${this.serviceIdentifier}`, ({ response, cbExists = false }) => {
|
|
@@ -243,4 +270,27 @@ function getHooks (config) {
|
|
|
243
270
|
return { request }
|
|
244
271
|
}
|
|
245
272
|
|
|
273
|
+
function getHostname (store, region) {
|
|
274
|
+
if (!store) return
|
|
275
|
+
if (!region) return
|
|
276
|
+
const { awsParams, awsService } = store
|
|
277
|
+
switch (awsService) {
|
|
278
|
+
case 'EventBridge':
|
|
279
|
+
return `events.${region}.amazonaws.com`
|
|
280
|
+
case 'SQS':
|
|
281
|
+
return `sqs.${region}.amazonaws.com`
|
|
282
|
+
case 'SNS':
|
|
283
|
+
return `sns.${region}.amazonaws.com`
|
|
284
|
+
case 'Kinesis':
|
|
285
|
+
return `kinesis.${region}.amazonaws.com`
|
|
286
|
+
case 'DynamoDBDocument':
|
|
287
|
+
case 'DynamoDB':
|
|
288
|
+
return `dynamodb.${region}.amazonaws.com`
|
|
289
|
+
case 'S3':
|
|
290
|
+
return awsParams?.Bucket
|
|
291
|
+
? `${awsParams.Bucket}.s3.${region}.amazonaws.com`
|
|
292
|
+
: `s3.${region}.amazonaws.com`
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
246
296
|
module.exports = BaseAwsSdkPlugin
|
|
@@ -35,7 +35,9 @@ class ChildProcessPlugin extends TracingPlugin {
|
|
|
35
35
|
return this._tracer
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
start (
|
|
38
|
+
start (ctx) {
|
|
39
|
+
const { command, shell } = ctx
|
|
40
|
+
|
|
39
41
|
if (typeof command !== 'string') {
|
|
40
42
|
return
|
|
41
43
|
}
|
|
@@ -58,10 +60,13 @@ class ChildProcessPlugin extends TracingPlugin {
|
|
|
58
60
|
resource: (shell === true) ? 'sh' : cmdFields[0],
|
|
59
61
|
type: 'system',
|
|
60
62
|
meta
|
|
61
|
-
})
|
|
63
|
+
}, ctx)
|
|
64
|
+
|
|
65
|
+
return ctx.currentStore
|
|
62
66
|
}
|
|
63
67
|
|
|
64
|
-
end (
|
|
68
|
+
end (ctx) {
|
|
69
|
+
const { result, error } = ctx
|
|
65
70
|
let exitCode
|
|
66
71
|
|
|
67
72
|
if (result !== undefined) {
|
|
@@ -74,17 +79,32 @@ class ChildProcessPlugin extends TracingPlugin {
|
|
|
74
79
|
exitCode = error?.status || error?.code || 0
|
|
75
80
|
}
|
|
76
81
|
|
|
77
|
-
this.activeSpan
|
|
78
|
-
|
|
82
|
+
const span = ctx.currentStore?.span || this.activeSpan
|
|
83
|
+
|
|
84
|
+
span?.setTag('cmd.exit_code', `${exitCode}`)
|
|
85
|
+
span?.finish()
|
|
86
|
+
|
|
87
|
+
return ctx.parentStore
|
|
79
88
|
}
|
|
80
89
|
|
|
81
|
-
error (
|
|
82
|
-
|
|
90
|
+
error (ctx) {
|
|
91
|
+
const { error } = ctx
|
|
92
|
+
|
|
93
|
+
const span = ctx.currentStore?.span || this.activeSpan
|
|
94
|
+
this.addError(error, span)
|
|
95
|
+
|
|
96
|
+
return ctx.parentStore
|
|
83
97
|
}
|
|
84
98
|
|
|
85
|
-
asyncEnd (
|
|
86
|
-
|
|
87
|
-
|
|
99
|
+
asyncEnd (ctx) {
|
|
100
|
+
const { result } = ctx
|
|
101
|
+
|
|
102
|
+
const span = ctx.currentStore?.span || this.activeSpan
|
|
103
|
+
|
|
104
|
+
span?.setTag('cmd.exit_code', `${result}`)
|
|
105
|
+
span?.finish()
|
|
106
|
+
|
|
107
|
+
return ctx.parentStore
|
|
88
108
|
}
|
|
89
109
|
}
|
|
90
110
|
|
|
@@ -63,7 +63,7 @@ function scrubChildProcessCmd (expression) {
|
|
|
63
63
|
|
|
64
64
|
if (token === null) {
|
|
65
65
|
continue
|
|
66
|
-
} else if (typeof token === 'object') {
|
|
66
|
+
} else if (typeof token === 'object') { // eslint-disable-line eslint-rules/eslint-safe-typeof-object
|
|
67
67
|
if (token.pattern) {
|
|
68
68
|
result.push(token.pattern)
|
|
69
69
|
} else if (token.op) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
1
3
|
const {
|
|
2
4
|
TEST_STATUS,
|
|
3
5
|
TEST_IS_RUM_ACTIVE,
|
|
@@ -76,7 +78,8 @@ const {
|
|
|
76
78
|
GIT_TAG,
|
|
77
79
|
GIT_PULL_REQUEST_BASE_BRANCH_SHA,
|
|
78
80
|
GIT_COMMIT_HEAD_SHA,
|
|
79
|
-
GIT_PULL_REQUEST_BASE_BRANCH
|
|
81
|
+
GIT_PULL_REQUEST_BASE_BRANCH,
|
|
82
|
+
GIT_COMMIT_HEAD_MESSAGE
|
|
80
83
|
} = require('../../dd-trace/src/plugins/util/tags')
|
|
81
84
|
const {
|
|
82
85
|
OS_VERSION,
|
|
@@ -238,7 +241,8 @@ class CypressPlugin {
|
|
|
238
241
|
[GIT_COMMIT_MESSAGE]: commitMessage,
|
|
239
242
|
[GIT_TAG]: tag,
|
|
240
243
|
[GIT_PULL_REQUEST_BASE_BRANCH_SHA]: pullRequestBaseSha,
|
|
241
|
-
[GIT_COMMIT_HEAD_SHA]: commitHeadSha
|
|
244
|
+
[GIT_COMMIT_HEAD_SHA]: commitHeadSha,
|
|
245
|
+
[GIT_COMMIT_HEAD_MESSAGE]: commitHeadMessage
|
|
242
246
|
} = this.testEnvironmentMetadata
|
|
243
247
|
|
|
244
248
|
this.repositoryRoot = repositoryRoot || process.cwd()
|
|
@@ -258,7 +262,8 @@ class CypressPlugin {
|
|
|
258
262
|
commitMessage,
|
|
259
263
|
tag,
|
|
260
264
|
pullRequestBaseSha,
|
|
261
|
-
commitHeadSha
|
|
265
|
+
commitHeadSha,
|
|
266
|
+
commitHeadMessage
|
|
262
267
|
}
|
|
263
268
|
this.finishedTestsByFile = {}
|
|
264
269
|
this.testStatuses = {}
|