dd-trace 5.58.0 → 5.60.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/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 +0 -2
- package/initialize.mjs +2 -0
- package/package.json +40 -8
- package/packages/datadog-code-origin/index.js +14 -9
- package/packages/datadog-instrumentations/src/apollo-server.js +14 -3
- package/packages/datadog-instrumentations/src/apollo.js +7 -10
- package/packages/datadog-instrumentations/src/avsc.js +2 -0
- package/packages/datadog-instrumentations/src/child_process.js +21 -42
- 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/helpers/hooks.js +1 -0
- package/packages/datadog-instrumentations/src/helpers/register.js +1 -1
- package/packages/datadog-instrumentations/src/hono.js +102 -0
- 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/nyc.js +2 -0
- package/packages/datadog-instrumentations/src/openai.js +13 -114
- 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/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/services/bedrockruntime/index.js +2 -0
- package/packages/datadog-plugin-child_process/src/index.js +30 -10
- 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 +4 -2
- package/packages/datadog-plugin-google-cloud-vertexai/src/tracing.js +3 -155
- package/packages/datadog-plugin-google-cloud-vertexai/src/utils.js +2 -0
- package/packages/datadog-plugin-graphql/src/utils.js +2 -0
- package/packages/datadog-plugin-hono/src/index.js +28 -0
- 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/tracing.js +36 -4
- package/packages/datadog-plugin-nyc/src/index.js +2 -0
- package/packages/datadog-plugin-openai/src/stream-helpers.js +114 -0
- package/packages/datadog-plugin-openai/src/tracing.js +38 -0
- package/packages/datadog-plugin-oracledb/src/connection-parser.js +2 -0
- 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-vitest/src/index.js +2 -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/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.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 +7 -19
- package/packages/dd-trace/src/appsec/stack_trace.js +11 -11
- package/packages/dd-trace/src/appsec/telemetry/common.js +1 -1
- package/packages/dd-trace/src/appsec/waf/index.js +20 -1
- package/packages/dd-trace/src/appsec/waf/waf_context_wrapper.js +2 -2
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/index.js +5 -4
- 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 +4 -16
- package/packages/dd-trace/src/config_stable.js +2 -0
- 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/config.js +16 -0
- package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/config.js +2 -6
- package/packages/dd-trace/src/debugger/devtools_client/index.js +13 -5
- package/packages/dd-trace/src/debugger/devtools_client/inspector_promises_polyfill.js +2 -0
- package/packages/dd-trace/src/debugger/devtools_client/log.js +19 -0
- package/packages/dd-trace/src/debugger/devtools_client/remote_config.js +9 -6
- package/packages/dd-trace/src/debugger/devtools_client/send.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/symbols.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/state.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/status.js +1 -1
- package/packages/dd-trace/src/debugger/index.js +48 -11
- 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/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/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/tagger.js +10 -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/payload-tagging/config/index.js +2 -0
- package/packages/dd-trace/src/payload-tagging/index.js +2 -0
- package/packages/dd-trace/src/payload-tagging/tagging.js +2 -0
- 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/util/ci.js +17 -7
- 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 +19 -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/webspan-utils.js +2 -0
- package/packages/dd-trace/src/remote_config/capabilities.js +4 -1
- package/packages/dd-trace/src/remote_config/index.js +6 -0
- package/packages/dd-trace/src/service-naming/index.js +2 -0
- package/packages/dd-trace/src/service-naming/schemas/definition.js +2 -0
- 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 +2 -0
- 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 +2 -0
- package/packages/dd-trace/src/telemetry/send-data.js +2 -0
- package/register.js +4 -0
- package/version.js +0 -3
package/LICENSE-3rdparty.csv
CHANGED
|
@@ -68,6 +68,7 @@ dev,sinon,BSD-3-Clause,Copyright 2010-2017 Christian Johansen
|
|
|
68
68
|
dev,sinon-chai,WTFPL and BSD-2-Clause,Copyright 2004 Sam Hocevar 2012–2017 Domenic Denicola
|
|
69
69
|
dev,tap,ISC,Copyright 2011-2022 Isaac Z. Schlueter and Contributors
|
|
70
70
|
dev,tiktoken,MIT,Copyright (c) 2022 OpenAI, Shantanu Jain
|
|
71
|
+
dev,workerpool,Apache license 2.0,Copyright (C) 2014-2024 Jos de Jong wjosdejong@gmail.com
|
|
71
72
|
dev,yaml,ISC,Copyright Eemeli Aro <eemeli@gmail.com>
|
|
72
73
|
dev,yarn-deduplicate,Apache license 2.0,Copyright [yyyy] [name of copyright owner]
|
|
73
74
|
file,aws-lambda-nodejs-runtime-interface-client,Apache 2.0,Copyright 2019 Amazon.com Inc. or its affiliates. All Rights Reserved.
|
package/ci/cypress/after-run.js
CHANGED
package/ci/cypress/after-spec.js
CHANGED
package/ci/cypress/plugin.js
CHANGED
package/ci/cypress/polyfills.js
CHANGED
package/ci/cypress/support.js
CHANGED
package/ci/init.js
CHANGED
package/index.d.ts
CHANGED
|
@@ -186,6 +186,7 @@ interface Plugins {
|
|
|
186
186
|
"graphql": tracer.plugins.graphql;
|
|
187
187
|
"grpc": tracer.plugins.grpc;
|
|
188
188
|
"hapi": tracer.plugins.hapi;
|
|
189
|
+
"hono": tracer.plugins.hono;
|
|
189
190
|
"http": tracer.plugins.http;
|
|
190
191
|
"http2": tracer.plugins.http2;
|
|
191
192
|
"ioredis": tracer.plugins.ioredis;
|
|
@@ -1603,6 +1604,12 @@ declare namespace tracer {
|
|
|
1603
1604
|
*/
|
|
1604
1605
|
interface hapi extends HttpServer {}
|
|
1605
1606
|
|
|
1607
|
+
/**
|
|
1608
|
+
* This plugin automatically instruments the
|
|
1609
|
+
* [hono](https://hono.dev/) module.
|
|
1610
|
+
*/
|
|
1611
|
+
interface hono extends HttpServer {}
|
|
1612
|
+
|
|
1606
1613
|
/**
|
|
1607
1614
|
* This plugin automatically instruments the
|
|
1608
1615
|
* [http](https://nodejs.org/api/http.html) module.
|
package/init.js
CHANGED
package/initialize.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dd-trace",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.60.0",
|
|
4
4
|
"description": "Datadog APM tracing client for JavaScript",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -25,8 +25,10 @@
|
|
|
25
25
|
"test:debugger": "mocha -r 'packages/dd-trace/test/setup/mocha.js' 'packages/dd-trace/test/debugger/**/*.spec.js'",
|
|
26
26
|
"test:debugger:ci": "nyc --no-clean --include 'packages/dd-trace/src/debugger/**/*.js' -- npm run test:debugger",
|
|
27
27
|
"test:eslint-rules": "node eslint-rules/*.test.mjs",
|
|
28
|
-
"test:trace:core": "tap packages/dd-trace/test/*.spec.js \"packages/dd-trace/test/{ci-visibility,datastreams,encode,exporters,opentelemetry,opentracing,plugins,service-naming,standalone,telemetry}/**/*.spec.js\"",
|
|
28
|
+
"test:trace:core": "tap packages/dd-trace/test/*.spec.js \"packages/dd-trace/test/{ci-visibility,datastreams,encode,exporters,opentelemetry,opentracing,plugins,remote_config,service-naming,standalone,telemetry}/**/*.spec.js\"",
|
|
29
29
|
"test:trace:core:ci": "npm run test:trace:core -- --coverage --nyc-arg=--include=\"packages/dd-trace/src/**/*.js\"",
|
|
30
|
+
"test:trace:guardrails": "mocha -r \"packages/dd-trace/test/setup/mocha.js\" \"packages/dd-trace/test/guardrails/**/*.spec.js\"",
|
|
31
|
+
"test:trace:guardrails:ci": "nyc --no-clean --include \"packages/dd-trace/src/guardrails/**/*.js\" -- npm run test:trace:guardrails",
|
|
30
32
|
"test:instrumentations": "mocha -r 'packages/dd-trace/test/setup/mocha.js' \"packages/datadog-instrumentations/test/@($(echo $PLUGINS)).spec.js\"",
|
|
31
33
|
"test:instrumentations:ci": "yarn services && nyc --no-clean --include \"packages/datadog-instrumentations/src/@($(echo $PLUGINS)).js\" --include \"packages/datadog-instrumentations/src/@($(echo $PLUGINS))/**/*.js\" -- npm run test:instrumentations",
|
|
32
34
|
"test:instrumentations:misc": "mocha -r 'packages/dd-trace/test/setup/mocha.js' 'packages/datadog-instrumentations/test/*/**/*.spec.js'",
|
|
@@ -55,6 +57,7 @@
|
|
|
55
57
|
"test:integration:playwright": "mocha --timeout 60000 -r \"packages/dd-trace/test/setup/core.js\" \"integration-tests/playwright/*.spec.js\"",
|
|
56
58
|
"test:integration:selenium": "mocha --timeout 60000 -r \"packages/dd-trace/test/setup/core.js\" \"integration-tests/selenium/*.spec.js\"",
|
|
57
59
|
"test:integration:vitest": "mocha --timeout 60000 -r \"packages/dd-trace/test/setup/core.js\" \"integration-tests/vitest/*.spec.js\"",
|
|
60
|
+
"test:integration:testopt": "mocha --timeout 60000 -r \"packages/dd-trace/test/setup/core.js\" \"integration-tests/ci-visibility/*.spec.js\"",
|
|
58
61
|
"test:integration:profiler": "mocha --timeout 180000 -r \"packages/dd-trace/test/setup/core.js\" \"integration-tests/profiler/*.spec.js\"",
|
|
59
62
|
"test:integration:plugins": "mocha -r \"packages/dd-trace/test/setup/mocha.js\" \"packages/datadog-plugin-@($(echo $PLUGINS))/test/integration-test/**/*.spec.js\"",
|
|
60
63
|
"test:unit:plugins": "mocha -r \"packages/dd-trace/test/setup/mocha.js\" \"packages/datadog-instrumentations/test/@($(echo $PLUGINS)).spec.js\" \"packages/datadog-plugin-@($(echo $PLUGINS))/test/**/*.spec.js\" --exclude \"packages/datadog-plugin-@($(echo $PLUGINS))/test/integration-test/**/*.spec.js\"",
|
|
@@ -84,9 +87,34 @@
|
|
|
84
87
|
"engines": {
|
|
85
88
|
"node": ">=18"
|
|
86
89
|
},
|
|
90
|
+
"files": [
|
|
91
|
+
"ci/**/*",
|
|
92
|
+
"cypress/**/*",
|
|
93
|
+
"esbuild.js",
|
|
94
|
+
"ext/**/*",
|
|
95
|
+
"index.d.ts",
|
|
96
|
+
"index.js",
|
|
97
|
+
"init.js",
|
|
98
|
+
"initialize.mjs",
|
|
99
|
+
"LICENSE-3rdparty.csv",
|
|
100
|
+
"LICENSE",
|
|
101
|
+
"LICENSE.Apache",
|
|
102
|
+
"LICENSE.BSD3",
|
|
103
|
+
"loader-hook.mjs",
|
|
104
|
+
"package.json",
|
|
105
|
+
"packages/*/index.js",
|
|
106
|
+
"packages/*/lib/**/*",
|
|
107
|
+
"packages/*/src/**/*",
|
|
108
|
+
"packages/datadog-instrumentations/orchestrion.yml",
|
|
109
|
+
"README.md",
|
|
110
|
+
"register.js",
|
|
111
|
+
"scripts/preinstall.js",
|
|
112
|
+
"vendor/**/*",
|
|
113
|
+
"version.js"
|
|
114
|
+
],
|
|
87
115
|
"dependencies": {
|
|
88
116
|
"@datadog/libdatadog": "0.7.0",
|
|
89
|
-
"@datadog/native-appsec": "
|
|
117
|
+
"@datadog/native-appsec": "10.0.1",
|
|
90
118
|
"@datadog/native-iast-taint-tracking": "4.0.0",
|
|
91
119
|
"@datadog/native-metrics": "3.1.1",
|
|
92
120
|
"@datadog/pprof": "5.9.0",
|
|
@@ -97,7 +125,7 @@
|
|
|
97
125
|
"@opentelemetry/core": "^1.14.0",
|
|
98
126
|
"crypto-randomuuid": "^1.0.0",
|
|
99
127
|
"dc-polyfill": "^0.1.9",
|
|
100
|
-
"ignore": "^
|
|
128
|
+
"ignore": "^7.0.5",
|
|
101
129
|
"import-in-the-middle": "^1.14.2",
|
|
102
130
|
"istanbul-lib-coverage": "^3.2.2",
|
|
103
131
|
"jest-docblock": "^29.7.0",
|
|
@@ -105,10 +133,10 @@
|
|
|
105
133
|
"koalas": "^1.0.2",
|
|
106
134
|
"limiter": "^1.1.5",
|
|
107
135
|
"lodash.sortby": "^4.7.0",
|
|
108
|
-
"lru-cache": "^
|
|
136
|
+
"lru-cache": "^10.4.3",
|
|
109
137
|
"module-details-from-path": "^1.0.4",
|
|
110
138
|
"mutexify": "^1.4.0",
|
|
111
|
-
"opentracing": ">=0.
|
|
139
|
+
"opentracing": ">=0.14.7",
|
|
112
140
|
"path-to-regexp": "^0.1.12",
|
|
113
141
|
"pprof-format": "^2.1.0",
|
|
114
142
|
"protobufjs": "^7.5.3",
|
|
@@ -138,14 +166,14 @@
|
|
|
138
166
|
"eslint-plugin-n": "^17.20.0",
|
|
139
167
|
"eslint-plugin-promise": "^7.2.1",
|
|
140
168
|
"eslint-plugin-unicorn": "^59.0.1",
|
|
141
|
-
"express": "^
|
|
169
|
+
"express": "^5.1.0",
|
|
142
170
|
"get-port": "^5.1.1",
|
|
143
171
|
"glob": "^7.2.3",
|
|
144
172
|
"globals": "^15.15.0",
|
|
145
173
|
"graphql": "*",
|
|
146
174
|
"jszip": "^3.10.1",
|
|
147
175
|
"mocha": "^11.6.0",
|
|
148
|
-
"multer": "^2.0.
|
|
176
|
+
"multer": "^2.0.2",
|
|
149
177
|
"nock": "^11.9.1",
|
|
150
178
|
"nyc": "^15.1.0",
|
|
151
179
|
"octokit": "^5.0.3",
|
|
@@ -156,7 +184,11 @@
|
|
|
156
184
|
"sinon-chai": "^3.7.0",
|
|
157
185
|
"tap": "^16.3.10",
|
|
158
186
|
"tiktoken": "^1.0.21",
|
|
187
|
+
"workerpool": "^9.2.0",
|
|
159
188
|
"yaml": "^2.8.0",
|
|
160
189
|
"yarn-deduplicate": "^6.0.2"
|
|
190
|
+
},
|
|
191
|
+
"resolutions": {
|
|
192
|
+
"eslint-plugin-unicorn/@eslint/plugin-kit": "0.3.3"
|
|
161
193
|
}
|
|
162
194
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { parseUserLandFrames } = require('../dd-trace/src/plugins/util/stacktrace')
|
|
4
4
|
|
|
5
5
|
const ENTRY_SPAN_STACK_FRAMES_LIMIT = 1
|
|
6
6
|
const EXIT_SPAN_STACK_FRAMES_LIMIT = Number(process.env._DD_CODE_ORIGIN_FOR_SPANS_EXIT_SPAN_MAX_USER_FRAMES) || 8
|
|
@@ -36,20 +36,25 @@ function exitTags (topOfStackFunc) {
|
|
|
36
36
|
* @returns {Record<string, string>}
|
|
37
37
|
*/
|
|
38
38
|
function tag (type, topOfStackFunc, limit) {
|
|
39
|
-
|
|
39
|
+
// The `Error.prepareStackTrace` API doesn't support resolving source maps.
|
|
40
|
+
// Fall back to manually parsing the stack trace.
|
|
41
|
+
const dummy = {}
|
|
42
|
+
Error.captureStackTrace(dummy, topOfStackFunc)
|
|
43
|
+
const frames = parseUserLandFrames(dummy.stack, limit)
|
|
44
|
+
|
|
40
45
|
const tags = {
|
|
41
46
|
'_dd.code_origin.type': type
|
|
42
47
|
}
|
|
43
48
|
for (let i = 0; i < frames.length; i++) {
|
|
44
49
|
const frame = frames[i]
|
|
45
|
-
tags[`_dd.code_origin.frames.${i}.file`] = frame.
|
|
46
|
-
tags[`_dd.code_origin.frames.${i}.line`] =
|
|
47
|
-
tags[`_dd.code_origin.frames.${i}.column`] =
|
|
48
|
-
if (frame.
|
|
49
|
-
tags[`_dd.code_origin.frames.${i}.method`] = frame.
|
|
50
|
+
tags[`_dd.code_origin.frames.${i}.file`] = frame.fileName
|
|
51
|
+
tags[`_dd.code_origin.frames.${i}.line`] = frame.lineNumber
|
|
52
|
+
tags[`_dd.code_origin.frames.${i}.column`] = frame.columnNumber
|
|
53
|
+
if (frame.methodName || frame.functionName) {
|
|
54
|
+
tags[`_dd.code_origin.frames.${i}.method`] = frame.methodName || frame.functionName
|
|
50
55
|
}
|
|
51
|
-
if (frame.
|
|
52
|
-
tags[`_dd.code_origin.frames.${i}.type`] = frame.
|
|
56
|
+
if (frame.typeName) {
|
|
57
|
+
tags[`_dd.code_origin.frames.${i}.type`] = frame.typeName
|
|
53
58
|
}
|
|
54
59
|
}
|
|
55
60
|
return tags
|
|
@@ -77,6 +77,17 @@ function apolloServerHook (apolloServer) {
|
|
|
77
77
|
return apolloServer
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
addHook(
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
addHook(
|
|
81
|
+
{ name: '@apollo/server', file: 'dist/cjs/ApolloServer.js', versions: ['>=4.0.0 <5.0.0'] },
|
|
82
|
+
apolloServerHook
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
addHook(
|
|
86
|
+
{ name: '@apollo/server', file: 'dist/cjs/express4/index.js', versions: ['>=4.0.0 <5.0.0'] },
|
|
87
|
+
apolloExpress4Hook
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
addHook(
|
|
91
|
+
{ name: '@apollo/server', file: 'dist/cjs/utils/HeaderMap.js', versions: ['>=4.0.0 <5.0.0'] },
|
|
92
|
+
apolloHeaderMapHook
|
|
93
|
+
)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
1
3
|
const {
|
|
2
4
|
addHook,
|
|
3
5
|
channel
|
|
@@ -16,20 +18,15 @@ const CHANNELS = {
|
|
|
16
18
|
|
|
17
19
|
const generalErrorCh = channel('apm:apollo:gateway:general:error')
|
|
18
20
|
|
|
19
|
-
function wrapExecutor (executor) {
|
|
20
|
-
return function (...args) {
|
|
21
|
-
const channel = CHANNELS['gateway.request']
|
|
22
|
-
const ctx = { requestContext: args[0], gateway: this }
|
|
23
|
-
|
|
24
|
-
return channel.tracePromise(executor, ctx, this, ...args)
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
21
|
function wrapApolloGateway (ApolloGateway) {
|
|
29
22
|
class ApolloGatewayWrapper extends ApolloGateway {
|
|
30
23
|
constructor (...args) {
|
|
31
24
|
super(...args)
|
|
32
|
-
shimmer.wrap(this, 'executor',
|
|
25
|
+
shimmer.wrap(this, 'executor', (originalExecutor) => (...args) => {
|
|
26
|
+
const channel = CHANNELS['gateway.request']
|
|
27
|
+
const ctx = { requestContext: args[0], gateway: this }
|
|
28
|
+
return channel.tracePromise(originalExecutor, ctx, this, ...args)
|
|
29
|
+
})
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
32
|
return ApolloGatewayWrapper
|
|
@@ -4,8 +4,7 @@ const { errorMonitor } = require('events')
|
|
|
4
4
|
const util = require('util')
|
|
5
5
|
|
|
6
6
|
const {
|
|
7
|
-
addHook
|
|
8
|
-
AsyncResource
|
|
7
|
+
addHook
|
|
9
8
|
} = require('./helpers/instrument')
|
|
10
9
|
const shimmer = require('../../datadog-shimmer')
|
|
11
10
|
const dc = require('dc-polyfill')
|
|
@@ -80,7 +79,8 @@ function createContextFromChildProcessInfo (childProcessInfo) {
|
|
|
80
79
|
const context = {
|
|
81
80
|
command: childProcessInfo.command,
|
|
82
81
|
file: childProcessInfo.file,
|
|
83
|
-
shell: childProcessInfo.shell
|
|
82
|
+
shell: childProcessInfo.shell,
|
|
83
|
+
abortController: new AbortController()
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
if (childProcessInfo.fileArgs) {
|
|
@@ -98,17 +98,12 @@ function wrapChildProcessSyncMethod (returnError, shell = false) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
const childProcessInfo = normalizeArgs(arguments, shell)
|
|
101
|
+
const context = createContextFromChildProcessInfo(childProcessInfo)
|
|
101
102
|
|
|
102
|
-
|
|
103
|
-
return innerResource.runInAsyncScope(() => {
|
|
104
|
-
const context = createContextFromChildProcessInfo(childProcessInfo)
|
|
105
|
-
const abortController = new AbortController()
|
|
106
|
-
|
|
107
|
-
childProcessChannel.start.publish({ ...context, abortController })
|
|
108
|
-
|
|
103
|
+
return childProcessChannel.start.runStores(context, () => {
|
|
109
104
|
try {
|
|
110
|
-
if (abortController.signal.aborted) {
|
|
111
|
-
const error = abortController.signal.reason || new Error('Aborted')
|
|
105
|
+
if (context.abortController.signal.aborted) {
|
|
106
|
+
const error = context.abortController.signal.reason || new Error('Aborted')
|
|
112
107
|
// expected behaviors on error are different
|
|
113
108
|
return returnError(error, context)
|
|
114
109
|
}
|
|
@@ -141,21 +136,17 @@ function wrapChildProcessCustomPromisifyMethod (customPromisifyMethod, shell) {
|
|
|
141
136
|
const context = createContextFromChildProcessInfo(childProcessInfo)
|
|
142
137
|
|
|
143
138
|
const { start, end, asyncStart, asyncEnd, error } = childProcessChannel
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
start.publish({
|
|
147
|
-
...context,
|
|
148
|
-
abortController
|
|
149
|
-
})
|
|
139
|
+
start.publish(context)
|
|
150
140
|
|
|
151
141
|
let result
|
|
152
|
-
if (abortController.signal.aborted) {
|
|
153
|
-
result = Promise.reject(abortController.signal.reason || new Error('Aborted'))
|
|
142
|
+
if (context.abortController.signal.aborted) {
|
|
143
|
+
result = Promise.reject(context.abortController.signal.reason || new Error('Aborted'))
|
|
154
144
|
} else {
|
|
155
145
|
try {
|
|
156
146
|
result = customPromisifyMethod.apply(this, arguments)
|
|
157
147
|
} catch (error) {
|
|
158
|
-
error
|
|
148
|
+
context.error = error
|
|
149
|
+
error.publish(context)
|
|
159
150
|
throw error
|
|
160
151
|
} finally {
|
|
161
152
|
end.publish(context)
|
|
@@ -192,26 +183,15 @@ function wrapChildProcessAsyncMethod (ChildProcess, shell = false) {
|
|
|
192
183
|
|
|
193
184
|
const childProcessInfo = normalizeArgs(arguments, shell)
|
|
194
185
|
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
const callbackResource = new AsyncResource('bound-anonymous-fn')
|
|
198
|
-
arguments[arguments.length - 1] = callbackResource.bind(cb)
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
const innerResource = new AsyncResource('bound-anonymous-fn')
|
|
202
|
-
return innerResource.runInAsyncScope(() => {
|
|
203
|
-
const context = createContextFromChildProcessInfo(childProcessInfo)
|
|
204
|
-
const abortController = new AbortController()
|
|
205
|
-
|
|
206
|
-
childProcessChannel.start.publish({ ...context, abortController })
|
|
207
|
-
|
|
186
|
+
const context = createContextFromChildProcessInfo(childProcessInfo)
|
|
187
|
+
return childProcessChannel.start.runStores(context, () => {
|
|
208
188
|
let childProcess
|
|
209
|
-
if (abortController.signal.aborted) {
|
|
189
|
+
if (context.abortController.signal.aborted) {
|
|
210
190
|
childProcess = new ChildProcess()
|
|
211
191
|
childProcess.on('error', () => {}) // Original method does not crash when non subscribers
|
|
212
192
|
|
|
213
193
|
process.nextTick(() => {
|
|
214
|
-
const error = abortController.signal.reason || new Error('Aborted')
|
|
194
|
+
const error = context.abortController.signal.reason || new Error('Aborted')
|
|
215
195
|
childProcess.emit('error', error)
|
|
216
196
|
|
|
217
197
|
const cb = arguments[arguments.length - 1]
|
|
@@ -230,17 +210,16 @@ function wrapChildProcessAsyncMethod (ChildProcess, shell = false) {
|
|
|
230
210
|
|
|
231
211
|
childProcess.on(errorMonitor, (e) => {
|
|
232
212
|
errorExecuted = true
|
|
233
|
-
|
|
213
|
+
context.error = e
|
|
214
|
+
childProcessChannel.error.publish(context)
|
|
234
215
|
})
|
|
235
216
|
|
|
236
217
|
childProcess.on('close', (code = 0) => {
|
|
237
218
|
if (!errorExecuted && code !== 0) {
|
|
238
|
-
childProcessChannel.error.publish()
|
|
219
|
+
childProcessChannel.error.publish(context)
|
|
239
220
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
result: code
|
|
243
|
-
})
|
|
221
|
+
context.result = code
|
|
222
|
+
childProcessChannel.asyncEnd.publish(context)
|
|
244
223
|
})
|
|
245
224
|
}
|
|
246
225
|
|
|
@@ -43,6 +43,7 @@ const {
|
|
|
43
43
|
CUCUMBER_WORKER_TRACE_PAYLOAD_CODE,
|
|
44
44
|
getIsFaultyEarlyFlakeDetection
|
|
45
45
|
} = require('../../dd-trace/src/plugins/util/test')
|
|
46
|
+
const satisfies = require('semifies')
|
|
46
47
|
|
|
47
48
|
const isMarkedAsUnskippable = (pickle) => {
|
|
48
49
|
return pickle.tags.some(tag => tag.name === '@datadog:unskippable')
|
|
@@ -224,7 +225,7 @@ function getPickleByFile (runtimeOrCoodinator) {
|
|
|
224
225
|
}, {})
|
|
225
226
|
}
|
|
226
227
|
|
|
227
|
-
function wrapRun (pl, isLatestVersion) {
|
|
228
|
+
function wrapRun (pl, isLatestVersion, version) {
|
|
228
229
|
if (patched.has(pl)) return
|
|
229
230
|
|
|
230
231
|
patched.add(pl)
|
|
@@ -398,9 +399,10 @@ function wrapRun (pl, isLatestVersion) {
|
|
|
398
399
|
const promise = runStep.apply(this, arguments)
|
|
399
400
|
|
|
400
401
|
promise.then((result) => {
|
|
401
|
-
const
|
|
402
|
-
|
|
403
|
-
|
|
402
|
+
const finalResult = satisfies(version, '>=12.0.0') ? result.result : result
|
|
403
|
+
const getStatus = satisfies(version, '>=7.3.0') ? getStatusFromResultLatest : getStatusFromResult
|
|
404
|
+
|
|
405
|
+
const { status, skipReason, errorMessage } = getStatus(finalResult)
|
|
404
406
|
|
|
405
407
|
testFinishCh.publish({ isStep: true, status, skipReason, errorMessage, ...ctx.currentStore })
|
|
406
408
|
})
|
|
@@ -415,18 +417,18 @@ function wrapRun (pl, isLatestVersion) {
|
|
|
415
417
|
})
|
|
416
418
|
}
|
|
417
419
|
|
|
418
|
-
function pickleHook (PickleRunner) {
|
|
420
|
+
function pickleHook (PickleRunner, version) {
|
|
419
421
|
const pl = PickleRunner.default
|
|
420
422
|
|
|
421
|
-
wrapRun(pl, false)
|
|
423
|
+
wrapRun(pl, false, version)
|
|
422
424
|
|
|
423
425
|
return PickleRunner
|
|
424
426
|
}
|
|
425
427
|
|
|
426
|
-
function testCaseHook (TestCaseRunner) {
|
|
428
|
+
function testCaseHook (TestCaseRunner, version) {
|
|
427
429
|
const pl = TestCaseRunner.default
|
|
428
430
|
|
|
429
|
-
wrapRun(pl, true)
|
|
431
|
+
wrapRun(pl, true, version)
|
|
430
432
|
|
|
431
433
|
return TestCaseRunner
|
|
432
434
|
}
|
|
@@ -14,6 +14,7 @@ const pathParamsReadCh = channel('datadog:fastify:path-params:finish')
|
|
|
14
14
|
|
|
15
15
|
const parsingResources = new WeakMap()
|
|
16
16
|
const cookiesPublished = new WeakSet()
|
|
17
|
+
const bodyPublished = new WeakSet()
|
|
17
18
|
|
|
18
19
|
function wrapFastify (fastify, hasParsingEvents) {
|
|
19
20
|
if (typeof fastify !== 'function') return fastify
|
|
@@ -124,6 +125,20 @@ function preHandler (request, reply, done) {
|
|
|
124
125
|
if (!reply || typeof reply.send !== 'function') return done()
|
|
125
126
|
|
|
126
127
|
const req = getReq(request)
|
|
128
|
+
const res = getRes(reply)
|
|
129
|
+
|
|
130
|
+
const hasBody = request.body && Object.keys(request.body).length > 0
|
|
131
|
+
|
|
132
|
+
// For multipart/form-data, the body is not available until after preValidation hook
|
|
133
|
+
if (bodyParserReadCh.hasSubscribers && hasBody && !bodyPublished.has(req)) {
|
|
134
|
+
const abortController = new AbortController()
|
|
135
|
+
|
|
136
|
+
bodyParserReadCh.publish({ req, res, body: request.body, abortController })
|
|
137
|
+
|
|
138
|
+
bodyPublished.add(req)
|
|
139
|
+
|
|
140
|
+
if (abortController.signal.aborted) return
|
|
141
|
+
}
|
|
127
142
|
|
|
128
143
|
reply.send = wrapSend(reply.send, req)
|
|
129
144
|
|
|
@@ -151,11 +166,14 @@ function preValidation (request, reply, done) {
|
|
|
151
166
|
if (abortController.signal.aborted) return
|
|
152
167
|
}
|
|
153
168
|
|
|
154
|
-
|
|
169
|
+
// Analyze body before schema validation
|
|
170
|
+
if (bodyParserReadCh.hasSubscribers && request.body && !bodyPublished.has(req)) {
|
|
155
171
|
abortController ??= new AbortController()
|
|
156
172
|
|
|
157
173
|
bodyParserReadCh.publish({ req, res, body: request.body, abortController })
|
|
158
174
|
|
|
175
|
+
bodyPublished.add(req)
|
|
176
|
+
|
|
159
177
|
if (abortController.signal.aborted) return
|
|
160
178
|
}
|
|
161
179
|
|
|
@@ -58,6 +58,7 @@ module.exports = {
|
|
|
58
58
|
grpc: () => require('../grpc'),
|
|
59
59
|
handlebars: () => require('../handlebars'),
|
|
60
60
|
hapi: () => require('../hapi'),
|
|
61
|
+
hono: { esmFirst: true, fn: () => require('../hono') },
|
|
61
62
|
http: () => require('../http'),
|
|
62
63
|
http2: () => require('../http2'),
|
|
63
64
|
https: () => require('../http'),
|
|
@@ -207,7 +207,7 @@ function filename (name, file) {
|
|
|
207
207
|
// This function captures the instrumentation file name for a given package by parsing the hook require
|
|
208
208
|
// function given the module name. It is used to ensure that instrumentations such as redis
|
|
209
209
|
// that have several different modules being hooked, ie: 'redis' main package, and @redis/client submodule
|
|
210
|
-
// return a consistent instrumentation name. This is used later to ensure that
|
|
210
|
+
// return a consistent instrumentation name. This is used later to ensure that at least some portion of
|
|
211
211
|
// the integration was successfully instrumented. Prevents incorrect `Found incompatible integration version: ` messages
|
|
212
212
|
// Example:
|
|
213
213
|
// redis -> "() => require('../redis')" -> redis
|
|
@@ -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
|
+
})
|