dd-trace 5.131.1 → 5.133.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/diagnose.js +9 -14
- package/ci/init.js +1 -2
- package/ci/test-optimization-validation/ci-discovery.js +9 -4
- package/ci/test-optimization-validation/executable.js +1 -5
- package/ci/test-optimization-validation/framework-adapters/cypress.js +1 -4
- package/ci/test-optimization-validation/framework-adapters/vitest.js +1 -1
- package/ci/test-optimization-validation/generated-files.js +6 -4
- package/ci/test-optimization-validation/generated-test-contract.js +7 -3
- package/ci/test-optimization-validation/manifest-scaffold.js +7 -2
- package/ci/test-optimization-validation/manifest-schema.js +6 -7
- package/ci/test-optimization-validation/report-writer.js +6 -2
- package/ci/test-optimization-validation/runner-command.js +2 -4
- package/ci/test-optimization-validation/runner-contract.js +1 -2
- package/ci/test-optimization-validation/scenarios/auto-test-retries.js +1 -15
- package/ci/vitest-no-worker-init-setup.mjs +10 -7
- package/index.d.ts +116 -17
- package/initialize.mjs +1 -3
- package/openfeature/rules-based.d.ts +11 -0
- package/openfeature/rules-based.js +7 -0
- package/package.json +13 -11
- package/packages/datadog-core/src/storage.js +16 -0
- package/packages/datadog-esbuild/index.js +18 -12
- package/packages/datadog-instrumentations/src/aerospike.js +3 -3
- package/packages/datadog-instrumentations/src/ai.js +3 -3
- package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js.js +0 -6
- package/packages/datadog-instrumentations/src/aws-sdk.js +21 -13
- package/packages/datadog-instrumentations/src/cassandra-driver.js +25 -20
- package/packages/datadog-instrumentations/src/claude-agent-sdk.js +9 -23
- package/packages/datadog-instrumentations/src/cucumber.js +48 -33
- package/packages/datadog-instrumentations/src/elasticsearch.js +1 -5
- package/packages/datadog-instrumentations/src/electron.js +6 -6
- package/packages/datadog-instrumentations/src/fastify.js +13 -4
- package/packages/datadog-instrumentations/src/fs.js +2 -2
- package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +9 -5
- package/packages/datadog-instrumentations/src/grpc/client.js +2 -0
- package/packages/datadog-instrumentations/src/helpers/bundler-register.js +2 -2
- package/packages/datadog-instrumentations/src/helpers/check-require-cache.js +1 -2
- package/packages/datadog-instrumentations/src/helpers/instrument.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/register.js +36 -1
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +2 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentation-registry.js +87 -6
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql-jit.js +5 -6
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/postgres.js +48 -31
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js +64 -11
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +1 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms/postgres.js +42 -4
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +7 -10
- package/packages/datadog-instrumentations/src/ioredis.js +7 -5
- package/packages/datadog-instrumentations/src/iovalkey.js +7 -5
- package/packages/datadog-instrumentations/src/jest.js +122 -11
- package/packages/datadog-instrumentations/src/knex.js +9 -5
- package/packages/datadog-instrumentations/src/mariadb-bundle.js +3 -3
- package/packages/datadog-instrumentations/src/mocha/common.js +20 -8
- package/packages/datadog-instrumentations/src/mocha/main.js +140 -43
- package/packages/datadog-instrumentations/src/mocha/utils.js +127 -38
- package/packages/datadog-instrumentations/src/mocha/webdriverio-protocol.js +61 -34
- package/packages/datadog-instrumentations/src/mocha/worker.js +7 -5
- package/packages/datadog-instrumentations/src/mongodb-core.js +3 -3
- package/packages/datadog-instrumentations/src/mongoose.js +3 -3
- package/packages/datadog-instrumentations/src/nova-sonic/audio.js +173 -0
- package/packages/datadog-instrumentations/src/nova-sonic/index.js +209 -0
- package/packages/datadog-instrumentations/src/nova-sonic/session.js +483 -0
- package/packages/datadog-instrumentations/src/openai-realtime/index.js +18 -6
- package/packages/datadog-instrumentations/src/openai-realtime/session.js +1 -1
- package/packages/datadog-instrumentations/src/openai.js +7 -0
- package/packages/datadog-instrumentations/src/pino.js +5 -6
- package/packages/datadog-instrumentations/src/playwright.js +3 -0
- package/packages/datadog-instrumentations/src/redis.js +27 -13
- package/packages/datadog-instrumentations/src/router.js +30 -0
- package/packages/datadog-instrumentations/src/rum-browser-scripts.js +2 -6
- package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +7 -5
- package/packages/datadog-instrumentations/src/vitest-main.js +9 -17
- package/packages/datadog-instrumentations/src/vitest-util.js +2 -2
- package/packages/datadog-instrumentations/src/vitest-worker.js +1 -2
- package/packages/datadog-instrumentations/src/vitest.js +2 -2
- package/packages/datadog-instrumentations/src/webdriverio.js +118 -21
- package/packages/datadog-instrumentations/src/ws.js +1 -4
- package/packages/datadog-plugin-amqplib/src/client.js +1 -2
- package/packages/datadog-plugin-avsc/src/schema_iterator.js +1 -5
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/handler.js +1 -2
- package/packages/datadog-plugin-aws-sdk/src/base.js +5 -8
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/index.js +18 -0
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/sonic.js +45 -0
- package/packages/datadog-plugin-aws-sdk/src/services/kinesis.js +9 -3
- package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +2 -5
- package/packages/datadog-plugin-azure-durable-functions/src/index.js +5 -4
- package/packages/datadog-plugin-azure-functions/src/index.js +5 -3
- package/packages/datadog-plugin-claude-agent-sdk/src/index.js +0 -2
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +18 -5
- package/packages/datadog-plugin-cypress/src/index.js +6 -6
- package/packages/datadog-plugin-cypress/src/source-map-utils.js +1 -2
- package/packages/datadog-plugin-cypress/src/support.js +1 -4
- package/packages/datadog-plugin-express/src/code_origin.js +1 -2
- package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +2 -2
- package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +1 -2
- package/packages/datadog-plugin-graphql/src/execute.js +5 -5
- package/packages/datadog-plugin-grpc/src/util.js +1 -2
- package/packages/datadog-plugin-kafkajs/src/producer.js +1 -2
- package/packages/datadog-plugin-mocha/src/index.js +223 -39
- package/packages/datadog-plugin-mocha/src/webdriverio-video.js +453 -0
- package/packages/datadog-plugin-mongodb-core/src/query.js +8 -5
- package/packages/datadog-plugin-next/src/index.js +1 -2
- package/packages/datadog-plugin-openai/src/tracing.js +5 -2
- package/packages/datadog-plugin-openai-agents/src/integration.js +6 -2
- package/packages/datadog-plugin-openai-agents/src/processor.js +2 -4
- package/packages/datadog-plugin-postgres/src/index.js +24 -0
- package/packages/datadog-plugin-protobufjs/src/schema_iterator.js +1 -5
- package/packages/datadog-plugin-rhea/src/consumer.js +1 -4
- package/packages/datadog-plugin-vitest/src/index.js +5 -2
- package/packages/datadog-shimmer/src/shimmer.js +5 -4
- package/packages/datadog-webpack/index.js +55 -43
- package/packages/datadog-webpack/src/loader.js +56 -8
- package/packages/dd-trace/src/aiguard/integrations/vercel-ai.js +2 -4
- package/packages/dd-trace/src/aiguard/messages/utils.js +1 -2
- package/packages/dd-trace/src/aiguard/redaction.js +8 -2
- package/packages/dd-trace/src/appsec/api_security/normalized-route.js +3 -2
- package/packages/dd-trace/src/appsec/api_security/sampler.js +2 -6
- package/packages/dd-trace/src/appsec/downstream_requests.js +1 -9
- package/packages/dd-trace/src/appsec/handlers/http-request.js +3 -9
- package/packages/dd-trace/src/appsec/handlers/http-response.js +7 -2
- package/packages/dd-trace/src/appsec/iast/analyzers/path-traversal-analyzer.js +4 -3
- package/packages/dd-trace/src/appsec/iast/analyzers/set-cookies-header-interceptor.js +1 -4
- package/packages/dd-trace/src/appsec/iast/taint-tracking/operations-taint-object.js +7 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +1 -3
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter-esm.mjs +1 -3
- package/packages/dd-trace/src/appsec/iast/telemetry/iast-metric.js +1 -6
- package/packages/dd-trace/src/appsec/lambda.js +1 -3
- package/packages/dd-trace/src/appsec/rasp/fs-plugin.js +37 -27
- package/packages/dd-trace/src/appsec/rasp/lfi.js +9 -5
- package/packages/dd-trace/src/appsec/reporter.js +21 -1
- package/packages/dd-trace/src/appsec/stack_trace.js +1 -2
- package/packages/dd-trace/src/ci-visibility/dynamic-atr-retries.js +3 -6
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/msgpack-to-json.js +1 -1
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +13 -7
- package/packages/dd-trace/src/ci-visibility/exporters/settings-cache-key.js +1 -2
- package/packages/dd-trace/src/ci-visibility/exporters/test-worker/index.js +2 -8
- package/packages/dd-trace/src/ci-visibility/resolve-runfile-path.js +54 -0
- package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache-schema.js +5 -8
- package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache.js +2 -53
- package/packages/dd-trace/src/config/config-types.d.ts +2 -2
- package/packages/dd-trace/src/config/defaults.js +5 -5
- package/packages/dd-trace/src/config/generated-config-types.d.ts +8 -0
- package/packages/dd-trace/src/config/helper.js +34 -3
- package/packages/dd-trace/src/config/index.js +10 -9
- package/packages/dd-trace/src/config/normalize-service.js +1 -1
- package/packages/dd-trace/src/config/parsers.js +2 -2
- package/packages/dd-trace/src/config/supported-configurations.json +35 -0
- package/packages/dd-trace/src/datastreams/processor.js +3 -2
- package/packages/dd-trace/src/datastreams/schemas/schema_builder.js +1 -4
- package/packages/dd-trace/src/debugger/constants.js +1 -0
- package/packages/dd-trace/src/debugger/devtools_client/index.js +5 -3
- package/packages/dd-trace/src/debugger/devtools_client/remote_config.js +17 -12
- package/packages/dd-trace/src/debugger/devtools_client/send.js +7 -2
- package/packages/dd-trace/src/debugger/devtools_client/status.js +1 -0
- package/packages/dd-trace/src/debugger/devtools_client/worker-error.js +21 -0
- package/packages/dd-trace/src/debugger/guardrail-metrics.js +2 -2
- package/packages/dd-trace/src/debugger/index.js +24 -2
- package/packages/dd-trace/src/debugger/probe_sampler.js +108 -11
- package/packages/dd-trace/src/dogstatsd.js +1 -1
- package/packages/dd-trace/src/encode/tags-processors.js +2 -2
- package/packages/dd-trace/src/exporters/common/request.js +2 -5
- package/packages/dd-trace/src/exporters/common/url.js +1 -1
- package/packages/dd-trace/src/id.js +15 -5
- package/packages/dd-trace/src/lambda/handler.js +179 -19
- package/packages/dd-trace/src/lambda/index.js +15 -1
- package/packages/dd-trace/src/lambda/runtime/patch.js +34 -7
- package/packages/dd-trace/src/llmobs/agent-manifest.js +296 -0
- package/packages/dd-trace/src/llmobs/audio-utils.js +3 -2
- package/packages/dd-trace/src/llmobs/constants/tags.js +13 -0
- package/packages/dd-trace/src/llmobs/experiments/experiment.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/anthropic/index.js +15 -0
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +1 -2
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chat_model.js +1 -3
- package/packages/dd-trace/src/llmobs/plugins/langgraph/index.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/nova-sonic.js +92 -0
- package/packages/dd-trace/src/llmobs/plugins/openai/index.js +56 -2
- package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +38 -0
- package/packages/dd-trace/src/llmobs/prompts/manager.js +5 -7
- package/packages/dd-trace/src/llmobs/prompts/prompt.js +1 -1
- package/packages/dd-trace/src/llmobs/sdk.js +23 -6
- package/packages/dd-trace/src/llmobs/span_processor.js +18 -8
- package/packages/dd-trace/src/llmobs/tagger.js +56 -3
- package/packages/dd-trace/src/llmobs/util.js +1 -2
- package/packages/dd-trace/src/llmobs/writers/base.js +7 -6
- package/packages/dd-trace/src/llmobs/writers/util.js +3 -1
- package/packages/dd-trace/src/log/log.js +1 -5
- package/packages/dd-trace/src/openfeature/agentless_configuration_source.js +30 -1
- package/packages/dd-trace/src/openfeature/configuration_source.js +17 -2
- package/packages/dd-trace/src/openfeature/debug-logging-hook.js +25 -0
- package/packages/dd-trace/src/openfeature/evaluation-telemetry-opt-out-hook.js +51 -0
- package/packages/dd-trace/src/openfeature/flagging_provider.js +59 -3
- package/packages/dd-trace/src/openfeature/remote_config.js +9 -0
- package/packages/dd-trace/src/openfeature/writers/util.js +43 -4
- package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +1 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +1 -1
- package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +1 -2
- package/packages/dd-trace/src/opentelemetry/otlp/common.proto +1 -1
- package/packages/dd-trace/src/opentelemetry/resource-attributes.js +1 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +6 -23
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +53 -13
- package/packages/dd-trace/src/otel-sampling.js +4 -5
- package/packages/dd-trace/src/otel-thread-ctx.js +81 -15
- package/packages/dd-trace/src/plugins/database.js +7 -16
- package/packages/dd-trace/src/plugins/util/git.js +9 -25
- package/packages/dd-trace/src/plugins/util/inferred_proxy.js +1 -5
- package/packages/dd-trace/src/plugins/util/test.js +48 -4
- package/packages/dd-trace/src/priority_sampler.js +1 -2
- package/packages/dd-trace/src/profiling/profiler.js +4 -6
- package/packages/dd-trace/src/profiling/profilers/wall.js +4 -10
- package/packages/dd-trace/src/proxy.js +3 -2
- package/packages/dd-trace/src/ritm.js +4 -2
- package/packages/dd-trace/src/serverless.js +10 -0
- package/packages/dd-trace/src/span_processor.js +13 -17
- package/packages/dd-trace/src/storage-channels.js +112 -46
- package/packages/dd-trace/src/telemetry/endpoints.js +1 -3
- package/packages/dd-trace/src/util.js +29 -0
- package/packages/dd-trace/src/web-tags-cache.js +6 -2
- package/vendor/dist/@datadog/openfeature-node-server/index.js +1 -1
- package/vendor/dist/@datadog/openfeature-node-server/rules-based/LICENSE +201 -0
- package/vendor/dist/@datadog/openfeature-node-server/rules-based/index.d.ts +925 -0
- package/vendor/dist/@datadog/openfeature-node-server/rules-based/index.js +1 -0
- package/vendor/dist/@datadog/sketches-js/index.js +1 -1
- package/vendor/dist/protobufjs/index.js +1 -1
- package/vendor/dist/protobufjs/minimal/index.js +1 -1
- package/vendor/dist/shell-quote/index.js +1 -1
package/ci/diagnose.js
CHANGED
|
@@ -1743,9 +1743,7 @@ function readTextFiles (root, physicalRoot, files, maxTotalBytes) {
|
|
|
1743
1743
|
|
|
1744
1744
|
for (const relativePath of files) {
|
|
1745
1745
|
const file = getSafeScannedFile(root, physicalRoot, relativePath)
|
|
1746
|
-
if (!file) continue
|
|
1747
|
-
|
|
1748
|
-
if (file.stat.size > MAX_TEXT_FILE_SIZE) continue
|
|
1746
|
+
if (!file || file.stat.size > MAX_TEXT_FILE_SIZE) continue
|
|
1749
1747
|
if (totalBytes + file.stat.size > maxTotalBytes) {
|
|
1750
1748
|
textFiles.truncated = true
|
|
1751
1749
|
break
|
|
@@ -1862,15 +1860,13 @@ function isTestSetupOrCiFile (file) {
|
|
|
1862
1860
|
const relativePath = file.relativePath
|
|
1863
1861
|
const basename = path.basename(relativePath)
|
|
1864
1862
|
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
return false
|
|
1863
|
+
return isWorkflowFile(relativePath) ||
|
|
1864
|
+
basename === 'package.json' ||
|
|
1865
|
+
/^(?:jest|config-jest|vitest|vite|playwright|cypress|cucumber)\.config\./.test(basename) ||
|
|
1866
|
+
/^\.mocharc\./.test(basename) ||
|
|
1867
|
+
basename === 'cypress.json' ||
|
|
1868
|
+
/setup|bootstrap/i.test(basename) ||
|
|
1869
|
+
relativePath.startsWith('cypress/support/')
|
|
1874
1870
|
}
|
|
1875
1871
|
|
|
1876
1872
|
/**
|
|
@@ -2014,8 +2010,7 @@ function coerceVersion (rawVersion) {
|
|
|
2014
2010
|
*/
|
|
2015
2011
|
function isAmbiguousRange (rawVersion) {
|
|
2016
2012
|
const version = String(rawVersion || '').trim()
|
|
2017
|
-
if (!version) return true
|
|
2018
|
-
if (version.includes('||')) return true
|
|
2013
|
+
if (!version || version.includes('||')) return true
|
|
2019
2014
|
return /<=?\s*\d/.test(version)
|
|
2020
2015
|
}
|
|
2021
2016
|
|
package/ci/init.js
CHANGED
|
@@ -32,8 +32,7 @@ function detectTestWorkerType () {
|
|
|
32
32
|
if (getEnvironmentVariable('CUCUMBER_WORKER_ID')) return 'cucumber'
|
|
33
33
|
if (getEnvironmentVariable('MOCHA_WORKER_ID')) return 'mocha'
|
|
34
34
|
if (getValueFromEnvSources('DD_PLAYWRIGHT_WORKER')) return 'playwright'
|
|
35
|
-
if (getEnvironmentVariable('TINYPOOL_WORKER_ID')) return 'vitest'
|
|
36
|
-
if (getValueFromEnvSources('DD_VITEST_WORKER')) return 'vitest'
|
|
35
|
+
if (getEnvironmentVariable('TINYPOOL_WORKER_ID') || getValueFromEnvSources('DD_VITEST_WORKER')) return 'vitest'
|
|
37
36
|
return null
|
|
38
37
|
}
|
|
39
38
|
|
|
@@ -40,8 +40,7 @@ function buildCiDiscovery ({ manifest, diagnosis }) {
|
|
|
40
40
|
const candidateFound = getManifestWorkflowLocations(manifest)
|
|
41
41
|
const manifestFound = uniqueStrings([...declaredFound, ...candidateFound])
|
|
42
42
|
const searched = normalizeStringArray(declared.searched)
|
|
43
|
-
let method = 'validator-static-diagnosis'
|
|
44
|
-
if (candidateFound.length > 0) method = 'framework-ci-command'
|
|
43
|
+
let method = candidateFound.length > 0 ? 'framework-ci-command' : 'validator-static-diagnosis'
|
|
45
44
|
if (declaredFound.length > 0) method = 'manifest'
|
|
46
45
|
if (typeof declared.method === 'string' && declared.method) method = declared.method
|
|
47
46
|
const found = manifestFound.length > 0 ? manifestFound : staticFound
|
|
@@ -83,8 +82,14 @@ function getManifestWorkflowLocations (manifest) {
|
|
|
83
82
|
|
|
84
83
|
function getFrameworkCiDiscoveryContradiction (framework, manifest) {
|
|
85
84
|
const ciDiscovery = manifest?.ciDiscovery
|
|
86
|
-
if (
|
|
87
|
-
|
|
85
|
+
if (
|
|
86
|
+
!ciDiscovery ||
|
|
87
|
+
!Array.isArray(ciDiscovery.staticFound) ||
|
|
88
|
+
ciDiscovery.staticFound.length === 0 ||
|
|
89
|
+
!frameworkClaimsNoCi(framework)
|
|
90
|
+
) {
|
|
91
|
+
return null
|
|
92
|
+
}
|
|
88
93
|
|
|
89
94
|
return {
|
|
90
95
|
reason: 'CI workflow files were found by validator static diagnosis, but this manifest entry says no CI ' +
|
|
@@ -158,11 +158,7 @@ function splitNodeOptions (source) {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
const next = source[index + 1]
|
|
161
|
-
|
|
162
|
-
value += source[++index]
|
|
163
|
-
} else {
|
|
164
|
-
value += character
|
|
165
|
-
}
|
|
161
|
+
value += character === '\\' && next && (next === quote || /[\s'"\\]/.test(next)) ? source[++index] : character
|
|
166
162
|
started = true
|
|
167
163
|
}
|
|
168
164
|
if (quote) throw new Error('NODE_OPTIONS contains an unterminated quoted value.')
|
|
@@ -37,10 +37,7 @@ function getTestExtension (filename) {
|
|
|
37
37
|
* @param {string} input.testName generated test name
|
|
38
38
|
*/
|
|
39
39
|
function getGeneratedTestContent ({ scenarioId, testName }) {
|
|
40
|
-
let content = ''
|
|
41
|
-
if (scenarioId === 'atr-fail-once') {
|
|
42
|
-
content = 'let attempt = 0\n\n'
|
|
43
|
-
}
|
|
40
|
+
let content = scenarioId === 'atr-fail-once' ? 'let attempt = 0\n\n' : ''
|
|
44
41
|
content += "describe('dd-test-optimization-validation', () => {\n" +
|
|
45
42
|
` it(${JSON.stringify(testName)}, () => {\n` +
|
|
46
43
|
(scenarioId === 'atr-fail-once'
|
|
@@ -361,7 +361,7 @@ function getDelimitedRanges (source, open, close) {
|
|
|
361
361
|
function getLiteralStringProperties (source, property) {
|
|
362
362
|
return getPropertyPositions(source, property).flatMap(({ index, valueStart }) => {
|
|
363
363
|
const literal = /^(["'])([^"'\\]+)\1/.exec(source.slice(valueStart))
|
|
364
|
-
return literal ?
|
|
364
|
+
return literal ? { index, value: literal[2] } : []
|
|
365
365
|
})
|
|
366
366
|
}
|
|
367
367
|
|
|
@@ -305,12 +305,14 @@ function isCleanupAuthorizationValid (filename, authorization) {
|
|
|
305
305
|
try {
|
|
306
306
|
const currentPhysicalRoot = fs.realpathSync(authorization.lexicalRoot)
|
|
307
307
|
const rootStat = fs.statSync(currentPhysicalRoot, { bigint: true })
|
|
308
|
-
if (
|
|
309
|
-
|
|
308
|
+
if (
|
|
309
|
+
currentPhysicalRoot !== authorization.physicalRoot ||
|
|
310
|
+
rootStat.dev !== authorization.rootDevice ||
|
|
311
|
+
rootStat.ino !== authorization.rootInode ||
|
|
312
|
+
authorization.physicalParent === undefined
|
|
313
|
+
) {
|
|
310
314
|
return false
|
|
311
315
|
}
|
|
312
|
-
|
|
313
|
-
if (authorization.physicalParent === undefined) return false
|
|
314
316
|
const physicalParent = fs.realpathSync(path.dirname(filename))
|
|
315
317
|
const parentStat = fs.statSync(physicalParent, { bigint: true })
|
|
316
318
|
if (physicalParent !== authorization.physicalParent ||
|
|
@@ -124,9 +124,13 @@ function getGeneratedTestContent ({ framework, moduleSystem, scenarioId, stateFi
|
|
|
124
124
|
*/
|
|
125
125
|
function getGeneratedTestContractError (framework) {
|
|
126
126
|
const strategy = framework.generatedTestStrategy
|
|
127
|
-
if (
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
if (
|
|
128
|
+
!strategy ||
|
|
129
|
+
!['planned', 'verified'].includes(strategy.status) ||
|
|
130
|
+
!['cucumber', 'cypress', 'jest', 'mocha', 'playwright', 'vitest'].includes(framework.framework)
|
|
131
|
+
) {
|
|
132
|
+
return
|
|
133
|
+
}
|
|
130
134
|
if (!['commonjs', 'esm'].includes(strategy.moduleSystem)) {
|
|
131
135
|
return 'must retain generatedTestStrategy.moduleSystem as "commonjs" or "esm".'
|
|
132
136
|
}
|
|
@@ -750,8 +750,13 @@ function hasCucumberBrowserSupport (files, retainedInputs, projectRoot) {
|
|
|
750
750
|
function isTestFile (filename, source, framework, projectRoot, allowDirectoryConvention) {
|
|
751
751
|
const basename = path.basename(filename)
|
|
752
752
|
const normalized = filename.replaceAll('\\', '/')
|
|
753
|
-
if (
|
|
754
|
-
|
|
753
|
+
if (
|
|
754
|
+
normalized.includes('/dd-test-optimization-validation-') ||
|
|
755
|
+
TYPE_ONLY_TEST_PATTERN.test(basename) ||
|
|
756
|
+
TYPE_ONLY_DIRECTORY_PATTERN.test(normalized)
|
|
757
|
+
) {
|
|
758
|
+
return false
|
|
759
|
+
}
|
|
755
760
|
if (framework === 'cucumber') return cucumber.isTestFile(filename)
|
|
756
761
|
if (framework === 'cypress') return cypress.isTestFile(basename, path.dirname(filename), projectRoot)
|
|
757
762
|
if (framework === 'playwright') return playwright.isTestFile(basename, path.dirname(filename), projectRoot)
|
|
@@ -441,16 +441,15 @@ function validateCiWiring (repositoryRoot, ciWiring, prefix, errors) {
|
|
|
441
441
|
if (typeof ciWiring.reviewComplete !== 'boolean') errors.push(`${prefix}.reviewComplete must be a boolean.`)
|
|
442
442
|
validateStringArray(ciWiring.unresolved, `${prefix}.unresolved`, errors)
|
|
443
443
|
|
|
444
|
-
if (
|
|
445
|
-
!INITIALIZATION_STATUSES.has(ciWiring.initialization.status)) {
|
|
446
|
-
errors.push(`${prefix}.initialization.status must be configured, not_configured, or unknown.`)
|
|
447
|
-
} else {
|
|
444
|
+
if (isObject(ciWiring.initialization) && INITIALIZATION_STATUSES.has(ciWiring.initialization.status)) {
|
|
448
445
|
validateStringArray(ciWiring.initialization.evidence, `${prefix}.initialization.evidence`, errors)
|
|
449
|
-
}
|
|
450
|
-
if (!isObject(ciWiring.transport) || !TRANSPORT_MODES.has(ciWiring.transport.mode)) {
|
|
451
|
-
errors.push(`${prefix}.transport.mode must be agent, agentless, none, or unknown.`)
|
|
452
446
|
} else {
|
|
447
|
+
errors.push(`${prefix}.initialization.status must be configured, not_configured, or unknown.`)
|
|
448
|
+
}
|
|
449
|
+
if (isObject(ciWiring.transport) && TRANSPORT_MODES.has(ciWiring.transport.mode)) {
|
|
453
450
|
validateStringArray(ciWiring.transport.evidence, `${prefix}.transport.evidence`, errors)
|
|
451
|
+
} else {
|
|
452
|
+
errors.push(`${prefix}.transport.mode must be agent, agentless, none, or unknown.`)
|
|
454
453
|
}
|
|
455
454
|
}
|
|
456
455
|
|
|
@@ -332,8 +332,12 @@ function getActions (results) {
|
|
|
332
332
|
function getActionPriority (result, localPasses) {
|
|
333
333
|
if (result.evidence?.possibleLibraryBug) return 0
|
|
334
334
|
if (result.scenario === 'ci-wiring' && localPasses.has(result.frameworkId)) return 0
|
|
335
|
-
if (
|
|
336
|
-
|
|
335
|
+
if (
|
|
336
|
+
result.evidence?.blockerCategory === 'EXECUTION_ENVIRONMENT_BLOCKED' ||
|
|
337
|
+
result.evidence?.blockerCategory === 'VALIDATOR_LIMITATION'
|
|
338
|
+
) {
|
|
339
|
+
return 1
|
|
340
|
+
}
|
|
337
341
|
if (result.scenario === 'ci-wiring') return 2
|
|
338
342
|
return 3
|
|
339
343
|
}
|
|
@@ -46,8 +46,7 @@ function getGeneratedCommand (framework, scenario) {
|
|
|
46
46
|
* @returns {Array<[string, object]>} labeled direct-runner commands
|
|
47
47
|
*/
|
|
48
48
|
function getFrameworkCommands (framework, requestedScenario = null) {
|
|
49
|
-
if (framework.status !== 'runnable') return []
|
|
50
|
-
if (requestedScenario === 'ci-wiring') return []
|
|
49
|
+
if (framework.status !== 'runnable' || requestedScenario === 'ci-wiring') return []
|
|
51
50
|
|
|
52
51
|
const commands = [['basic-reporting', getBasicCommand(framework)]]
|
|
53
52
|
const fallbackTests = framework.validation.fallbackTests
|
|
@@ -99,8 +98,7 @@ function getManifestInputFiles (manifest, { includeLocal = true } = {}) {
|
|
|
99
98
|
for (const framework of manifest.frameworks) {
|
|
100
99
|
addExistingFile(files, framework.ciWiring?.configFile)
|
|
101
100
|
addExistingFile(files, framework.project?.packageJson)
|
|
102
|
-
if (!includeLocal) continue
|
|
103
|
-
if (framework.status !== 'runnable') continue
|
|
101
|
+
if (!includeLocal || framework.status !== 'runnable') continue
|
|
104
102
|
addExistingFile(files, framework.validation?.runner)
|
|
105
103
|
addExistingFile(files, framework.validation?.testFile)
|
|
106
104
|
const fallbackTests = framework.validation?.fallbackTests
|
|
@@ -450,8 +450,7 @@ function getRunnerInputError (args, environment, projectRoot, repositoryRoot, co
|
|
|
450
450
|
* @returns {{error?: string, runnerIndex: number, tokens: string[]}|undefined} parsed invocation
|
|
451
451
|
*/
|
|
452
452
|
function getFrameworkInvocation (command, framework) {
|
|
453
|
-
if (CONTROL_PATTERN.test(String(command || ''))) return
|
|
454
|
-
if (command === `direct ${framework} binary`) return
|
|
453
|
+
if (CONTROL_PATTERN.test(String(command || '')) || command === `direct ${framework} binary`) return
|
|
455
454
|
const tokens = tokenizeCommand(command)
|
|
456
455
|
const executable = getRunnerExecutableName(framework)
|
|
457
456
|
const runnerIndex = tokens.findIndex(token => {
|
|
@@ -100,21 +100,7 @@ async function runAutoTestRetries ({ framework, out, options }) {
|
|
|
100
100
|
})
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
if (run.result.exitCode !== 0) {
|
|
104
|
-
return failWithDebugRerun({
|
|
105
|
-
command: scenario.runCommand,
|
|
106
|
-
fixtureConfig,
|
|
107
|
-
diagnosis: getAutoTestRetriesFailureDiagnosis(framework, evidence),
|
|
108
|
-
evidence,
|
|
109
|
-
framework,
|
|
110
|
-
options,
|
|
111
|
-
out,
|
|
112
|
-
outDir,
|
|
113
|
-
scenarioName,
|
|
114
|
-
})
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (tests.length < 2 || autoTestRetryEvents.length === 0) {
|
|
103
|
+
if (run.result.exitCode !== 0 || tests.length < 2 || autoTestRetryEvents.length === 0) {
|
|
118
104
|
return failWithDebugRerun({
|
|
119
105
|
command: scenario.runCommand,
|
|
120
106
|
fixtureConfig,
|
|
@@ -3,7 +3,7 @@ import { afterEach, beforeAll, beforeEach, inject } from 'vitest'
|
|
|
3
3
|
// Instrumentation-less setup for DD_EXPERIMENTAL_TEST_OPT_VITEST_NO_WORKER_INIT.
|
|
4
4
|
// It applies Test Optimization execution changes without initializing dd-trace and also supports Browser Mode.
|
|
5
5
|
const VITEST_NO_WORKER_INIT_ACTIVE_ENV = 'DD_TEST_OPT_VITEST_NO_WORKER_INIT_ACTIVE'
|
|
6
|
-
const SERIALIZED_CONTEXT_PREFIX = '\
|
|
6
|
+
const SERIALIZED_CONTEXT_PREFIX = '\0dd-vitest-context:'
|
|
7
7
|
const providedContext = getProvidedContext()
|
|
8
8
|
const isNoWorkerInitActive = providedContext.isActive ?? getIsNoWorkerInitActive()
|
|
9
9
|
const attemptToFixTests = providedContext.attemptToFixTests || {}
|
|
@@ -220,9 +220,8 @@ function getNextAttemptIndex (task) {
|
|
|
220
220
|
*/
|
|
221
221
|
function prepareRumCorrelation (task, attemptIndex) {
|
|
222
222
|
// A per-origin cookie cannot identify overlapping attempts without racing.
|
|
223
|
-
if (!isRumCorrelationEnabled || isConcurrentTask(task)) return
|
|
224
|
-
|
|
225
223
|
if (
|
|
224
|
+
!isRumCorrelationEnabled || isConcurrentTask(task) ||
|
|
226
225
|
typeof window === 'undefined' ||
|
|
227
226
|
typeof document === 'undefined' ||
|
|
228
227
|
typeof rumTestExecutionIdCookieName !== 'string'
|
|
@@ -289,8 +288,7 @@ function getRum () {
|
|
|
289
288
|
* @param {object|undefined} rum
|
|
290
289
|
*/
|
|
291
290
|
function getIsRumActive (rum) {
|
|
292
|
-
if (!rum) return false
|
|
293
|
-
if (typeof rum.getInternalContext !== 'function') return false
|
|
291
|
+
if (!rum || typeof rum.getInternalContext !== 'function') return false
|
|
294
292
|
|
|
295
293
|
try {
|
|
296
294
|
return !!rum.getInternalContext()
|
|
@@ -770,8 +768,13 @@ function getEarlyFlakeDetectionSuiteCandidate (suite) {
|
|
|
770
768
|
|
|
771
769
|
const testSuite = getTestSuite(task)
|
|
772
770
|
const testName = getTestName(task)
|
|
773
|
-
if (
|
|
774
|
-
|
|
771
|
+
if (
|
|
772
|
+
attemptToFixTests[testSuite]?.[testName] ||
|
|
773
|
+
disabledTests[testSuite]?.[testName] ||
|
|
774
|
+
!isEarlyFlakeDetectionTest(testSuite, testName)
|
|
775
|
+
) {
|
|
776
|
+
continue
|
|
777
|
+
}
|
|
775
778
|
|
|
776
779
|
candidate ||= {
|
|
777
780
|
hasNewTest: false,
|
package/index.d.ts
CHANGED
|
@@ -218,7 +218,6 @@ interface Tracer extends opentracing.Tracer {
|
|
|
218
218
|
* @env DD_FEATURE_FLAGS_ENABLED
|
|
219
219
|
* @env DD_FEATURE_FLAGS_CONFIGURATION_SOURCE
|
|
220
220
|
* @env DD_FLAGGING_EVALUATION_COUNTS_ENABLED
|
|
221
|
-
* @beta This feature is in preview and not ready for production use
|
|
222
221
|
*/
|
|
223
222
|
openfeature: tracer.OpenFeatureProvider;
|
|
224
223
|
|
|
@@ -275,7 +274,7 @@ interface Tracer extends opentracing.Tracer {
|
|
|
275
274
|
*
|
|
276
275
|
* Removes all baggage items from the current context and returns the new context.
|
|
277
276
|
*
|
|
278
|
-
* @see https://opentelemetry.io/docs/specs/otel/baggage/api/#
|
|
277
|
+
* @see https://opentelemetry.io/docs/specs/otel/baggage/api/#clear-baggage-in-the-context
|
|
279
278
|
*/
|
|
280
279
|
removeAllBaggageItems (): Record<string, string>;
|
|
281
280
|
}
|
|
@@ -853,6 +852,22 @@ declare namespace tracer {
|
|
|
853
852
|
*/
|
|
854
853
|
site?: string;
|
|
855
854
|
|
|
855
|
+
/**
|
|
856
|
+
* Feature Flags configuration.
|
|
857
|
+
*/
|
|
858
|
+
featureFlags?: {
|
|
859
|
+
/**
|
|
860
|
+
* Allow boolean true in dd_evaluation_telemetry_opt_out to suppress evaluation events, metrics, and span tags.
|
|
861
|
+
* Enabling this option does not change exposure events or flag evaluation results.
|
|
862
|
+
* Captured when the provider is constructed.
|
|
863
|
+
* The attribute remains available to targeting rules and exposure reporting.
|
|
864
|
+
* Explicit configuration takes precedence over the environment variable, including false.
|
|
865
|
+
* @default false
|
|
866
|
+
* @env DD_FEATURE_FLAGS_EVALUATION_TELEMETRY_PER_SUBJECT_OPT_OUT_ENABLED
|
|
867
|
+
*/
|
|
868
|
+
enableEvaluationTelemetryOptOutParameter?: boolean
|
|
869
|
+
}
|
|
870
|
+
|
|
856
871
|
/**
|
|
857
872
|
* Experimental features can be enabled individually using key / value pairs.
|
|
858
873
|
* @default {}
|
|
@@ -960,8 +975,6 @@ declare namespace tracer {
|
|
|
960
975
|
|
|
961
976
|
/**
|
|
962
977
|
* Configuration for Feature Flagging & Experimentation.
|
|
963
|
-
*
|
|
964
|
-
* @beta This feature is in preview and not ready for production use
|
|
965
978
|
*/
|
|
966
979
|
flaggingProvider?: {
|
|
967
980
|
/**
|
|
@@ -1840,8 +1853,6 @@ declare namespace tracer {
|
|
|
1840
1853
|
*
|
|
1841
1854
|
* Wraps @datadog/openfeature-node-server with agentless and Agent Remote Config delivery.
|
|
1842
1855
|
* Implements the OpenFeature Provider interface for flag evaluation.
|
|
1843
|
-
*
|
|
1844
|
-
* @beta This feature is in preview and not ready for production use
|
|
1845
1856
|
*/
|
|
1846
1857
|
export interface OpenFeatureProvider {
|
|
1847
1858
|
/**
|
|
@@ -2622,14 +2633,14 @@ declare namespace tracer {
|
|
|
2622
2633
|
/**
|
|
2623
2634
|
* This plugin patches the [browser-bunyan](https://github.com/philmander/browser-bunyan)
|
|
2624
2635
|
* to automatically inject trace identifiers in log records when the
|
|
2625
|
-
*
|
|
2636
|
+
* {@link TracerOptions.logInjection | logInjection} option is enabled
|
|
2626
2637
|
* on the tracer.
|
|
2627
2638
|
*/
|
|
2628
2639
|
interface browser_bunyan extends Integration {}
|
|
2629
2640
|
|
|
2630
2641
|
/**
|
|
2631
2642
|
* This plugin automatically instruments the
|
|
2632
|
-
* [bullmq](https://
|
|
2643
|
+
* [bullmq](https://www.npmjs.com/package/bullmq) message queue library.
|
|
2633
2644
|
*/
|
|
2634
2645
|
interface bullmq extends Instrumentation {
|
|
2635
2646
|
/**
|
|
@@ -2650,7 +2661,7 @@ declare namespace tracer {
|
|
|
2650
2661
|
/**
|
|
2651
2662
|
* This plugin patches the [bunyan](https://github.com/trentm/node-bunyan)
|
|
2652
2663
|
* to automatically inject trace identifiers in log records when the
|
|
2653
|
-
*
|
|
2664
|
+
* {@link TracerOptions.logInjection | logInjection} option is enabled
|
|
2654
2665
|
* on the tracer.
|
|
2655
2666
|
*/
|
|
2656
2667
|
interface bunyan extends Integration {}
|
|
@@ -3145,7 +3156,7 @@ declare namespace tracer {
|
|
|
3145
3156
|
|
|
3146
3157
|
/**
|
|
3147
3158
|
* This plugin automatically instruments the
|
|
3148
|
-
* [langgraph](https://
|
|
3159
|
+
* [langgraph](https://www.npmjs.com/package/@langchain/langgraph) library.
|
|
3149
3160
|
*/
|
|
3150
3161
|
interface langgraph extends Instrumentation, LLMObsIntegration {}
|
|
3151
3162
|
|
|
@@ -3181,7 +3192,7 @@ declare namespace tracer {
|
|
|
3181
3192
|
|
|
3182
3193
|
/**
|
|
3183
3194
|
* This plugin automatically instruments the
|
|
3184
|
-
* [modelcontextprotocol-sdk](https://
|
|
3195
|
+
* [modelcontextprotocol-sdk](https://www.npmjs.com/package/@modelcontextprotocol/sdk) library.
|
|
3185
3196
|
*/
|
|
3186
3197
|
interface modelcontextprotocol_sdk extends Instrumentation, LLMObsIntegration {}
|
|
3187
3198
|
|
|
@@ -3360,7 +3371,7 @@ declare namespace tracer {
|
|
|
3360
3371
|
/**
|
|
3361
3372
|
* This plugin patches the [pino](http://getpino.io)
|
|
3362
3373
|
* to automatically inject trace identifiers in log records when the
|
|
3363
|
-
*
|
|
3374
|
+
* {@link TracerOptions.logInjection | logInjection} option is enabled
|
|
3364
3375
|
* on the tracer.
|
|
3365
3376
|
*/
|
|
3366
3377
|
interface pino extends Integration {}
|
|
@@ -3547,7 +3558,7 @@ declare namespace tracer {
|
|
|
3547
3558
|
/**
|
|
3548
3559
|
* This plugin patches the [winston](https://github.com/winstonjs/winston)
|
|
3549
3560
|
* to automatically inject trace identifiers in log records when the
|
|
3550
|
-
*
|
|
3561
|
+
* {@link TracerOptions.logInjection | logInjection} option is enabled
|
|
3551
3562
|
* on the tracer.
|
|
3552
3563
|
*/
|
|
3553
3564
|
interface winston extends Integration {}
|
|
@@ -3848,7 +3859,7 @@ declare namespace tracer {
|
|
|
3848
3859
|
* key/value pair separated by an equals sign `=`. Spaces and horizontal tabs
|
|
3849
3860
|
* surrounding `list-members` are ignored. There can be a maximum of 32
|
|
3850
3861
|
* `list-members` in a `list`.
|
|
3851
|
-
* More Info: https://www.w3.org/TR/trace-context/#tracestate-
|
|
3862
|
+
* More Info: https://www.w3.org/TR/trace-context/#tracestate-header
|
|
3852
3863
|
*
|
|
3853
3864
|
* Examples:
|
|
3854
3865
|
* Single tracing system (generic format):
|
|
@@ -4063,7 +4074,8 @@ declare namespace tracer {
|
|
|
4063
4074
|
|
|
4064
4075
|
/**
|
|
4065
4076
|
* Sets inputs, outputs, tags, metadata, and metrics as provided for a given LLM Observability span.
|
|
4066
|
-
* Note that with the exception of tags, this method will override any existing values for the provided fields.
|
|
4077
|
+
* Note that with the exception of tags and agent, this method will override any existing values for the provided fields.
|
|
4078
|
+
* Agent fields update earlier agent annotations one top-level field at a time.
|
|
4067
4079
|
*
|
|
4068
4080
|
* For example:
|
|
4069
4081
|
* ```javascript
|
|
@@ -4079,7 +4091,7 @@ declare namespace tracer {
|
|
|
4079
4091
|
* ```
|
|
4080
4092
|
*
|
|
4081
4093
|
* @param span The span to annotate (defaults to the current LLM Observability span if not provided)
|
|
4082
|
-
* @param options An object containing the inputs, outputs, tags, metadata, and
|
|
4094
|
+
* @param options An object containing the inputs, outputs, tags, metadata, metrics, and agent to set on the span.
|
|
4083
4095
|
*/
|
|
4084
4096
|
annotate (options: llmobs.AnnotationOptions): void
|
|
4085
4097
|
annotate (span: tracer.Span | undefined, options: llmobs.AnnotationOptions): void
|
|
@@ -5006,6 +5018,81 @@ declare namespace tracer {
|
|
|
5006
5018
|
}
|
|
5007
5019
|
|
|
5008
5020
|
|
|
5021
|
+
interface AgentToolParameter {
|
|
5022
|
+
type?: string,
|
|
5023
|
+
required?: boolean
|
|
5024
|
+
}
|
|
5025
|
+
|
|
5026
|
+
/**
|
|
5027
|
+
* A plain JSON Schema object with `type: 'object'`, which is how it is told apart from a parameter map.
|
|
5028
|
+
* Schema-library objects (for example Zod schemas) must be converted first, for example with
|
|
5029
|
+
* `z.toJSONSchema()`, or they are dropped.
|
|
5030
|
+
*/
|
|
5031
|
+
interface AgentToolJsonSchema {
|
|
5032
|
+
type: 'object',
|
|
5033
|
+
properties: { [param: string]: { type?: string, [key: string]: unknown } },
|
|
5034
|
+
required?: string[]
|
|
5035
|
+
}
|
|
5036
|
+
|
|
5037
|
+
interface AgentTool {
|
|
5038
|
+
name: string,
|
|
5039
|
+
description?: string,
|
|
5040
|
+
/**
|
|
5041
|
+
* Parameters as `{ [param]: { type, required } }`, or a JSON Schema object, which is flattened to the
|
|
5042
|
+
* same shape.
|
|
5043
|
+
*/
|
|
5044
|
+
parameters?: { [param: string]: AgentToolParameter } | AgentToolJsonSchema
|
|
5045
|
+
}
|
|
5046
|
+
|
|
5047
|
+
/**
|
|
5048
|
+
* Inference parameters reported in an agent manifest. Keys are accepted in snake_case or camelCase and
|
|
5049
|
+
* reported in snake_case. Other keys are dropped, since provider-specific settings can carry secrets.
|
|
5050
|
+
*/
|
|
5051
|
+
interface AgentModelSettings {
|
|
5052
|
+
frequency_penalty?: number,
|
|
5053
|
+
frequencyPenalty?: number,
|
|
5054
|
+
logit_bias?: { [token: string]: number },
|
|
5055
|
+
logitBias?: { [token: string]: number },
|
|
5056
|
+
logprobs?: boolean,
|
|
5057
|
+
max_tokens?: number,
|
|
5058
|
+
maxTokens?: number,
|
|
5059
|
+
parallel_tool_calls?: boolean,
|
|
5060
|
+
parallelToolCalls?: boolean,
|
|
5061
|
+
presence_penalty?: number,
|
|
5062
|
+
presencePenalty?: number,
|
|
5063
|
+
seed?: number,
|
|
5064
|
+
stop_sequences?: string[],
|
|
5065
|
+
stopSequences?: string[],
|
|
5066
|
+
temperature?: number,
|
|
5067
|
+
timeout?: number,
|
|
5068
|
+
tool_choice?: string,
|
|
5069
|
+
toolChoice?: string,
|
|
5070
|
+
top_k?: number,
|
|
5071
|
+
topK?: number,
|
|
5072
|
+
top_logprobs?: number,
|
|
5073
|
+
topLogprobs?: number,
|
|
5074
|
+
top_p?: number,
|
|
5075
|
+
topP?: number
|
|
5076
|
+
}
|
|
5077
|
+
|
|
5078
|
+
/**
|
|
5079
|
+
* Declares the agent an `agent` span represents, reported as the agent's manifest. Only applies to
|
|
5080
|
+
* `agent` spans. Unreportable values are dropped with a warning, and unset values (`undefined`, `null`,
|
|
5081
|
+
* `''`, `[]`) leave what an earlier annotation declared in place.
|
|
5082
|
+
*/
|
|
5083
|
+
interface Agent {
|
|
5084
|
+
/** The agent's name. Defaults to the agent span's name. */
|
|
5085
|
+
name?: string,
|
|
5086
|
+
/** The system instructions the agent runs with. */
|
|
5087
|
+
instructions?: string,
|
|
5088
|
+
/** The model the agent is configured to call. */
|
|
5089
|
+
model?: string,
|
|
5090
|
+
/** Inference parameters. Replaces the settings an earlier annotation declared as a whole. */
|
|
5091
|
+
modelSettings?: AgentModelSettings,
|
|
5092
|
+
/** The tools the agent can call. Replaces tools declared by an earlier annotation. */
|
|
5093
|
+
tools?: AgentTool[]
|
|
5094
|
+
}
|
|
5095
|
+
|
|
5009
5096
|
/**
|
|
5010
5097
|
* Annotation options for LLM Observability spans.
|
|
5011
5098
|
*/
|
|
@@ -5057,7 +5144,12 @@ declare namespace tracer {
|
|
|
5057
5144
|
* A list of ToolDefinition object that represents the tools available to the LLM for this span
|
|
5058
5145
|
* Each definition requires a `name` and optionally accepts `description`, `schema`, and `version`.
|
|
5059
5146
|
* */
|
|
5060
|
-
toolDefinitions?: ToolDefinition[]
|
|
5147
|
+
toolDefinitions?: ToolDefinition[],
|
|
5148
|
+
|
|
5149
|
+
/**
|
|
5150
|
+
* Declares the agent this span represents. Only used on `agent` spans.
|
|
5151
|
+
*/
|
|
5152
|
+
agent?: Agent
|
|
5061
5153
|
}
|
|
5062
5154
|
|
|
5063
5155
|
interface AnnotationContextOptions {
|
|
@@ -5082,6 +5174,13 @@ declare namespace tracer {
|
|
|
5082
5174
|
* A Prompt object that represents the prompt used for an LLM call. Only used on `llm` spans.
|
|
5083
5175
|
*/
|
|
5084
5176
|
prompt?: Prompt,
|
|
5177
|
+
|
|
5178
|
+
/**
|
|
5179
|
+
* Declares the agent running in this context, read when the context is entered. The manifest is
|
|
5180
|
+
* reported on every `agent` span in the context, nested ones included. Use `annotate` on a nested agent
|
|
5181
|
+
* span to declare its own agent.
|
|
5182
|
+
*/
|
|
5183
|
+
agent?: Agent,
|
|
5085
5184
|
}
|
|
5086
5185
|
|
|
5087
5186
|
interface RoutingContextOptions {
|
package/initialize.mjs
CHANGED
|
@@ -101,8 +101,6 @@ if (isMainThread) {
|
|
|
101
101
|
// Only register the loader hook when instrumentation initialized. On a bailout the
|
|
102
102
|
// loader has nothing to instrument and can keep a short-lived process from exiting.
|
|
103
103
|
if (Module.register && initialized) {
|
|
104
|
-
|
|
105
|
-
// options need to cross the registration boundary.
|
|
106
|
-
Module.register('./loader-hook.mjs', import.meta.url)
|
|
104
|
+
require('./register.js')
|
|
107
105
|
}
|
|
108
106
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export {
|
|
2
|
+
configurationToString,
|
|
3
|
+
ConfigurationFetchError,
|
|
4
|
+
fetchRulesConfiguration,
|
|
5
|
+
} from '../vendor/dist/@datadog/openfeature-node-server/rules-based';
|
|
6
|
+
export type {
|
|
7
|
+
ConfigurationFetchErrorCode,
|
|
8
|
+
FlagsConfiguration,
|
|
9
|
+
FlagsConfigurationWire,
|
|
10
|
+
RulesConfigurationFetchOptions,
|
|
11
|
+
} from '../vendor/dist/@datadog/openfeature-node-server/rules-based';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const rules = require('../vendor/dist/@datadog/openfeature-node-server/rules-based')
|
|
4
|
+
|
|
5
|
+
exports.configurationToString = rules.configurationToString
|
|
6
|
+
exports.ConfigurationFetchError = rules.ConfigurationFetchError
|
|
7
|
+
exports.fetchRulesConfiguration = rules.fetchRulesConfiguration
|