dd-trace 5.122.0 → 5.124.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 +5 -0
- package/ci/test-optimization-validation/framework-adapters/cypress.js +9 -11
- package/ci/test-optimization-validation/scenarios/ci-wiring.js +5 -4
- package/index.d.ts +144 -25
- package/package.json +26 -25
- package/packages/datadog-instrumentations/src/bunyan.js +4 -2
- package/packages/datadog-instrumentations/src/cucumber.js +4 -4
- package/packages/datadog-instrumentations/src/helpers/bunyan.js +12 -3
- package/packages/datadog-instrumentations/src/helpers/pool-acquire.js +1 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js +28 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +1 -0
- package/packages/datadog-instrumentations/src/jest.js +140 -18
- package/packages/datadog-instrumentations/src/mariadb-bundle.js +1597 -0
- package/packages/datadog-instrumentations/src/mariadb.js +7 -0
- package/packages/datadog-instrumentations/src/mocha/utils.js +5 -2
- package/packages/datadog-instrumentations/src/pino.js +15 -4
- package/packages/datadog-instrumentations/src/playwright-reporter.js +149 -1
- package/packages/datadog-instrumentations/src/playwright.js +67 -53
- package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +13 -12
- package/packages/datadog-instrumentations/src/vitest-worker.js +11 -0
- package/packages/datadog-instrumentations/src/webdriverio.js +26 -0
- package/packages/datadog-instrumentations/src/winston.js +6 -3
- package/packages/datadog-plugin-cypress/src/support.js +1 -0
- package/packages/datadog-plugin-http/src/client.js +2 -15
- package/packages/datadog-plugin-http2/src/client.js +2 -15
- package/packages/datadog-plugin-openai-agents/src/integration.js +15 -11
- package/packages/datadog-plugin-playwright/src/index.js +13 -1
- package/packages/datadog-plugin-undici/src/index.js +2 -15
- package/packages/dd-trace/src/aiguard/evaluation.js +94 -20
- package/packages/dd-trace/src/aiguard/integrations/vercel-ai.js +2 -3
- package/packages/dd-trace/src/aiguard/messages/anthropic.js +21 -9
- package/packages/dd-trace/src/aiguard/noop.js +9 -1
- package/packages/dd-trace/src/aiguard/redaction.js +183 -0
- package/packages/dd-trace/src/aiguard/sdk.js +7 -2
- package/packages/dd-trace/src/aiguard/tags.js +2 -0
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +10 -9
- package/packages/dd-trace/src/appsec/reporter.js +2 -0
- package/packages/dd-trace/src/appsec/rule_manager.js +2 -0
- package/packages/dd-trace/src/appsec/telemetry/index.js +13 -0
- package/packages/dd-trace/src/appsec/telemetry/rasp.js +16 -0
- package/packages/dd-trace/src/appsec/telemetry/waf.js +24 -0
- package/packages/dd-trace/src/carrier.js +107 -48
- package/packages/dd-trace/src/ci-visibility/early-flake-detection/get-known-tests.js +5 -5
- package/packages/dd-trace/src/ci-visibility/exporters/agent-proxy/index.js +2 -0
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +5 -3
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/request-tracker.js +51 -26
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +4 -2
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +5 -11
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +6 -4
- package/packages/dd-trace/src/ci-visibility/final-flush.js +20 -0
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +5 -3
- package/packages/dd-trace/src/ci-visibility/log-submission/log-submission-plugin.js +196 -29
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +4 -2
- package/packages/dd-trace/src/ci-visibility/requests/upload-coverage-report.js +4 -2
- package/packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js +4 -2
- package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +5 -5
- package/packages/dd-trace/src/config/generated-config-types.d.ts +6 -0
- package/packages/dd-trace/src/config/index.js +2 -1
- package/packages/dd-trace/src/config/supported-configurations.json +27 -0
- package/packages/dd-trace/src/debugger/constants.js +1 -0
- package/packages/dd-trace/src/debugger/devtools_client/condition.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/index.js +3 -10
- package/packages/dd-trace/src/debugger/devtools_client/send.js +4 -3
- package/packages/dd-trace/src/debugger/index.js +4 -2
- package/packages/dd-trace/src/debugger/inspect-segment.js +154 -0
- package/packages/dd-trace/src/dogstatsd.js +45 -18
- package/packages/dd-trace/src/encode/agentless-json.js +5 -4
- package/packages/dd-trace/src/evp_proxy/constants.js +8 -0
- package/packages/dd-trace/src/evp_proxy/direct.js +64 -0
- package/packages/dd-trace/src/evp_proxy/discovery.js +133 -0
- package/packages/dd-trace/src/evp_proxy/path.js +22 -0
- package/packages/dd-trace/src/exporters/agent/index.js +22 -2
- package/packages/dd-trace/src/exporters/agent/writer.js +4 -4
- package/packages/dd-trace/src/exporters/common/request.js +5 -2
- package/packages/dd-trace/src/exporters/common/writer.js +24 -2
- package/packages/dd-trace/src/exporters/span-stats/index.js +23 -4
- package/packages/dd-trace/src/external-logger/src/index.js +4 -3
- package/packages/dd-trace/src/flush.js +102 -0
- package/packages/dd-trace/src/llmobs/experiments/client.js +10 -2
- package/packages/dd-trace/src/llmobs/experiments/dataset.js +301 -14
- package/packages/dd-trace/src/llmobs/experiments/experiment.js +440 -112
- package/packages/dd-trace/src/llmobs/experiments/index.js +68 -44
- package/packages/dd-trace/src/llmobs/experiments/noop.js +103 -12
- package/packages/dd-trace/src/llmobs/experiments/result.js +1 -0
- package/packages/dd-trace/src/llmobs/experiments/util.js +81 -4
- package/packages/dd-trace/src/llmobs/index.js +80 -17
- package/packages/dd-trace/src/llmobs/noop.js +2 -1
- package/packages/dd-trace/src/llmobs/plugins/anthropic/util.js +8 -4
- package/packages/dd-trace/src/llmobs/plugins/claude-agent-sdk/index.js +6 -3
- package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +13 -6
- package/packages/dd-trace/src/llmobs/plugins/openai-agents/utils.js +5 -7
- package/packages/dd-trace/src/llmobs/writers/base.js +60 -24
- package/packages/dd-trace/src/noop/span.js +5 -0
- package/packages/dd-trace/src/openfeature/constants/constants.js +0 -18
- package/packages/dd-trace/src/openfeature/index.js +7 -4
- package/packages/dd-trace/src/openfeature/writers/base.js +153 -11
- package/packages/dd-trace/src/openfeature/writers/exposures.js +70 -15
- package/packages/dd-trace/src/openfeature/writers/util.js +97 -15
- package/packages/dd-trace/src/opentelemetry/logs/batch_log_processor.js +45 -3
- package/packages/dd-trace/src/opentelemetry/logs/index.js +4 -1
- package/packages/dd-trace/src/opentelemetry/logs/logger_provider.js +7 -4
- package/packages/dd-trace/src/opentelemetry/metrics/index.js +3 -1
- package/packages/dd-trace/src/opentelemetry/metrics/meter_provider.js +8 -0
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_http_metric_exporter.js +4 -2
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_exporter.js +4 -2
- package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +25 -5
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +61 -25
- package/packages/dd-trace/src/opentelemetry/tracer.js +26 -2
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +429 -352
- package/packages/dd-trace/src/opentracing/span.js +28 -0
- package/packages/dd-trace/src/otel-thread-ctx.js +23 -5
- package/packages/dd-trace/src/plugin_manager.js +2 -0
- package/packages/dd-trace/src/plugins/util/status-validator.js +98 -0
- package/packages/dd-trace/src/plugins/util/test.js +74 -21
- package/packages/dd-trace/src/plugins/util/web.js +2 -65
- package/packages/dd-trace/src/profiling/oom.js +4 -3
- package/packages/dd-trace/src/profiling/profiler.js +7 -0
- package/packages/dd-trace/src/profiling/profilers/events.js +3 -3
- package/packages/dd-trace/src/profiling/profilers/wall.js +14 -14
- package/packages/dd-trace/src/proxy.js +36 -8
- package/packages/dd-trace/src/runtime_metrics/index.js +5 -0
- package/packages/dd-trace/src/runtime_metrics/otlp_runtime_metrics.js +5 -0
- package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +17 -6
- package/packages/dd-trace/src/serverless/telemetry-delivery-tracker.js +55 -0
- package/packages/dd-trace/src/serverless/vercel.js +122 -0
- package/packages/dd-trace/src/serverless.js +37 -20
- package/packages/dd-trace/src/span_stats.js +40 -3
- package/packages/dd-trace/src/telemetry/metrics.js +62 -8
- package/packages/dd-trace/src/telemetry/send-data.js +1 -0
- package/packages/dd-trace/src/tracer.js +22 -0
- package/packages/dd-trace/src/web-tags-cache.js +67 -13
- package/vendor/dist/@datadog/openfeature-node-server/index.js +1 -1
- package/vendor/dist/@datadog/sketches-js/index.js +1 -1
- package/vendor/dist/https-proxy-agent/LICENSE +22 -0
- package/vendor/dist/https-proxy-agent/index.js +4 -0
- package/vendor/dist/protobufjs/index.js +1 -1
- package/vendor/dist/protobufjs/minimal/index.js +1 -1
- package/vendor/dist/proxy-from-env/LICENSE +20 -0
- package/vendor/dist/proxy-from-env/index.js +1 -0
package/LICENSE-3rdparty.csv
CHANGED
|
@@ -44,18 +44,21 @@
|
|
|
44
44
|
"@oxc-project/types","https://github.com/oxc-project/oxc","['MIT']","['Boshen and oxc contributors']"
|
|
45
45
|
"@tybys/wasm-util","https://github.com/toyobayashi/wasm-util","['MIT']","['toyobayashi']"
|
|
46
46
|
"@types/estree","https://github.com/DefinitelyTyped/DefinitelyTyped","['MIT']","['DefinitelyTyped']"
|
|
47
|
+
"agent-base","https://github.com/TooTallNate/proxy-agents","['MIT']","['Nathan Rajlich']"
|
|
47
48
|
"argparse","https://github.com/nodeca/argparse","['Python-2.0']","['nodeca']"
|
|
48
49
|
"astring","https://github.com/davidbonnet/astring","['MIT']","['David Bonnet']"
|
|
49
50
|
"cjs-module-lexer","https://github.com/nodejs/cjs-module-lexer","['MIT']","['Guy Bedford']"
|
|
50
51
|
"crypto-randomuuid","npm:crypto-randomuuid","['MIT']","['Stephen Belanger']"
|
|
51
52
|
"dc-polyfill","https://github.com/DataDog/dc-polyfill","['MIT']","['Thomas Hunter II']"
|
|
52
53
|
"dd-trace","https://github.com/DataDog/dd-trace-js","['(Apache-2.0 OR BSD-3-Clause)']","['Datadog Inc. <info@datadoghq.com>']"
|
|
54
|
+
"debug","https://github.com/debug-js/debug","['MIT']","['Josh Junon']"
|
|
53
55
|
"detect-newline","https://github.com/sindresorhus/detect-newline","['MIT']","['Sindre Sorhus']"
|
|
54
56
|
"es-module-lexer","https://github.com/guybedford/es-module-lexer","['MIT']","['Guy Bedford']"
|
|
55
57
|
"escape-string-regexp","https://github.com/sindresorhus/escape-string-regexp","['MIT']","['Sindre Sorhus']"
|
|
56
58
|
"esquery","https://github.com/estools/esquery","['BSD-3-Clause']","['Joel Feenstra']"
|
|
57
59
|
"estraverse","https://github.com/estools/estraverse","['BSD-2-Clause']","['estools']"
|
|
58
60
|
"fast-fifo","https://github.com/mafintosh/fast-fifo","['MIT']","['Mathias Buus']"
|
|
61
|
+
"https-proxy-agent","https://github.com/TooTallNate/proxy-agents","['MIT']","['Nathan Rajlich']"
|
|
59
62
|
"import-in-the-middle","https://github.com/nodejs/import-in-the-middle","['Apache-2.0']","['Bryan English']"
|
|
60
63
|
"istanbul-lib-coverage","https://github.com/istanbuljs/istanbuljs","['BSD-3-Clause']","['Krishnan Anantheswaran']"
|
|
61
64
|
"jest-docblock","https://github.com/jestjs/jest","['MIT']","['jestjs']"
|
|
@@ -68,6 +71,7 @@
|
|
|
68
71
|
"lru-cache","https://github.com/isaacs/node-lru-cache","['ISC']","['Isaac Z. Schlueter']"
|
|
69
72
|
"meriyah","https://github.com/meriyah/meriyah","['ISC']","['Kenny F.']"
|
|
70
73
|
"module-details-from-path","https://github.com/watson/module-details-from-path","['MIT']","['Thomas Watson']"
|
|
74
|
+
"ms","https://github.com/vercel/ms","['MIT']","['vercel']"
|
|
71
75
|
"mutexify","https://github.com/mafintosh/mutexify","['MIT']","['Mathias Buus']"
|
|
72
76
|
"node-addon-api","https://github.com/nodejs/node-addon-api","['MIT']","['nodejs']"
|
|
73
77
|
"node-gyp-build","https://github.com/prebuild/node-gyp-build","['MIT']","['Mathias Buus']"
|
|
@@ -75,6 +79,7 @@
|
|
|
75
79
|
"oxc-parser","https://github.com/oxc-project/oxc","['MIT']","['Boshen and oxc contributors']"
|
|
76
80
|
"pprof-format","https://github.com/DataDog/pprof-format","['MIT']","['Datadog Inc.']"
|
|
77
81
|
"protobufjs","https://github.com/protobufjs/protobuf.js","['BSD-3-Clause']","['Daniel Wirtz']"
|
|
82
|
+
"proxy-from-env","https://github.com/Rob--W/proxy-from-env","['MIT']","['Rob Wu']"
|
|
78
83
|
"queue-tick","https://github.com/mafintosh/queue-tick","['MIT']","['Mathias Buus']"
|
|
79
84
|
"retry","https://github.com/tim-kos/node-retry","['MIT']","['Tim Koschützki']"
|
|
80
85
|
"rfdc","https://github.com/davidmarkclements/rfdc","['MIT']","['David Mark Clements']"
|
|
@@ -40,20 +40,18 @@ function getTestExtension (filename) {
|
|
|
40
40
|
* @returns {string} canonical generated Cypress source
|
|
41
41
|
*/
|
|
42
42
|
function getGeneratedTestContent ({ scenarioId, testName }) {
|
|
43
|
-
|
|
43
|
+
let content = ''
|
|
44
44
|
if (scenarioId === 'atr-fail-once') {
|
|
45
|
-
|
|
45
|
+
content = 'let attempt = 0\n\n'
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
' })',
|
|
47
|
+
content += "describe('dd-test-optimization-validation', () => {\n" +
|
|
48
|
+
` it(${JSON.stringify(testName)}, () => {\n` +
|
|
49
|
+
(scenarioId === 'atr-fail-once'
|
|
50
|
+
? ' expect(attempt++).to.equal(1)\n'
|
|
51
|
+
: ' expect(true).to.equal(true)\n') +
|
|
52
|
+
' })\n' +
|
|
54
53
|
'})'
|
|
55
|
-
|
|
56
|
-
return lines.join('\n')
|
|
54
|
+
return content
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
/**
|
|
@@ -184,12 +184,13 @@ function runCiWiring ({ manifest, framework, projectFileSources }) {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
if (resolution.status !== 'confirmed') {
|
|
187
|
-
|
|
187
|
+
let visibleFacts = ''
|
|
188
188
|
if (initialization.status === 'missing') {
|
|
189
|
-
visibleFacts
|
|
189
|
+
visibleFacts = 'The selected job has no visible dd-trace/ci/init preload.'
|
|
190
190
|
}
|
|
191
191
|
if (ciFacts.transport.status === 'missing') {
|
|
192
|
-
visibleFacts
|
|
192
|
+
if (visibleFacts) visibleFacts += ' '
|
|
193
|
+
visibleFacts += 'The recorded review found no visible Datadog Agent or agentless reporting transport.'
|
|
193
194
|
}
|
|
194
195
|
const recommendation = /working directory/i.test(resolution.reason)
|
|
195
196
|
? 'Keep the CI job\'s actual working directory. Resolve the repository-root wrapper to the selected test ' +
|
|
@@ -199,7 +200,7 @@ function runCiWiring ({ manifest, framework, projectFileSources }) {
|
|
|
199
200
|
return getIncomplete(
|
|
200
201
|
framework,
|
|
201
202
|
'The CI audit remains incomplete because the selected command could not be resolved to the ' +
|
|
202
|
-
`${framework.framework} runner: ${resolution.reason}. ${visibleFacts
|
|
203
|
+
`${framework.framework} runner: ${resolution.reason}. ${visibleFacts}`.trim(),
|
|
203
204
|
{
|
|
204
205
|
...evidence,
|
|
205
206
|
recommendation,
|
package/index.d.ts
CHANGED
|
@@ -358,6 +358,16 @@ declare namespace tracer {
|
|
|
358
358
|
links?: { context: SpanContext, attributes?: Object }[]
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
+
export interface Exception {
|
|
362
|
+
message: string;
|
|
363
|
+
name?: string;
|
|
364
|
+
stack?: string;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export type SpanEventAttributeValue =
|
|
368
|
+
string | number | boolean | Array<string> | Array<number> | Array<boolean>;
|
|
369
|
+
export type SpanEventAttributes = Record<string, SpanEventAttributeValue>;
|
|
370
|
+
|
|
361
371
|
/**
|
|
362
372
|
* Span represents a logical unit of work as part of a broader Trace.
|
|
363
373
|
* Examples of span might include remote procedure calls or a in-process
|
|
@@ -368,6 +378,14 @@ declare namespace tracer {
|
|
|
368
378
|
export interface Span extends opentracing.Span {
|
|
369
379
|
context (): SpanContext;
|
|
370
380
|
|
|
381
|
+
/**
|
|
382
|
+
* Records an exception as a span event without marking the span as failed.
|
|
383
|
+
*
|
|
384
|
+
* @param exception The exception to record.
|
|
385
|
+
* @param attributes Additional attributes for the exception event.
|
|
386
|
+
*/
|
|
387
|
+
recordException (exception: Exception, attributes?: SpanEventAttributes): void;
|
|
388
|
+
|
|
371
389
|
/**
|
|
372
390
|
* Causally links another span to the current span
|
|
373
391
|
*
|
|
@@ -859,6 +877,13 @@ declare namespace tracer {
|
|
|
859
877
|
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
860
878
|
*/
|
|
861
879
|
maxMessagesLength?: number,
|
|
880
|
+
/**
|
|
881
|
+
* Whether AI Guard applies backend-provided sensitive-data redaction replacements.
|
|
882
|
+
* @default true
|
|
883
|
+
* @env DD_AI_GUARD_REDACTION_ENABLED
|
|
884
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
885
|
+
*/
|
|
886
|
+
redactionEnabled?: boolean,
|
|
862
887
|
/**
|
|
863
888
|
* Max size of the content property set in the meta-struct
|
|
864
889
|
* @env DD_AI_GUARD_MAX_CONTENT_SIZE
|
|
@@ -1818,6 +1843,25 @@ declare namespace tracer {
|
|
|
1818
1843
|
};
|
|
1819
1844
|
}
|
|
1820
1845
|
|
|
1846
|
+
/**
|
|
1847
|
+
* A structured content part in an AI Guard message.
|
|
1848
|
+
*/
|
|
1849
|
+
export interface ContentPart {
|
|
1850
|
+
type: string;
|
|
1851
|
+
text?: string;
|
|
1852
|
+
image_url?: { url: string };
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* A conversational message whose content is represented by structured parts.
|
|
1857
|
+
*/
|
|
1858
|
+
export interface ContentPartsMessage {
|
|
1859
|
+
role: string;
|
|
1860
|
+
content: ContentPart[];
|
|
1861
|
+
tool_call_id?: string;
|
|
1862
|
+
tool_calls?: ToolCall[];
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1821
1865
|
/**
|
|
1822
1866
|
* A standard conversational message exchanged with a Large Language Model (LLM).
|
|
1823
1867
|
*/
|
|
@@ -1889,10 +1933,25 @@ declare namespace tracer {
|
|
|
1889
1933
|
|
|
1890
1934
|
export type Message =
|
|
1891
1935
|
| TextMessage
|
|
1936
|
+
| ContentPartsMessage
|
|
1892
1937
|
| AssistantTextMessage
|
|
1893
1938
|
| AssistantToolCallMessage
|
|
1894
1939
|
| ToolMessage;
|
|
1895
1940
|
|
|
1941
|
+
/**
|
|
1942
|
+
* A sensitive data replacement the AI Guard service determined for the evaluated conversation.
|
|
1943
|
+
*/
|
|
1944
|
+
export interface RedactionReplacement {
|
|
1945
|
+
/**
|
|
1946
|
+
* Location of the replaced value within the evaluated conversation (e.g. `messages[0].content`).
|
|
1947
|
+
*/
|
|
1948
|
+
path: string;
|
|
1949
|
+
/**
|
|
1950
|
+
* The value that replaces the sensitive data found at `path`.
|
|
1951
|
+
*/
|
|
1952
|
+
replacement: string;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1896
1955
|
/**
|
|
1897
1956
|
* The result returned by AI Guard after evaluating a conversation.
|
|
1898
1957
|
*/
|
|
@@ -1920,6 +1979,16 @@ declare namespace tracer {
|
|
|
1920
1979
|
* Sensitive Data Scanner findings from the evaluation.
|
|
1921
1980
|
*/
|
|
1922
1981
|
sds: Object[];
|
|
1982
|
+
/**
|
|
1983
|
+
* The evaluated conversation, redacted when required by the AI Guard service.
|
|
1984
|
+
* This may contain sensitive data when redaction is disabled or no replacement was applied.
|
|
1985
|
+
*/
|
|
1986
|
+
messages: Message[];
|
|
1987
|
+
/**
|
|
1988
|
+
* The replacements the AI Guard service determined for the evaluated conversation, reported whether or not
|
|
1989
|
+
* the tracer applied them. Empty when the service determined no replacement.
|
|
1990
|
+
*/
|
|
1991
|
+
redactionReplacements: RedactionReplacement[];
|
|
1923
1992
|
}
|
|
1924
1993
|
|
|
1925
1994
|
/**
|
|
@@ -2317,7 +2386,7 @@ declare namespace tracer {
|
|
|
2317
2386
|
* This plugin automatically instruments the
|
|
2318
2387
|
* [Vercel AI SDK](https://ai-sdk.dev/docs/introduction) module.
|
|
2319
2388
|
*/
|
|
2320
|
-
interface ai extends Instrumentation {}
|
|
2389
|
+
interface ai extends Instrumentation, LLMObsIntegration {}
|
|
2321
2390
|
|
|
2322
2391
|
/**
|
|
2323
2392
|
* This plugin automatically instruments the
|
|
@@ -2335,13 +2404,13 @@ declare namespace tracer {
|
|
|
2335
2404
|
* This plugin automatically instruments the
|
|
2336
2405
|
* [@anthropic-ai/claude-agent-sdk](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) module.
|
|
2337
2406
|
*/
|
|
2338
|
-
interface claude_agent_sdk extends Instrumentation {}
|
|
2407
|
+
interface claude_agent_sdk extends Instrumentation, LLMObsIntegration {}
|
|
2339
2408
|
|
|
2340
2409
|
/**
|
|
2341
2410
|
* This plugin automatically instruments the
|
|
2342
2411
|
* [anthropic](https://www.npmjs.com/package/@anthropic-ai/sdk) module.
|
|
2343
2412
|
*/
|
|
2344
|
-
interface anthropic extends Instrumentation {}
|
|
2413
|
+
interface anthropic extends Instrumentation, LLMObsIntegration {}
|
|
2345
2414
|
|
|
2346
2415
|
/**
|
|
2347
2416
|
* Currently this plugin automatically instruments
|
|
@@ -2402,7 +2471,7 @@ declare namespace tracer {
|
|
|
2402
2471
|
* This plugin automatically instruments the
|
|
2403
2472
|
* [aws-sdk](https://github.com/aws/aws-sdk-js) module.
|
|
2404
2473
|
*/
|
|
2405
|
-
interface aws_sdk extends Instrumentation {
|
|
2474
|
+
interface aws_sdk extends Instrumentation, LLMObsIntegration {
|
|
2406
2475
|
/**
|
|
2407
2476
|
* The service name to be used for this plugin. When a function is used it is called with the AWS
|
|
2408
2477
|
* request parameters (e.g. `{ TableName }` for DynamoDB, `{ Bucket }` for S3) and its return value
|
|
@@ -2637,13 +2706,13 @@ declare namespace tracer {
|
|
|
2637
2706
|
* This plugin automatically instruments the
|
|
2638
2707
|
* [@google-cloud/vertexai](https://github.com/googleapis/nodejs-vertexai) module.
|
|
2639
2708
|
*/
|
|
2640
|
-
interface google_cloud_vertexai extends Integration {}
|
|
2709
|
+
interface google_cloud_vertexai extends Integration, LLMObsIntegration {}
|
|
2641
2710
|
|
|
2642
2711
|
/**
|
|
2643
2712
|
* This plugin automatically instruments the
|
|
2644
2713
|
* [@google-genai](https://github.com/googleapis/js-genai) module.
|
|
2645
2714
|
*/
|
|
2646
|
-
interface google_genai extends Integration {}
|
|
2715
|
+
interface google_genai extends Integration, LLMObsIntegration {}
|
|
2647
2716
|
|
|
2648
2717
|
/** @hidden */
|
|
2649
2718
|
interface ExecutionArgs {
|
|
@@ -3001,7 +3070,7 @@ declare namespace tracer {
|
|
|
3001
3070
|
* This plugin automatically instruments the
|
|
3002
3071
|
* [langgraph](https://github.com/npmjs/package/langgraph) library.
|
|
3003
3072
|
*/
|
|
3004
|
-
interface langgraph extends Instrumentation {}
|
|
3073
|
+
interface langgraph extends Instrumentation, LLMObsIntegration {}
|
|
3005
3074
|
|
|
3006
3075
|
/**
|
|
3007
3076
|
* This plugin automatically instruments the
|
|
@@ -3161,13 +3230,13 @@ declare namespace tracer {
|
|
|
3161
3230
|
* [DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent#setup)
|
|
3162
3231
|
* in the agent.
|
|
3163
3232
|
*/
|
|
3164
|
-
interface openai extends Instrumentation {}
|
|
3233
|
+
interface openai extends Instrumentation, LLMObsIntegration {}
|
|
3165
3234
|
|
|
3166
3235
|
/**
|
|
3167
3236
|
* This plugin automatically instruments the
|
|
3168
3237
|
* [@openai/agents](https://www.npmjs.com/package/@openai/agents) library.
|
|
3169
3238
|
*/
|
|
3170
|
-
interface openai_agents extends Instrumentation {}
|
|
3239
|
+
interface openai_agents extends Instrumentation, LLMObsIntegration {}
|
|
3171
3240
|
|
|
3172
3241
|
/**
|
|
3173
3242
|
* This plugin automatically instruments the
|
|
@@ -3816,7 +3885,7 @@ declare namespace tracer {
|
|
|
3816
3885
|
*
|
|
3817
3886
|
* @deprecated Enabling LLM Observability via `llmobs.enable()` is deprecated and will be removed in dd-trace@7.0.0. Please instantiate LLM Observability via DD_LLMOBS_ENABLED or `tracer.init({ llmobs: ...options })`.
|
|
3818
3887
|
*/
|
|
3819
|
-
enable (options:
|
|
3888
|
+
enable (options: LLMObsRuntimeEnableOptions): void,
|
|
3820
3889
|
|
|
3821
3890
|
/**
|
|
3822
3891
|
* Disable LLM Observability tracing.
|
|
@@ -3995,20 +4064,35 @@ declare namespace tracer {
|
|
|
3995
4064
|
metadata?: Array<Record<string, any>>
|
|
3996
4065
|
) => any | Promise<any>
|
|
3997
4066
|
|
|
4067
|
+
interface DatasetRecord {
|
|
4068
|
+
id: string | null
|
|
4069
|
+
input: JSONType
|
|
4070
|
+
expectedOutput: JSONType
|
|
4071
|
+
metadata: Record<string, JSONType>
|
|
4072
|
+
tags: string[]
|
|
4073
|
+
}
|
|
4074
|
+
|
|
4075
|
+
interface DatasetRecordNew {
|
|
4076
|
+
id?: string
|
|
4077
|
+
inputData: JSONType
|
|
4078
|
+
expectedOutput?: JSONType
|
|
4079
|
+
metadata?: Record<string, JSONType>
|
|
4080
|
+
tags?: string[]
|
|
4081
|
+
}
|
|
4082
|
+
|
|
3998
4083
|
interface CreateDatasetOptions {
|
|
4084
|
+
/** Override the configured project for this dataset. */
|
|
4085
|
+
projectName?: string
|
|
3999
4086
|
description?: string
|
|
4000
|
-
records?:
|
|
4001
|
-
id?: string,
|
|
4002
|
-
inputData: JSONType,
|
|
4003
|
-
expectedOutput?: JSONType,
|
|
4004
|
-
metadata?: Record<string, JSONType>
|
|
4005
|
-
}>
|
|
4087
|
+
records?: DatasetRecordNew[]
|
|
4006
4088
|
}
|
|
4007
4089
|
|
|
4008
4090
|
interface ExperimentOptions {
|
|
4009
4091
|
name: string
|
|
4010
4092
|
dataset: Dataset
|
|
4011
4093
|
task: ExperimentTask
|
|
4094
|
+
/** Override the configured project for this experiment. */
|
|
4095
|
+
projectName?: string
|
|
4012
4096
|
/** Evaluators keyed by metric label, or named functions. */
|
|
4013
4097
|
evaluators?: Record<string, ExperimentEvaluator> | ExperimentEvaluator[]
|
|
4014
4098
|
/** Summary evaluators keyed by metric label, or named functions. */
|
|
@@ -4016,6 +4100,8 @@ declare namespace tracer {
|
|
|
4016
4100
|
description?: string
|
|
4017
4101
|
config?: Record<string, JSONType>
|
|
4018
4102
|
tags?: Record<string, string>
|
|
4103
|
+
/** Number of full experiment runs to execute. Default 1. */
|
|
4104
|
+
runs?: number
|
|
4019
4105
|
}
|
|
4020
4106
|
|
|
4021
4107
|
interface ExperimentRunOptions {
|
|
@@ -4025,15 +4111,21 @@ declare namespace tracer {
|
|
|
4025
4111
|
retryDelay?: (attempt: number) => number
|
|
4026
4112
|
/** Reject on the first task/evaluator error instead of capturing it. Default false. */
|
|
4027
4113
|
throwOnErrors?: boolean
|
|
4114
|
+
/** Maximum number of task/evaluator executions to process concurrently. Default 10. */
|
|
4115
|
+
concurrency?: number
|
|
4028
4116
|
}
|
|
4029
4117
|
|
|
4030
4118
|
interface PullDatasetOptions {
|
|
4119
|
+
/** Override the configured project for this dataset pull. */
|
|
4120
|
+
projectName?: string
|
|
4031
4121
|
/** Dataset version to pull. Defaults to latest. */
|
|
4032
4122
|
version?: number
|
|
4033
4123
|
/** Wait until at least this many records are readable (absorbs write lag). */
|
|
4034
4124
|
expectedRecordCount?: number
|
|
4035
4125
|
/** Maximum total time to wait, in ms. Default 30000. */
|
|
4036
4126
|
maxWaitMs?: number
|
|
4127
|
+
/** Filter records by these tags. */
|
|
4128
|
+
tags?: string[]
|
|
4037
4129
|
}
|
|
4038
4130
|
|
|
4039
4131
|
interface ExperimentResultRow {
|
|
@@ -4054,17 +4146,21 @@ declare namespace tracer {
|
|
|
4054
4146
|
|
|
4055
4147
|
interface ExperimentRun {
|
|
4056
4148
|
runId: string
|
|
4149
|
+
/** 1-based run iteration. */
|
|
4057
4150
|
runIteration: number
|
|
4151
|
+
/** Whether this run had a task, row-evaluator, or summary-evaluator error. */
|
|
4152
|
+
hasError: boolean
|
|
4058
4153
|
rows: ExperimentResultRow[]
|
|
4059
4154
|
summaryEvaluations: Record<string, { value: any, error: string | null }>
|
|
4060
4155
|
}
|
|
4061
4156
|
|
|
4062
4157
|
interface ExperimentResult {
|
|
4063
4158
|
experimentId: string
|
|
4159
|
+
/** Rows from the first run, kept as a compatibility alias. */
|
|
4064
4160
|
rows: ExperimentResultRow[]
|
|
4065
|
-
/**
|
|
4161
|
+
/** Summary evaluator results from the first run, kept as a compatibility alias. */
|
|
4066
4162
|
summaryEvaluations: Record<string, { value: any, error: string | null }>
|
|
4067
|
-
/**
|
|
4163
|
+
/** All experiment runs. */
|
|
4068
4164
|
runs: ExperimentRun[]
|
|
4069
4165
|
/** Dashboard URL for the experiment. */
|
|
4070
4166
|
url: string
|
|
@@ -4151,7 +4247,14 @@ declare namespace tracer {
|
|
|
4151
4247
|
}
|
|
4152
4248
|
|
|
4153
4249
|
interface Dataset {
|
|
4154
|
-
addRecord (
|
|
4250
|
+
addRecord (
|
|
4251
|
+
input: JSONType,
|
|
4252
|
+
expectedOutput?: JSONType,
|
|
4253
|
+
metadata?: Record<string, JSONType>,
|
|
4254
|
+
tags?: string[]
|
|
4255
|
+
): Dataset
|
|
4256
|
+
/** Add multiple records to the dataset. */
|
|
4257
|
+
addRecords (records: DatasetRecordNew[]): Dataset
|
|
4155
4258
|
/** Update fields on an existing dataset record. */
|
|
4156
4259
|
update (index: number, fields: {
|
|
4157
4260
|
input?: JSONType
|
|
@@ -4160,20 +4263,25 @@ declare namespace tracer {
|
|
|
4160
4263
|
}): Dataset
|
|
4161
4264
|
/** Delete an existing dataset record. */
|
|
4162
4265
|
delete (index: number): Dataset
|
|
4266
|
+
/** Add tags to a dataset record. */
|
|
4267
|
+
addTags (index: number, tags: string[]): Dataset
|
|
4268
|
+
/** Remove tags from a dataset record. */
|
|
4269
|
+
removeTags (index: number, tags: string[]): Dataset
|
|
4270
|
+
/** Replace all tags on a dataset record. */
|
|
4271
|
+
replaceTags (index: number, tags: string[]): Dataset
|
|
4163
4272
|
/** Creates the dataset remotely if needed and pushes any unpushed records. */
|
|
4164
4273
|
push (): Promise<DatasetPushResult>
|
|
4165
4274
|
name (): string
|
|
4166
4275
|
description (): string
|
|
4167
4276
|
id (): string | null
|
|
4168
4277
|
projectId (): string | null
|
|
4278
|
+
/** Project associated with the client used to create or pull this dataset. */
|
|
4279
|
+
projectName (): string | null | undefined
|
|
4169
4280
|
version (): number | null
|
|
4170
4281
|
latestVersion (): number | null
|
|
4171
|
-
records ():
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
expectedOutput: JSONType,
|
|
4175
|
-
metadata: Record<string, JSONType>
|
|
4176
|
-
}>
|
|
4282
|
+
records (): DatasetRecord[]
|
|
4283
|
+
/** Return the tags used to filter this dataset. */
|
|
4284
|
+
filterTags (): string[]
|
|
4177
4285
|
/** Dashboard URL for the dataset, or null until pushed. */
|
|
4178
4286
|
url (): string | null
|
|
4179
4287
|
}
|
|
@@ -4689,6 +4797,13 @@ declare namespace tracer {
|
|
|
4689
4797
|
* Options for enabling LLM Observability tracing.
|
|
4690
4798
|
*/
|
|
4691
4799
|
interface LLMObsEnableOptions {
|
|
4800
|
+
/**
|
|
4801
|
+
* The name of the LLM Observability project used for experiments.
|
|
4802
|
+
* @env DD_LLMOBS_PROJECT_NAME
|
|
4803
|
+
* Programmatic configuration takes precedence over the environment variables listed above.
|
|
4804
|
+
*/
|
|
4805
|
+
projectName?: string,
|
|
4806
|
+
|
|
4692
4807
|
/**
|
|
4693
4808
|
* The name of your ML application.
|
|
4694
4809
|
* @env DD_LLMOBS_ML_APP
|
|
@@ -4712,6 +4827,10 @@ declare namespace tracer {
|
|
|
4712
4827
|
*/
|
|
4713
4828
|
sampleRate?: number,
|
|
4714
4829
|
}
|
|
4830
|
+
|
|
4831
|
+
/** Options accepted by the deprecated runtime `llmobs.enable()` method. */
|
|
4832
|
+
type LLMObsRuntimeEnableOptions = Omit<LLMObsEnableOptions, 'projectName'>
|
|
4833
|
+
|
|
4715
4834
|
/** @hidden */
|
|
4716
4835
|
type spanKind = 'agent' | 'workflow' | 'task' | 'tool' | 'retrieval' | 'embedding' | 'llm'
|
|
4717
4836
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dd-trace",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.124.0",
|
|
4
4
|
"description": "Datadog APM tracing client for JavaScript",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -57,13 +57,14 @@
|
|
|
57
57
|
"test:core:ci": "node scripts/c8-ci.js test:core",
|
|
58
58
|
"test:code-origin": "mocha \"packages/datadog-code-origin/test/**/*.spec.js\"",
|
|
59
59
|
"test:code-origin:ci": "node scripts/c8-ci.js test:code-origin",
|
|
60
|
+
"test:evp_proxy": "mocha \"packages/dd-trace/test/evp_proxy/**/*.spec.js\"",
|
|
60
61
|
"test:lambda": "mocha \"packages/dd-trace/test/lambda/**/*.spec.js\"",
|
|
61
62
|
"test:lambda:ci": "node scripts/c8-ci.js test:lambda",
|
|
62
63
|
"test:llmobs:sdk": "mocha --exclude \"packages/dd-trace/test/llmobs/plugins/**/*.spec.js\" \"packages/dd-trace/test/llmobs/**/*.spec.js\"",
|
|
63
64
|
"test:llmobs:sdk:ci": "node scripts/c8-ci.js test:llmobs:sdk",
|
|
64
65
|
"test:llmobs:plugins": "mocha \"packages/dd-trace/test/llmobs/plugins/@(${PLUGINS})/*.spec.js\"",
|
|
65
66
|
"test:llmobs:plugins:ci": "yarn services && node scripts/c8-ci.js test:llmobs:plugins",
|
|
66
|
-
"test:openfeature": "mocha \"packages/dd-trace/test/openfeature/**/*.spec.js\"",
|
|
67
|
+
"test:openfeature": "mocha \"packages/dd-trace/test/evp_proxy/**/*.spec.js\" \"packages/dd-trace/test/openfeature/**/*.spec.js\"",
|
|
67
68
|
"test:openfeature:ci": "node scripts/c8-ci.js test:openfeature",
|
|
68
69
|
"test:plugins": "node --expose-gc ./node_modules/mocha/bin/mocha.js --fail-zero \"packages/datadog-plugin-@(${PLUGINS})/test/**/${SPEC:-*}*.spec.js\"",
|
|
69
70
|
"test:plugins:ci": "yarn services && node scripts/c8-ci.js test:plugins",
|
|
@@ -114,7 +115,7 @@
|
|
|
114
115
|
"test:integration:plugins:coverage": "yarn services && node ./integration-tests/coverage/run-suite.js \"packages/datadog-plugin-@(${PLUGINS})/test/integration-test/**/${SPEC:-*}*.spec.js\"",
|
|
115
116
|
"test:unit:plugins": "mocha \"packages/datadog-instrumentations/test/@(${PLUGINS}).spec.js\" \"packages/datadog-plugin-@(${PLUGINS})/test/**/*.spec.js\" --exclude \"packages/datadog-plugin-@(${PLUGINS})/test/integration-test/**/*.spec.js\"",
|
|
116
117
|
"test:release": "mocha \"scripts/release/**/*.spec.js\"",
|
|
117
|
-
"test:scripts": "mocha \"benchmark/sirun/*.spec.js\" \"scripts/helpers/**/*.spec.js\" \"scripts/*.spec.mjs\"",
|
|
118
|
+
"test:scripts": "mocha \"benchmark/e2e-test-optimization/*.spec.js\" \"benchmark/sirun/*.spec.js\" \"scripts/helpers/**/*.spec.js\" \"scripts/*.spec.mjs\"",
|
|
118
119
|
"test:shimmer": "mocha \"packages/datadog-shimmer/test/**/*.spec.js\"",
|
|
119
120
|
"test:shimmer:ci": "node scripts/c8-ci.js test:shimmer",
|
|
120
121
|
"verify:workflow-job-names": "node scripts/verify-workflow-job-names.js",
|
|
@@ -183,11 +184,11 @@
|
|
|
183
184
|
},
|
|
184
185
|
"optionalDependencies": {
|
|
185
186
|
"@datadog/libdatadog": "0.12.1",
|
|
186
|
-
"@datadog/native-appsec": "11.0.
|
|
187
|
-
"@datadog/native-iast-taint-tracking": "4.2.
|
|
188
|
-
"@datadog/native-metrics": "
|
|
189
|
-
"@datadog/pprof": "5.18.
|
|
190
|
-
"@datadog/wasm-js-rewriter": "5.0.
|
|
187
|
+
"@datadog/native-appsec": "11.0.2",
|
|
188
|
+
"@datadog/native-iast-taint-tracking": "4.2.1",
|
|
189
|
+
"@datadog/native-metrics": "4.0.0",
|
|
190
|
+
"@datadog/pprof": "5.18.1",
|
|
191
|
+
"@datadog/wasm-js-rewriter": "5.0.4",
|
|
191
192
|
"@opentelemetry/api": ">=1.0.0 <1.10.0",
|
|
192
193
|
"@opentelemetry/api-logs": "<1.0.0",
|
|
193
194
|
"oxc-parser": "^0.132.0"
|
|
@@ -196,58 +197,58 @@
|
|
|
196
197
|
"@actions/core": "^3.0.1",
|
|
197
198
|
"@actions/github": "^9.1.1",
|
|
198
199
|
"@babel/helpers": "^8.0.0",
|
|
199
|
-
"@eslint/eslintrc": "^3.3.
|
|
200
|
+
"@eslint/eslintrc": "^3.3.6",
|
|
200
201
|
"@eslint/js": "^10.0.1",
|
|
201
202
|
"@eslint/plugin-kit": "^0.7.2",
|
|
202
|
-
"@datadog/openfeature-node-server": "2.
|
|
203
|
+
"@datadog/openfeature-node-server": "2.2.0",
|
|
203
204
|
"@msgpack/msgpack": "^3.1.3",
|
|
204
|
-
"@openfeature/core": "^1.
|
|
205
|
-
"@openfeature/server-sdk": "~1.
|
|
205
|
+
"@openfeature/core": "^1.12.0",
|
|
206
|
+
"@openfeature/server-sdk": "~1.23.0",
|
|
206
207
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
207
208
|
"@types/mocha": "^10.0.10",
|
|
208
209
|
"@types/node": "^18.19.106",
|
|
209
210
|
"@types/sinon": "^22.0.0",
|
|
210
|
-
"@vercel/nft": "^1.
|
|
211
|
+
"@vercel/nft": "^1.11.0",
|
|
211
212
|
"@yarnpkg/lockfile": "^1.1.0",
|
|
212
|
-
"axios": "^1.
|
|
213
|
+
"axios": "^1.19.0",
|
|
213
214
|
"benchmark": "^2.1.4",
|
|
214
215
|
"body-parser": "^2.3.0",
|
|
215
|
-
"bun": "1.
|
|
216
|
+
"bun": "1.4.0",
|
|
216
217
|
"c8": "^12.0.0",
|
|
217
218
|
"codeowners-audit": "^2.9.0",
|
|
218
|
-
"eslint": "^10.
|
|
219
|
-
"eslint-plugin-cypress": "^
|
|
219
|
+
"eslint": "^10.8.1",
|
|
220
|
+
"eslint-plugin-cypress": "^7.0.0",
|
|
220
221
|
"eslint-plugin-import-x": "^4.16.2",
|
|
221
|
-
"eslint-plugin-jsdoc": "^
|
|
222
|
+
"eslint-plugin-jsdoc": "^64.2.1",
|
|
222
223
|
"eslint-plugin-mocha": "^11.3.0",
|
|
223
|
-
"eslint-plugin-n": "^18.
|
|
224
|
+
"eslint-plugin-n": "^18.3.0",
|
|
224
225
|
"eslint-plugin-promise": "^7.3.0",
|
|
225
226
|
"eslint-plugin-sonarjs": "^4.2.0",
|
|
226
227
|
"eslint-plugin-unicorn": "^73.0.0",
|
|
227
228
|
"express": "^5.1.0",
|
|
228
229
|
"glob": "^10.4.5",
|
|
229
|
-
"globals": "^17.
|
|
230
|
+
"globals": "^17.11.0",
|
|
230
231
|
"graphql": "*",
|
|
231
232
|
"husky": "^9.1.7",
|
|
232
233
|
"istanbul-lib-report": "^3.0.0",
|
|
233
234
|
"istanbul-reports": "^3.0.2",
|
|
234
235
|
"jsonc-parser": "^3.3.1",
|
|
235
236
|
"jszip": "^3.10.1",
|
|
236
|
-
"minimatch": "^10.2.
|
|
237
|
-
"mocha": "^11.
|
|
237
|
+
"minimatch": "^10.2.6",
|
|
238
|
+
"mocha": "^11.8.0",
|
|
238
239
|
"mocha-junit-reporter": "^2.2.1",
|
|
239
240
|
"mocha-multi-reporters": "^1.5.1",
|
|
240
241
|
"multer": "^2.2.0",
|
|
241
|
-
"nock": "^14.0.
|
|
242
|
+
"nock": "^14.0.17",
|
|
242
243
|
"node-preload": "^0.2.1",
|
|
243
244
|
"nyc": "^18.0.0",
|
|
244
245
|
"octokit": "^5.0.3",
|
|
245
|
-
"p-limit": "^7.
|
|
246
|
+
"p-limit": "^7.3.1",
|
|
246
247
|
"proxyquire": "^2.1.3",
|
|
247
248
|
"retry": "^0.13.1",
|
|
248
249
|
"semifies": "^1.0.0",
|
|
249
250
|
"semver": "^7.8.5",
|
|
250
|
-
"sinon": "^22.
|
|
251
|
+
"sinon": "^22.1.0",
|
|
251
252
|
"source-map-support": "^0.5.21",
|
|
252
253
|
"test-exclude": "^8.0.0",
|
|
253
254
|
"tiktoken": "^1.0.21",
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const wrapLogger = require('./helpers/bunyan')
|
|
4
|
-
const { addHook } = require('./helpers/instrument')
|
|
4
|
+
const { addHook, channel } = require('./helpers/instrument')
|
|
5
|
+
|
|
6
|
+
const logSubmissionCh = channel('ci:log-submission:log')
|
|
5
7
|
|
|
6
8
|
addHook({ name: 'bunyan', versions: ['>=1'] }, Logger => {
|
|
7
|
-
wrapLogger(Logger, 'bunyan')
|
|
9
|
+
wrapLogger(Logger, 'bunyan', logSubmissionCh)
|
|
8
10
|
return Logger
|
|
9
11
|
})
|
|
@@ -1482,14 +1482,14 @@ function getWrappedRunTestCase (runTestCaseFunction, isNewerCucumberVersion = fa
|
|
|
1482
1482
|
|
|
1483
1483
|
this.options.retry = originalRetry
|
|
1484
1484
|
|
|
1485
|
-
if (isNewerCucumberVersion && shouldRunEarlyFlakeDetection() && (isNew || isModified)) {
|
|
1486
|
-
return shouldBePassedByEFD
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
1485
|
if (isNewerCucumberVersion && isTestManagementTestsEnabled && !isAttemptToFix && (isQuarantined || isDisabled)) {
|
|
1490
1486
|
return shouldBePassedByTestManagement
|
|
1491
1487
|
}
|
|
1492
1488
|
|
|
1489
|
+
if (isNewerCucumberVersion && shouldRunEarlyFlakeDetection() && (isNew || isModified)) {
|
|
1490
|
+
return shouldBePassedByEFD
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
1493
|
if (isNewerCucumberVersion && isAttemptToFix && shouldBeFailedByAttemptToFix) {
|
|
1494
1494
|
return false
|
|
1495
1495
|
}
|
|
@@ -6,17 +6,26 @@ const { channel } = require('./instrument')
|
|
|
6
6
|
/**
|
|
7
7
|
* @param {{ prototype: object }} Logger
|
|
8
8
|
* @param {string} id
|
|
9
|
+
* @param {import('node:diagnostics_channel').Channel} [logSubmissionCh]
|
|
9
10
|
*/
|
|
10
|
-
module.exports = function wrapLogger (Logger, id) {
|
|
11
|
+
module.exports = function wrapLogger (Logger, id, logSubmissionCh) {
|
|
11
12
|
const logCh = channel(`apm:${id}:log`)
|
|
13
|
+
// The record must be replaceable before Bunyan emits it, while the serialized line is only available afterward.
|
|
14
|
+
// This before-and-after contract requires the existing runtime wrapper rather than an Orchestrion subscriber.
|
|
12
15
|
shimmer.wrap(Logger.prototype, '_emit', emit => {
|
|
13
16
|
return function wrappedEmit (rec) {
|
|
14
17
|
if (logCh.hasSubscribers) {
|
|
15
18
|
const payload = { message: rec }
|
|
16
19
|
logCh.publish(payload)
|
|
17
|
-
arguments[0] = payload.message
|
|
20
|
+
rec = arguments[0] = payload.message
|
|
18
21
|
}
|
|
19
|
-
|
|
22
|
+
|
|
23
|
+
// Reuse Bunyan's cycle-safe serialization instead of serializing the record again.
|
|
24
|
+
const line = emit.apply(this, arguments)
|
|
25
|
+
if (logSubmissionCh?.hasSubscribers && logCh.hasSubscribers && !arguments[1]) {
|
|
26
|
+
logSubmissionCh.publish({ source: id, message: line ?? rec })
|
|
27
|
+
}
|
|
28
|
+
return line
|
|
20
29
|
}
|
|
21
30
|
})
|
|
22
31
|
}
|