dd-trace 5.123.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/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 +128 -26
- package/package.json +10 -10
- package/packages/datadog-instrumentations/src/bunyan.js +4 -2
- 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/pino.js +15 -4
- package/packages/datadog-instrumentations/src/playwright.js +34 -20
- package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +7 -4
- 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 +9 -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/rule_manager.js +2 -0
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/request-tracker.js +51 -26
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +5 -11
- package/packages/dd-trace/src/ci-visibility/final-flush.js +20 -0
- package/packages/dd-trace/src/ci-visibility/log-submission/log-submission-plugin.js +196 -29
- 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/devtools_client/send.js +4 -3
- 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/exporters/agent/index.js +22 -2
- package/packages/dd-trace/src/exporters/agent/writer.js +4 -4
- 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 +4 -0
- package/packages/dd-trace/src/llmobs/experiments/dataset.js +51 -2
- package/packages/dd-trace/src/llmobs/experiments/experiment.js +420 -105
- package/packages/dd-trace/src/llmobs/experiments/index.js +54 -42
- package/packages/dd-trace/src/llmobs/experiments/noop.js +39 -8
- package/packages/dd-trace/src/llmobs/experiments/result.js +1 -0
- package/packages/dd-trace/src/llmobs/experiments/util.js +21 -0
- 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/writers/exposures.js +8 -1
- 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 +410 -342
- 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/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
|
@@ -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,21 +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
|
-
tags?: string[]
|
|
4006
|
-
}>
|
|
4087
|
+
records?: DatasetRecordNew[]
|
|
4007
4088
|
}
|
|
4008
4089
|
|
|
4009
4090
|
interface ExperimentOptions {
|
|
4010
4091
|
name: string
|
|
4011
4092
|
dataset: Dataset
|
|
4012
4093
|
task: ExperimentTask
|
|
4094
|
+
/** Override the configured project for this experiment. */
|
|
4095
|
+
projectName?: string
|
|
4013
4096
|
/** Evaluators keyed by metric label, or named functions. */
|
|
4014
4097
|
evaluators?: Record<string, ExperimentEvaluator> | ExperimentEvaluator[]
|
|
4015
4098
|
/** Summary evaluators keyed by metric label, or named functions. */
|
|
@@ -4017,6 +4100,8 @@ declare namespace tracer {
|
|
|
4017
4100
|
description?: string
|
|
4018
4101
|
config?: Record<string, JSONType>
|
|
4019
4102
|
tags?: Record<string, string>
|
|
4103
|
+
/** Number of full experiment runs to execute. Default 1. */
|
|
4104
|
+
runs?: number
|
|
4020
4105
|
}
|
|
4021
4106
|
|
|
4022
4107
|
interface ExperimentRunOptions {
|
|
@@ -4026,9 +4111,13 @@ declare namespace tracer {
|
|
|
4026
4111
|
retryDelay?: (attempt: number) => number
|
|
4027
4112
|
/** Reject on the first task/evaluator error instead of capturing it. Default false. */
|
|
4028
4113
|
throwOnErrors?: boolean
|
|
4114
|
+
/** Maximum number of task/evaluator executions to process concurrently. Default 10. */
|
|
4115
|
+
concurrency?: number
|
|
4029
4116
|
}
|
|
4030
4117
|
|
|
4031
4118
|
interface PullDatasetOptions {
|
|
4119
|
+
/** Override the configured project for this dataset pull. */
|
|
4120
|
+
projectName?: string
|
|
4032
4121
|
/** Dataset version to pull. Defaults to latest. */
|
|
4033
4122
|
version?: number
|
|
4034
4123
|
/** Wait until at least this many records are readable (absorbs write lag). */
|
|
@@ -4057,17 +4146,21 @@ declare namespace tracer {
|
|
|
4057
4146
|
|
|
4058
4147
|
interface ExperimentRun {
|
|
4059
4148
|
runId: string
|
|
4149
|
+
/** 1-based run iteration. */
|
|
4060
4150
|
runIteration: number
|
|
4151
|
+
/** Whether this run had a task, row-evaluator, or summary-evaluator error. */
|
|
4152
|
+
hasError: boolean
|
|
4061
4153
|
rows: ExperimentResultRow[]
|
|
4062
4154
|
summaryEvaluations: Record<string, { value: any, error: string | null }>
|
|
4063
4155
|
}
|
|
4064
4156
|
|
|
4065
4157
|
interface ExperimentResult {
|
|
4066
4158
|
experimentId: string
|
|
4159
|
+
/** Rows from the first run, kept as a compatibility alias. */
|
|
4067
4160
|
rows: ExperimentResultRow[]
|
|
4068
|
-
/**
|
|
4161
|
+
/** Summary evaluator results from the first run, kept as a compatibility alias. */
|
|
4069
4162
|
summaryEvaluations: Record<string, { value: any, error: string | null }>
|
|
4070
|
-
/**
|
|
4163
|
+
/** All experiment runs. */
|
|
4071
4164
|
runs: ExperimentRun[]
|
|
4072
4165
|
/** Dashboard URL for the experiment. */
|
|
4073
4166
|
url: string
|
|
@@ -4160,6 +4253,8 @@ declare namespace tracer {
|
|
|
4160
4253
|
metadata?: Record<string, JSONType>,
|
|
4161
4254
|
tags?: string[]
|
|
4162
4255
|
): Dataset
|
|
4256
|
+
/** Add multiple records to the dataset. */
|
|
4257
|
+
addRecords (records: DatasetRecordNew[]): Dataset
|
|
4163
4258
|
/** Update fields on an existing dataset record. */
|
|
4164
4259
|
update (index: number, fields: {
|
|
4165
4260
|
input?: JSONType
|
|
@@ -4180,15 +4275,11 @@ declare namespace tracer {
|
|
|
4180
4275
|
description (): string
|
|
4181
4276
|
id (): string | null
|
|
4182
4277
|
projectId (): string | null
|
|
4278
|
+
/** Project associated with the client used to create or pull this dataset. */
|
|
4279
|
+
projectName (): string | null | undefined
|
|
4183
4280
|
version (): number | null
|
|
4184
4281
|
latestVersion (): number | null
|
|
4185
|
-
records ():
|
|
4186
|
-
id: string | null,
|
|
4187
|
-
input: JSONType,
|
|
4188
|
-
expectedOutput: JSONType,
|
|
4189
|
-
metadata: Record<string, JSONType>,
|
|
4190
|
-
tags: string[]
|
|
4191
|
-
}>
|
|
4282
|
+
records (): DatasetRecord[]
|
|
4192
4283
|
/** Return the tags used to filter this dataset. */
|
|
4193
4284
|
filterTags (): string[]
|
|
4194
4285
|
/** Dashboard URL for the dataset, or null until pushed. */
|
|
@@ -4706,6 +4797,13 @@ declare namespace tracer {
|
|
|
4706
4797
|
* Options for enabling LLM Observability tracing.
|
|
4707
4798
|
*/
|
|
4708
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
|
+
|
|
4709
4807
|
/**
|
|
4710
4808
|
* The name of your ML application.
|
|
4711
4809
|
* @env DD_LLMOBS_ML_APP
|
|
@@ -4729,6 +4827,10 @@ declare namespace tracer {
|
|
|
4729
4827
|
*/
|
|
4730
4828
|
sampleRate?: number,
|
|
4731
4829
|
}
|
|
4830
|
+
|
|
4831
|
+
/** Options accepted by the deprecated runtime `llmobs.enable()` method. */
|
|
4832
|
+
type LLMObsRuntimeEnableOptions = Omit<LLMObsEnableOptions, 'projectName'>
|
|
4833
|
+
|
|
4732
4834
|
/** @hidden */
|
|
4733
4835
|
type spanKind = 'agent' | 'workflow' | 'task' | 'tool' | 'retrieval' | 'embedding' | 'llm'
|
|
4734
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",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"test:integration:plugins:coverage": "yarn services && node ./integration-tests/coverage/run-suite.js \"packages/datadog-plugin-@(${PLUGINS})/test/integration-test/**/${SPEC:-*}*.spec.js\"",
|
|
116
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\"",
|
|
117
117
|
"test:release": "mocha \"scripts/release/**/*.spec.js\"",
|
|
118
|
-
"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\"",
|
|
119
119
|
"test:shimmer": "mocha \"packages/datadog-shimmer/test/**/*.spec.js\"",
|
|
120
120
|
"test:shimmer:ci": "node scripts/c8-ci.js test:shimmer",
|
|
121
121
|
"verify:workflow-job-names": "node scripts/verify-workflow-job-names.js",
|
|
@@ -184,11 +184,11 @@
|
|
|
184
184
|
},
|
|
185
185
|
"optionalDependencies": {
|
|
186
186
|
"@datadog/libdatadog": "0.12.1",
|
|
187
|
-
"@datadog/native-appsec": "11.0.
|
|
188
|
-
"@datadog/native-iast-taint-tracking": "4.2.
|
|
189
|
-
"@datadog/native-metrics": "
|
|
187
|
+
"@datadog/native-appsec": "11.0.2",
|
|
188
|
+
"@datadog/native-iast-taint-tracking": "4.2.1",
|
|
189
|
+
"@datadog/native-metrics": "4.0.0",
|
|
190
190
|
"@datadog/pprof": "5.18.1",
|
|
191
|
-
"@datadog/wasm-js-rewriter": "5.0.
|
|
191
|
+
"@datadog/wasm-js-rewriter": "5.0.4",
|
|
192
192
|
"@opentelemetry/api": ">=1.0.0 <1.10.0",
|
|
193
193
|
"@opentelemetry/api-logs": "<1.0.0",
|
|
194
194
|
"oxc-parser": "^0.132.0"
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
"@eslint/eslintrc": "^3.3.6",
|
|
201
201
|
"@eslint/js": "^10.0.1",
|
|
202
202
|
"@eslint/plugin-kit": "^0.7.2",
|
|
203
|
-
"@datadog/openfeature-node-server": "2.
|
|
203
|
+
"@datadog/openfeature-node-server": "2.2.0",
|
|
204
204
|
"@msgpack/msgpack": "^3.1.3",
|
|
205
205
|
"@openfeature/core": "^1.12.0",
|
|
206
206
|
"@openfeature/server-sdk": "~1.23.0",
|
|
@@ -208,18 +208,18 @@
|
|
|
208
208
|
"@types/mocha": "^10.0.10",
|
|
209
209
|
"@types/node": "^18.19.106",
|
|
210
210
|
"@types/sinon": "^22.0.0",
|
|
211
|
-
"@vercel/nft": "^1.
|
|
211
|
+
"@vercel/nft": "^1.11.0",
|
|
212
212
|
"@yarnpkg/lockfile": "^1.1.0",
|
|
213
213
|
"axios": "^1.19.0",
|
|
214
214
|
"benchmark": "^2.1.4",
|
|
215
215
|
"body-parser": "^2.3.0",
|
|
216
|
-
"bun": "1.
|
|
216
|
+
"bun": "1.4.0",
|
|
217
217
|
"c8": "^12.0.0",
|
|
218
218
|
"codeowners-audit": "^2.9.0",
|
|
219
219
|
"eslint": "^10.8.1",
|
|
220
220
|
"eslint-plugin-cypress": "^7.0.0",
|
|
221
221
|
"eslint-plugin-import-x": "^4.16.2",
|
|
222
|
-
"eslint-plugin-jsdoc": "^64.2.
|
|
222
|
+
"eslint-plugin-jsdoc": "^64.2.1",
|
|
223
223
|
"eslint-plugin-mocha": "^11.3.0",
|
|
224
224
|
"eslint-plugin-n": "^18.3.0",
|
|
225
225
|
"eslint-plugin-promise": "^7.3.0",
|
|
@@ -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
|
})
|
|
@@ -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
|
}
|
package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js
CHANGED
|
@@ -54,6 +54,34 @@ module.exports = [
|
|
|
54
54
|
channelName: 'LocalRunner_shutdown',
|
|
55
55
|
transform: 'waitForAsyncEnd',
|
|
56
56
|
},
|
|
57
|
+
{
|
|
58
|
+
module: {
|
|
59
|
+
name: '@wdio/runner',
|
|
60
|
+
versionRange: '>=9.0.0',
|
|
61
|
+
filePath: 'build/index.js',
|
|
62
|
+
},
|
|
63
|
+
functionQuery: {
|
|
64
|
+
className: 'BaseReporter',
|
|
65
|
+
methodName: 'waitForSync',
|
|
66
|
+
kind: 'Async',
|
|
67
|
+
},
|
|
68
|
+
channelName: 'BaseReporter_waitForSync',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
module: {
|
|
72
|
+
name: '@wdio/runner',
|
|
73
|
+
versionRange: '>=9.0.0',
|
|
74
|
+
filePath: 'build/index.js',
|
|
75
|
+
},
|
|
76
|
+
astQuery: 'VariableDeclarator[id.name="BaseReporter"] > ClassExpression > ClassBody > ' +
|
|
77
|
+
'MethodDefinition[key.name="waitForSync"] ReturnStatement > ' +
|
|
78
|
+
'CallExpression[callee.object.name="promise"][callee.property.name="then"], ' +
|
|
79
|
+
'ClassDeclaration[id.name="BaseReporter"] > ClassBody > ' +
|
|
80
|
+
'MethodDefinition[key.name="waitForSync"] ReturnStatement > ' +
|
|
81
|
+
'CallExpression[callee.object.name="promise"][callee.property.name="then"]',
|
|
82
|
+
channelName: 'BaseReporter_waitForSync',
|
|
83
|
+
transform: 'waitForAsyncEnd',
|
|
84
|
+
},
|
|
57
85
|
{
|
|
58
86
|
module: {
|
|
59
87
|
name: '@wdio/jasmine-framework',
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"@wdio/cli/build/index.js": "@wdio/cli",
|
|
34
34
|
"@wdio/jasmine-framework/build/index.js": "@wdio/jasmine-framework",
|
|
35
35
|
"@wdio/local-runner/build/index.js": "@wdio/local-runner",
|
|
36
|
+
"@wdio/runner/build/index.js": "@wdio/runner",
|
|
36
37
|
"@wdio/utils/build/index.js": "@wdio/utils",
|
|
37
38
|
"ai/dist/index.js": "ai",
|
|
38
39
|
"ai/dist/index.mjs": "ai",
|