@depup/dd-trace 6.16.0-depup.0 → 6.18.0-depup.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/README.md +2 -2
- package/changes.json +1 -1
- package/ci/diagnose.js +0 -23
- package/ci/test-optimization-validation/approval-artifacts.js +0 -3
- package/ci/test-optimization-validation/approval.js +0 -6
- package/ci/test-optimization-validation/artifact-id.js +0 -1
- package/ci/test-optimization-validation/bounded-json.js +0 -1
- package/ci/test-optimization-validation/cli.js +0 -12
- package/ci/test-optimization-validation/command-output-policy.js +0 -1
- package/ci/test-optimization-validation/command-runner.js +0 -3
- package/ci/test-optimization-validation/environment.js +0 -4
- package/ci/test-optimization-validation/executable-approval.js +0 -1
- package/ci/test-optimization-validation/executable.js +0 -5
- package/ci/test-optimization-validation/framework-adapters/cucumber.js +0 -6
- package/ci/test-optimization-validation/framework-adapters/cypress.js +0 -3
- package/ci/test-optimization-validation/framework-adapters/playwright.js +0 -6
- package/ci/test-optimization-validation/framework-adapters/vitest.js +0 -4
- package/ci/test-optimization-validation/generated-test-contract.js +0 -5
- package/ci/test-optimization-validation/generated-verifier.js +0 -1
- package/ci/test-optimization-validation/literal-environment.js +0 -1
- package/ci/test-optimization-validation/manifest-scaffold.js +0 -17
- package/ci/test-optimization-validation/manifest-schema.js +0 -21
- package/ci/test-optimization-validation/offline-fixtures.js +0 -4
- package/ci/test-optimization-validation/plan-writer.js +0 -11
- package/ci/test-optimization-validation/preflight-runner.js +0 -1
- package/ci/test-optimization-validation/redaction.js +0 -4
- package/ci/test-optimization-validation/report-writer.js +0 -16
- package/ci/test-optimization-validation/runner-command.js +0 -3
- package/ci/test-optimization-validation/runner-contract.js +0 -4
- package/ci/test-optimization-validation/safe-files.js +0 -1
- package/ci/test-optimization-validation/scenarios/basic-reporting.js +0 -1
- package/ci/test-optimization-validation/scenarios/ci-wiring.js +0 -1
- package/ci/test-optimization-validation/source-text.js +0 -3
- package/ci/vitest-no-worker-init-setup.mjs +41 -16
- package/index.d.ts +208 -0
- package/package.json +19 -18
- package/packages/datadog-esbuild/src/utils.js +0 -2
- package/packages/datadog-instrumentations/src/aerospike.js +28 -6
- package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js.js +0 -2
- package/packages/datadog-instrumentations/src/aws-sdk.js +0 -2
- package/packages/datadog-instrumentations/src/claude-agent-sdk.js +0 -2
- package/packages/datadog-instrumentations/src/console.js +97 -0
- package/packages/datadog-instrumentations/src/cucumber.js +77 -12
- package/packages/datadog-instrumentations/src/cypress-config.js +27 -38
- package/packages/datadog-instrumentations/src/helpers/bundler-register.js +6 -0
- package/packages/datadog-instrumentations/src/helpers/channel.js +0 -2
- package/packages/datadog-instrumentations/src/helpers/check-require-cache.js +2 -1
- package/packages/datadog-instrumentations/src/helpers/graphql-jit-runtime.js +0 -5
- package/packages/datadog-instrumentations/src/helpers/hooks.js +8 -6
- package/packages/datadog-instrumentations/src/helpers/instrumentation-utils.js +0 -3
- package/packages/datadog-instrumentations/src/helpers/pool-acquire.js +0 -6
- package/packages/datadog-instrumentations/src/helpers/register.js +24 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +111 -26
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentation-registry.js +41 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +3 -17
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/playwright.js +55 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/postgres.js +36 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/supabase.js +128 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js +13 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.js +28 -3
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +20 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms/postgres.js +388 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +0 -5
- package/packages/datadog-instrumentations/src/helpers/router-helper.js +0 -1
- package/packages/datadog-instrumentations/src/jest.js +165 -51
- package/packages/datadog-instrumentations/src/knex.js +0 -1
- package/packages/datadog-instrumentations/src/mariadb-bundle.js +0 -24
- package/packages/datadog-instrumentations/src/mariadb.js +0 -2
- package/packages/datadog-instrumentations/src/mocha/common.js +0 -1
- package/packages/datadog-instrumentations/src/mocha/main.js +25 -26
- package/packages/datadog-instrumentations/src/mocha/utils.js +119 -49
- package/packages/datadog-instrumentations/src/mocha/webdriverio-protocol.js +0 -6
- package/packages/datadog-instrumentations/src/mocha/worker.js +14 -17
- package/packages/datadog-instrumentations/src/mysql2.js +0 -2
- package/packages/datadog-instrumentations/src/openai-realtime/audio-accumulator.js +241 -0
- package/packages/datadog-instrumentations/src/openai-realtime/events.js +76 -0
- package/packages/datadog-instrumentations/src/openai-realtime/index.js +301 -0
- package/packages/datadog-instrumentations/src/openai-realtime/session.js +998 -0
- package/packages/datadog-instrumentations/src/openai-realtime/turns.js +211 -0
- package/packages/datadog-instrumentations/src/openai.js +51 -12
- package/packages/datadog-instrumentations/src/oracledb.js +9 -3
- package/packages/datadog-instrumentations/src/playwright-reporter.js +6 -20
- package/packages/datadog-instrumentations/src/playwright.js +280 -56
- package/packages/datadog-instrumentations/src/{azure-cosmos.js → postgres.js} +1 -1
- package/packages/datadog-instrumentations/src/router.js +0 -2
- package/packages/datadog-instrumentations/src/rum-browser-scripts.js +0 -2
- package/packages/datadog-instrumentations/src/sequelize.js +0 -1
- package/packages/datadog-instrumentations/src/supabase.js +15 -0
- package/packages/datadog-instrumentations/src/undici.js +7 -3
- package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +18 -18
- package/packages/datadog-instrumentations/src/vitest-main.js +121 -30
- package/packages/datadog-instrumentations/src/vitest-util.js +7 -1
- package/packages/datadog-instrumentations/src/vitest-worker.js +49 -13
- package/packages/datadog-instrumentations/src/webdriverio.js +44 -47
- package/packages/datadog-instrumentations/src/ws.js +41 -2
- package/packages/datadog-plugin-ai/src/utils.js +0 -2
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/trace-checkpoint.js +0 -1
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/util.js +0 -2
- package/packages/datadog-plugin-aws-sdk/src/base.js +0 -1
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +0 -1
- package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +0 -1
- package/packages/datadog-plugin-aws-sdk/src/util.js +0 -1
- package/packages/datadog-plugin-azure-durable-functions/src/index.js +0 -1
- package/packages/datadog-plugin-cucumber/src/index.js +9 -0
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +211 -85
- package/packages/datadog-plugin-cypress/src/finalization.js +0 -3
- package/packages/datadog-plugin-cypress/src/index.js +3 -1
- package/packages/datadog-plugin-cypress/src/source-map-utils.js +0 -4
- package/packages/datadog-plugin-cypress/src/support.js +52 -7
- package/packages/datadog-plugin-graphql/src/resolve-error.js +1 -2
- package/packages/datadog-plugin-graphql/src/utils.js +0 -5
- package/packages/datadog-plugin-jest/src/index.js +12 -0
- package/packages/datadog-plugin-kafkajs/src/producer.js +0 -1
- package/packages/datadog-plugin-mocha/src/index.js +38 -11
- package/packages/datadog-plugin-mongodb-core/src/query.js +0 -1
- package/packages/datadog-plugin-openai/src/index.js +16 -1
- package/packages/datadog-plugin-openai/src/realtime.js +144 -0
- package/packages/datadog-plugin-openai-agents/src/integration.js +0 -4
- package/packages/datadog-plugin-openai-agents/src/util.js +0 -1
- package/packages/datadog-plugin-playwright/src/index.js +81 -9
- package/packages/datadog-plugin-postgres/src/index.js +167 -0
- package/packages/datadog-plugin-prisma/src/datadog-tracing-helper.js +0 -1
- package/packages/datadog-plugin-redis/src/index.js +15 -1
- package/packages/datadog-plugin-supabase/src/error.js +18 -0
- package/packages/datadog-plugin-supabase/src/index.js +21 -0
- package/packages/datadog-plugin-supabase/src/supabase-auth-js-gotrueclient-getuser.js +69 -0
- package/packages/datadog-plugin-supabase/src/supabase-functions-js-functionsclient-invoke.js +70 -0
- package/packages/datadog-plugin-supabase/src/supabase-postgrest-js-postgrestbuilder-then.js +122 -0
- package/packages/datadog-plugin-supabase/src/supabase-realtime-js-realtimechannel-send.js +66 -0
- package/packages/datadog-plugin-supabase/src/supabase-storage-js-handle-request.js +93 -0
- package/packages/datadog-plugin-supabase/src/url.js +17 -0
- package/packages/datadog-plugin-vitest/src/index.js +9 -0
- package/packages/datadog-plugin-ws/src/producer.js +1 -1
- package/packages/datadog-plugin-ws/src/util.js +0 -4
- package/packages/datadog-shimmer/src/shimmer.js +14 -10
- package/packages/datadog-turbopack/index.js +4 -7
- package/packages/datadog-turbopack/src/loader.js +6 -18
- package/packages/datadog-webpack/src/loader.js +0 -1
- package/packages/dd-trace/src/agent/info.js +5 -4
- package/packages/dd-trace/src/aiguard/client.js +2 -3
- package/packages/dd-trace/src/aiguard/evaluation.js +6 -12
- package/packages/dd-trace/src/aiguard/index.js +2 -2
- package/packages/dd-trace/src/aiguard/integrations/index.js +1 -1
- package/packages/dd-trace/src/aiguard/integrations/openai.js +81 -7
- package/packages/dd-trace/src/aiguard/messages/anthropic.js +0 -2
- package/packages/dd-trace/src/aiguard/messages/openai.js +64 -1
- package/packages/dd-trace/src/aiguard/messages/utils.js +0 -1
- package/packages/dd-trace/src/aiguard/redaction.js +0 -1
- package/packages/dd-trace/src/aiguard/sdk.js +1 -1
- package/packages/dd-trace/src/appsec/activation.js +1 -1
- package/packages/dd-trace/src/appsec/api_security/normalized-route.js +0 -5
- package/packages/dd-trace/src/appsec/api_security/sampler.js +0 -4
- package/packages/dd-trace/src/appsec/blocking/index.js +3 -3
- package/packages/dd-trace/src/appsec/downstream_requests.js +1 -4
- package/packages/dd-trace/src/appsec/iast/index.js +1 -1
- package/packages/dd-trace/src/appsec/iast/overhead-controller.js +5 -5
- package/packages/dd-trace/src/appsec/iast/taint-tracking/index.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +3 -3
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/sql-sensitive-analyzer.js +8 -10
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +2 -2
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +4 -1
- package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +7 -7
- package/packages/dd-trace/src/appsec/index.js +2 -2
- package/packages/dd-trace/src/appsec/lambda.js +71 -2
- package/packages/dd-trace/src/appsec/rasp/utils.js +5 -1
- package/packages/dd-trace/src/appsec/remote_config.js +8 -6
- package/packages/dd-trace/src/appsec/reporter.js +10 -6
- package/packages/dd-trace/src/appsec/rule_manager.js +3 -3
- package/packages/dd-trace/src/appsec/sdk/track_event.js +0 -2
- package/packages/dd-trace/src/appsec/waf/index.js +2 -2
- package/packages/dd-trace/src/appsec/waf/waf_manager.js +8 -5
- package/packages/dd-trace/src/carrier.js +0 -5
- package/packages/dd-trace/src/ci-visibility/dynamic-atr-retries.js +104 -0
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +0 -2
- package/packages/dd-trace/src/ci-visibility/efd-retry-policy.js +34 -3
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/index.js +0 -4
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/msgpack-to-json.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/sink.js +0 -2
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +37 -15
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +0 -3
- package/packages/dd-trace/src/ci-visibility/exporters/request.js +0 -11
- package/packages/dd-trace/src/ci-visibility/exporters/settings-cache-key.js +0 -1
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +0 -1
- package/packages/dd-trace/src/ci-visibility/requests/fs-cache.js +0 -6
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +2 -2
- package/packages/dd-trace/src/ci-visibility/requests/rate-limit.js +0 -1
- package/packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js +0 -5
- package/packages/dd-trace/src/ci-visibility/requests/video-request.js +0 -1
- package/packages/dd-trace/src/ci-visibility/telemetry.js +13 -0
- package/packages/dd-trace/src/ci-visibility/test-optimization-cache.js +0 -1
- package/packages/dd-trace/src/ci-visibility/test-screenshot.js +0 -2
- package/packages/dd-trace/src/ci-visibility/test-video.js +0 -1
- package/packages/dd-trace/src/config/defaults.js +3 -2
- package/packages/dd-trace/src/config/generated-config-types.d.ts +88 -82
- package/packages/dd-trace/src/config/helper.js +0 -1
- package/packages/dd-trace/src/config/index.js +31 -30
- package/packages/dd-trace/src/config/parsers.js +34 -6
- package/packages/dd-trace/src/config/remote_config.js +25 -109
- package/packages/dd-trace/src/config/supported-configurations.json +150 -10
- package/packages/dd-trace/src/datastreams/encoding.js +0 -1
- package/packages/dd-trace/src/datastreams/pathway.js +0 -1
- package/packages/dd-trace/src/debugger/constants.js +10 -0
- package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +62 -10
- package/packages/dd-trace/src/debugger/devtools_client/config.js +4 -1
- package/packages/dd-trace/src/debugger/devtools_client/guardrail-metrics.js +15 -0
- package/packages/dd-trace/src/debugger/devtools_client/index.js +103 -27
- package/packages/dd-trace/src/debugger/devtools_client/json-buffer.js +50 -7
- package/packages/dd-trace/src/debugger/devtools_client/log.js +3 -1
- package/packages/dd-trace/src/debugger/devtools_client/probe_sampler.js +21 -8
- package/packages/dd-trace/src/debugger/devtools_client/send.js +41 -15
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +53 -13
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +118 -71
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/redaction.js +5 -3
- package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +0 -3
- package/packages/dd-trace/src/debugger/devtools_client/status.js +21 -7
- package/packages/dd-trace/src/debugger/guardrail-metrics.js +167 -0
- package/packages/dd-trace/src/debugger/index.js +51 -3
- package/packages/dd-trace/src/debugger/inspect-segment.js +0 -3
- package/packages/dd-trace/src/debugger/probe_sampler.js +133 -9
- package/packages/dd-trace/src/debugger/probe_sampler_constants.js +31 -1
- package/packages/dd-trace/src/dogstatsd.js +0 -23
- package/packages/dd-trace/src/encode/0.4-cross-payload.js +0 -3
- package/packages/dd-trace/src/encode/0.4.js +0 -7
- package/packages/dd-trace/src/encode/0.5.js +0 -2
- package/packages/dd-trace/src/encode/tags-processors.js +0 -1
- package/packages/dd-trace/src/evp_proxy/constants.js +2 -0
- package/packages/dd-trace/src/evp_proxy/direct.js +17 -13
- package/packages/dd-trace/src/evp_proxy/discovery.js +14 -11
- package/packages/dd-trace/src/evp_proxy/path.js +21 -9
- package/packages/dd-trace/src/exporters/agent/writer.js +0 -1
- package/packages/dd-trace/src/exporters/agentless/index.js +0 -1
- package/packages/dd-trace/src/exporters/agentless/intake.js +0 -1
- package/packages/dd-trace/src/exporters/agentless/writer.js +0 -3
- package/packages/dd-trace/src/exporters/common/final-flush-request-tracker.js +0 -6
- package/packages/dd-trace/src/exporters/common/request.js +1 -0
- package/packages/dd-trace/src/exporters/common/url.js +33 -4
- package/packages/dd-trace/src/exporters/common/writer.js +0 -2
- package/packages/dd-trace/src/id.js +0 -11
- package/packages/dd-trace/src/llmobs/audio-codec.js +192 -0
- package/packages/dd-trace/src/llmobs/audio-utils.js +121 -0
- package/packages/dd-trace/src/llmobs/constants/audio.js +35 -0
- package/packages/dd-trace/src/llmobs/constants/prompts.js +14 -0
- package/packages/dd-trace/src/llmobs/constants/tags.js +17 -0
- package/packages/dd-trace/src/llmobs/eval-metric.js +0 -6
- package/packages/dd-trace/src/llmobs/experiments/dataset.js +0 -4
- package/packages/dd-trace/src/llmobs/experiments/experiment.js +0 -3
- package/packages/dd-trace/src/llmobs/experiments/index.js +7 -6
- package/packages/dd-trace/src/llmobs/experiments/util.js +1 -11
- package/packages/dd-trace/src/llmobs/index.js +1 -3
- package/packages/dd-trace/src/llmobs/noop.js +10 -0
- package/packages/dd-trace/src/llmobs/plugins/ai/util.js +0 -4
- package/packages/dd-trace/src/llmobs/plugins/anthropic/util.js +0 -1
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +0 -4
- package/packages/dd-trace/src/llmobs/plugins/modelcontextprotocol-sdk/utils.js +0 -2
- package/packages/dd-trace/src/llmobs/plugins/openai/constants.js +0 -2
- package/packages/dd-trace/src/llmobs/plugins/openai/index.js +4 -6
- package/packages/dd-trace/src/llmobs/plugins/openai/realtime.js +285 -0
- package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +16 -3
- package/packages/dd-trace/src/llmobs/prompts/cache.js +272 -0
- package/packages/dd-trace/src/llmobs/prompts/manager.js +647 -0
- package/packages/dd-trace/src/llmobs/prompts/noop.js +29 -0
- package/packages/dd-trace/src/llmobs/prompts/prompt.js +158 -0
- package/packages/dd-trace/src/llmobs/sdk.js +21 -6
- package/packages/dd-trace/src/llmobs/span_processor.js +81 -2
- package/packages/dd-trace/src/llmobs/tagger.js +39 -11
- package/packages/dd-trace/src/llmobs/telemetry.js +36 -4
- package/packages/dd-trace/src/llmobs/util.js +0 -34
- package/packages/dd-trace/src/llmobs/writers/base.js +0 -1
- package/packages/dd-trace/src/llmobs/writers/util.js +1 -2
- package/packages/dd-trace/src/log/channels.js +3 -0
- package/packages/dd-trace/src/log/index.js +23 -5
- package/packages/dd-trace/src/log-submission/log-submission-plugin.js +74 -6
- package/packages/dd-trace/src/msgpack/chunk.js +0 -1
- package/packages/dd-trace/src/openfeature/agentless_configuration_source.js +0 -12
- package/packages/dd-trace/src/openfeature/configuration_source.js +4 -1
- package/packages/dd-trace/src/openfeature/encoding.js +0 -2
- package/packages/dd-trace/src/openfeature/eval-metrics-hook.js +0 -1
- package/packages/dd-trace/src/openfeature/flagging_provider.js +3 -3
- package/packages/dd-trace/src/openfeature/index.js +6 -6
- package/packages/dd-trace/src/openfeature/span-enrichment-hook.js +0 -1
- package/packages/dd-trace/src/openfeature/span-enrichment.js +0 -4
- package/packages/dd-trace/src/openfeature/writers/base.js +90 -23
- package/packages/dd-trace/src/openfeature/writers/exposures.js +4 -5
- package/packages/dd-trace/src/openfeature/writers/util.js +104 -37
- package/packages/dd-trace/src/opentelemetry/logs/logger.js +0 -1
- package/packages/dd-trace/src/opentelemetry/logs/logger_provider.js +0 -1
- package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +0 -1
- package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +0 -2
- package/packages/dd-trace/src/opentelemetry/metrics/meter_provider.js +0 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_transformer.js +0 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +0 -1
- package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +1 -14
- package/packages/dd-trace/src/opentelemetry/metrics/time.js +0 -1
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +30 -13
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +0 -1
- package/packages/dd-trace/src/opentelemetry/span-helpers.js +0 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +0 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +0 -3
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +0 -6
- package/packages/dd-trace/src/opentracing/span_context.js +0 -1
- package/packages/dd-trace/src/opentracing/tracer.js +3 -3
- package/packages/dd-trace/src/otel-thread-ctx.js +38 -11
- package/packages/dd-trace/src/payload-tagging/tagging.js +15 -3
- package/packages/dd-trace/src/plugin_manager.js +27 -8
- package/packages/dd-trace/src/plugins/ci_plugin.js +1 -2
- package/packages/dd-trace/src/plugins/database.js +2 -6
- package/packages/dd-trace/src/plugins/index.js +7 -0
- package/packages/dd-trace/src/plugins/plugin.js +0 -4
- package/packages/dd-trace/src/plugins/tracing.js +1 -1
- package/packages/dd-trace/src/plugins/util/git.js +1 -3
- package/packages/dd-trace/src/plugins/util/http-otel-semantics.js +0 -1
- package/packages/dd-trace/src/plugins/util/llm.js +0 -2
- package/packages/dd-trace/src/plugins/util/status-validator.js +0 -1
- package/packages/dd-trace/src/plugins/util/test.js +26 -20
- package/packages/dd-trace/src/plugins/util/url.js +0 -5
- package/packages/dd-trace/src/priority_sampler.js +0 -6
- package/packages/dd-trace/src/process-tags/index.js +0 -1
- package/packages/dd-trace/src/profiler.js +132 -35
- package/packages/dd-trace/src/profiling/exporters/event_serializer.js +0 -1
- package/packages/dd-trace/src/profiling/profiler.js +101 -41
- package/packages/dd-trace/src/profiling/ssi-heuristics.js +29 -15
- package/packages/dd-trace/src/propagation-hash/index.js +0 -1
- package/packages/dd-trace/src/proxy.js +23 -47
- package/packages/dd-trace/src/random_sampler.js +0 -4
- package/packages/dd-trace/src/rate_limiter.js +0 -4
- package/packages/dd-trace/src/remote_config/capabilities.js +1 -9
- package/packages/dd-trace/src/remote_config/index.js +0 -1
- package/packages/dd-trace/src/runtime_metrics/otlp_runtime_metrics.js +0 -3
- package/packages/dd-trace/src/sampler.js +0 -4
- package/packages/dd-trace/src/sampling_rule.js +0 -7
- package/packages/dd-trace/src/serverless/vercel.js +0 -1
- package/packages/dd-trace/src/serverless.js +0 -1
- package/packages/dd-trace/src/service-naming/index.js +0 -1
- package/packages/dd-trace/src/service-naming/schemas/util.js +0 -1
- package/packages/dd-trace/src/service-naming/schemas/v0/storage.js +7 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/storage.js +5 -0
- package/packages/dd-trace/src/span_processor.js +2 -2
- package/packages/dd-trace/src/span_sampler.js +0 -1
- package/packages/dd-trace/src/standalone/product.js +2 -2
- package/packages/dd-trace/src/standalone/tracesource.js +0 -1
- package/packages/dd-trace/src/startup-log.js +1 -1
- package/packages/dd-trace/src/telemetry/endpoints.js +0 -8
- package/packages/dd-trace/src/telemetry/logs/index.js +16 -5
- package/packages/dd-trace/src/telemetry/logs/log-collector.js +16 -6
- package/packages/dd-trace/src/telemetry/metrics.js +0 -2
- package/packages/dd-trace/src/telemetry/send-data.js +2 -1
- package/packages/dd-trace/src/telemetry/telemetry.js +4 -1
- package/packages/dd-trace/src/tracer.js +5 -4
- package/packages/dd-trace/src/util.js +13 -1
- package/vendor/dist/@datadog/openfeature-node-server/index.js +1 -1
- package/packages/datadog-instrumentations/src/bullmq.js +0 -11
- package/packages/datadog-instrumentations/src/langchain.js +0 -7
- package/packages/datadog-instrumentations/src/langgraph.js +0 -7
- package/packages/datadog-instrumentations/src/mercurius.js +0 -11
|
@@ -241,7 +241,6 @@ function getRunnerSearchRoots (framework, command, projectRoot, repositoryRoot)
|
|
|
241
241
|
* @param {string} projectRoot detected project root
|
|
242
242
|
* @param {string} repositoryRoot repository root
|
|
243
243
|
* @param {boolean} directory whether the option explicitly requires a directory
|
|
244
|
-
* @returns {void}
|
|
245
244
|
*/
|
|
246
245
|
function addRunnerSearchRoot (roots, value, projectRoot, repositoryRoot, directory) {
|
|
247
246
|
if (typeof value !== 'string' || !value) return
|
|
@@ -523,7 +522,6 @@ function getRunnerArgs (framework, invocation) {
|
|
|
523
522
|
* Normalizes executable shims and supported JavaScript runner entrypoints.
|
|
524
523
|
*
|
|
525
524
|
* @param {string} token command token
|
|
526
|
-
* @returns {string} normalized executable basename
|
|
527
525
|
*/
|
|
528
526
|
function normalizeRunnerBasename (token) {
|
|
529
527
|
return path.basename(token)
|
|
@@ -670,7 +668,6 @@ function tokenizeCommand (command) {
|
|
|
670
668
|
* Returns the executable name for a framework.
|
|
671
669
|
*
|
|
672
670
|
* @param {string} framework framework name
|
|
673
|
-
* @returns {string} executable name
|
|
674
671
|
*/
|
|
675
672
|
function getRunnerExecutableName (framework) {
|
|
676
673
|
if (framework === 'cucumber') return 'cucumber-js'
|
|
@@ -682,7 +679,6 @@ function getRunnerExecutableName (framework) {
|
|
|
682
679
|
*
|
|
683
680
|
* @param {string} root root path
|
|
684
681
|
* @param {string} filename candidate path
|
|
685
|
-
* @returns {boolean} whether the candidate is contained
|
|
686
682
|
*/
|
|
687
683
|
function isPathInside (root, filename) {
|
|
688
684
|
const relative = path.relative(path.resolve(root), path.resolve(filename))
|
|
@@ -189,7 +189,6 @@ function refuseSymbolicLink (filename, label) {
|
|
|
189
189
|
*
|
|
190
190
|
* @param {string} root allowed root
|
|
191
191
|
* @param {string} filename candidate path
|
|
192
|
-
* @returns {boolean} true when the candidate is inside the root
|
|
193
192
|
*/
|
|
194
193
|
function isPathInside (root, filename) {
|
|
195
194
|
const relative = path.relative(root, filename)
|
|
@@ -338,7 +338,6 @@ function getSelectorEvidence (framework, events) {
|
|
|
338
338
|
*
|
|
339
339
|
* @param {string} actual captured test source path
|
|
340
340
|
* @param {string} expected approved representative path
|
|
341
|
-
* @returns {boolean} whether both paths identify the same file
|
|
342
341
|
*/
|
|
343
342
|
function sourceFilesMatch (actual, expected) {
|
|
344
343
|
const normalizedActual = normalizeSourceFile(actual)
|
|
@@ -592,7 +592,6 @@ function readProjectSource (filename, projectFileSources) {
|
|
|
592
592
|
*
|
|
593
593
|
* @param {string} source file source
|
|
594
594
|
* @param {string} value recorded value
|
|
595
|
-
* @returns {boolean} literal presence
|
|
596
595
|
*/
|
|
597
596
|
function containsLiteral (source, value) {
|
|
598
597
|
const normalizedSource = source.replaceAll('\r\n', '\n')
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Replaces JavaScript comments with spaces while preserving line structure and string literals.
|
|
5
5
|
*
|
|
6
6
|
* @param {string} source JavaScript or TypeScript source
|
|
7
|
-
* @returns {string} source with comments masked
|
|
8
7
|
*/
|
|
9
8
|
function maskJavaScriptComments (source) {
|
|
10
9
|
return maskJavaScriptSource(source, false)
|
|
@@ -14,7 +13,6 @@ function maskJavaScriptComments (source) {
|
|
|
14
13
|
* Replaces JavaScript comments and string literals with spaces while preserving line structure.
|
|
15
14
|
*
|
|
16
15
|
* @param {string} source JavaScript or TypeScript source
|
|
17
|
-
* @returns {string} source with non-code text masked
|
|
18
16
|
*/
|
|
19
17
|
function maskJavaScriptNonCode (source) {
|
|
20
18
|
return maskJavaScriptSource(source, true)
|
|
@@ -25,7 +23,6 @@ function maskJavaScriptNonCode (source) {
|
|
|
25
23
|
*
|
|
26
24
|
* @param {string} source JavaScript or TypeScript source
|
|
27
25
|
* @param {boolean} maskStrings whether string and template literal contents should be masked
|
|
28
|
-
* @returns {string} masked source
|
|
29
26
|
*/
|
|
30
27
|
function maskJavaScriptSource (source, maskStrings) {
|
|
31
28
|
const characters = [...source]
|
|
@@ -15,6 +15,8 @@ const earlyFlakeDetectionRetryPolicy = providedContext.earlyFlakeDetectionRetryP
|
|
|
15
15
|
schedulingRetryCount: 0,
|
|
16
16
|
}
|
|
17
17
|
const earlyFlakeDetectionRetries = earlyFlakeDetectionRetryPolicy.schedulingRetryCount
|
|
18
|
+
const dynamicAtrRetryPolicy = providedContext.dynamicAtrRetryPolicy
|
|
19
|
+
const flakyTestRetriesConfiguration = providedContext.flakyTestRetriesConfiguration
|
|
18
20
|
const isEfdSuiteAdmissionEnabled = providedContext.isEfdSuiteAdmissionEnabled === true
|
|
19
21
|
const isEarlyFlakeDetectionEnabled = providedContext.isEarlyFlakeDetectionEnabled === true
|
|
20
22
|
const knownTests = providedContext.knownTests || {}
|
|
@@ -31,6 +33,7 @@ const earlyFlakeDetectionSkippedResults = new WeakMap()
|
|
|
31
33
|
const earlyFlakeDetectionStartByTask = new WeakMap()
|
|
32
34
|
const nextAttemptIndexByTask = new WeakMap()
|
|
33
35
|
const retryAttemptIndexByTask = new WeakMap()
|
|
36
|
+
const dynamicAtrExecutionStartByTask = new WeakMap()
|
|
34
37
|
const usedRumTestExecutionIds = new Set()
|
|
35
38
|
let browserCommands
|
|
36
39
|
let now
|
|
@@ -86,6 +89,11 @@ if (isNoWorkerInitActive) {
|
|
|
86
89
|
const isQuarantinedTest = quarantinedTests[testSuite]?.[testName] && !isAttemptToFixTest
|
|
87
90
|
const attemptIndex = getNextAttemptIndex(task)
|
|
88
91
|
const attemptStart = now()
|
|
92
|
+
if (task.retry?.__ddTestOptAtr && retryAttemptIndexByTask.get(task).index === 0) {
|
|
93
|
+
const executionStart = task.result.repeatCount > 0 ? attemptStart : task.result.startTime - timeOrigin
|
|
94
|
+
dynamicAtrExecutionStartByTask.set(task, executionStart)
|
|
95
|
+
task.meta.__ddTestOptAtrRetries = undefined
|
|
96
|
+
}
|
|
89
97
|
if (attemptIndex > 0) {
|
|
90
98
|
recordTestOptimizationStatus(task, attemptIndex - 1)
|
|
91
99
|
}
|
|
@@ -153,11 +161,43 @@ function applyExecutionChanges (suite, isEfdSuiteAdmissionAllowed) {
|
|
|
153
161
|
task.repeats = earlyFlakeDetectionRetries
|
|
154
162
|
task.meta.__ddTestOptEfdRetries = earlyFlakeDetectionRetries
|
|
155
163
|
}
|
|
164
|
+
configureDynamicAtr(task)
|
|
156
165
|
wrapRetryCondition(task)
|
|
157
166
|
}
|
|
158
167
|
}
|
|
159
168
|
}
|
|
160
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Stops Datadog-managed retries at the initial attempt's duration budget, after the complete lifecycle.
|
|
172
|
+
*
|
|
173
|
+
* @param {object} task
|
|
174
|
+
*/
|
|
175
|
+
function configureDynamicAtr (task) {
|
|
176
|
+
if (!dynamicAtrRetryPolicy || !flakyTestRetriesConfiguration) return
|
|
177
|
+
const projectName = task.file.projectName
|
|
178
|
+
const isManagedProject = projectName
|
|
179
|
+
? flakyTestRetriesConfiguration.projectNames.includes(projectName)
|
|
180
|
+
: flakyTestRetriesConfiguration.includesUnnamedProject
|
|
181
|
+
if (!isManagedProject || !task.retry?.__ddTestOptAtr || task.retry.count <= 0) return
|
|
182
|
+
|
|
183
|
+
task.retry = {
|
|
184
|
+
...task.retry,
|
|
185
|
+
condition () {
|
|
186
|
+
// AroundEach fixture teardown can fail after onTestFinished recorded the attempt's errors.
|
|
187
|
+
recordRetryErrorCount(task)
|
|
188
|
+
if (task.meta.__ddTestOptAtrRetries === undefined) {
|
|
189
|
+
const executionStart = dynamicAtrExecutionStartByTask.get(task) ?? task.result.startTime - timeOrigin
|
|
190
|
+
const duration = now() - executionStart
|
|
191
|
+
task.meta.__ddTestOptAtrRetries = dynamicAtrRetryPolicy.find(
|
|
192
|
+
({ durationLimitMs }) => durationLimitMs === undefined || duration <= durationLimitMs
|
|
193
|
+
).retryCount
|
|
194
|
+
}
|
|
195
|
+
const retryIndex = retryAttemptIndexByTask.get(task)?.index ?? task.result.retryCount
|
|
196
|
+
return retryIndex < task.meta.__ddTestOptAtrRetries
|
|
197
|
+
},
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
161
201
|
function getNextAttemptIndex (task) {
|
|
162
202
|
const attemptIndex = nextAttemptIndexByTask.get(task) || 0
|
|
163
203
|
nextAttemptIndexByTask.set(task, attemptIndex + 1)
|
|
@@ -179,7 +219,6 @@ function getNextAttemptIndex (task) {
|
|
|
179
219
|
*
|
|
180
220
|
* @param {object} task
|
|
181
221
|
* @param {number} attemptIndex
|
|
182
|
-
* @returns {void}
|
|
183
222
|
*/
|
|
184
223
|
function prepareRumCorrelation (task, attemptIndex) {
|
|
185
224
|
// A per-origin cookie cannot identify overlapping attempts without racing.
|
|
@@ -213,7 +252,6 @@ function prepareRumCorrelation (task, attemptIndex) {
|
|
|
213
252
|
*
|
|
214
253
|
* @param {object} task
|
|
215
254
|
* @param {number} attemptIndex
|
|
216
|
-
* @returns {void}
|
|
217
255
|
*/
|
|
218
256
|
function finishRumCorrelation (task, attemptIndex) {
|
|
219
257
|
const testExecutionId = task.meta.__ddTestOptRumTestExecutionIds?.[attemptIndex]
|
|
@@ -228,7 +266,6 @@ function finishRumCorrelation (task, attemptIndex) {
|
|
|
228
266
|
*
|
|
229
267
|
* @param {object} task
|
|
230
268
|
* @param {number} attemptIndex
|
|
231
|
-
* @returns {void}
|
|
232
269
|
*/
|
|
233
270
|
function recordRumActivity (task, attemptIndex) {
|
|
234
271
|
if (!getIsRumActive(getRum())) return
|
|
@@ -252,7 +289,6 @@ function getRum () {
|
|
|
252
289
|
* Returns whether the current RUM session is active.
|
|
253
290
|
*
|
|
254
291
|
* @param {object|undefined} rum
|
|
255
|
-
* @returns {boolean}
|
|
256
292
|
*/
|
|
257
293
|
function getIsRumActive (rum) {
|
|
258
294
|
if (!rum) return false
|
|
@@ -269,7 +305,6 @@ function getIsRumActive (rum) {
|
|
|
269
305
|
* Returns whether a task or any containing suite is concurrent.
|
|
270
306
|
*
|
|
271
307
|
* @param {object} task
|
|
272
|
-
* @returns {boolean}
|
|
273
308
|
*/
|
|
274
309
|
function isConcurrentTask (task) {
|
|
275
310
|
let currentTask = task
|
|
@@ -308,7 +343,6 @@ function generateTestExecutionId () {
|
|
|
308
343
|
* Sets and verifies the RUM correlation cookie for the current origin.
|
|
309
344
|
*
|
|
310
345
|
* @param {string} testExecutionId
|
|
311
|
-
* @returns {boolean}
|
|
312
346
|
*/
|
|
313
347
|
function setRumCorrelationCookie (testExecutionId) {
|
|
314
348
|
try {
|
|
@@ -324,7 +358,6 @@ function setRumCorrelationCookie (testExecutionId) {
|
|
|
324
358
|
* Clears the RUM correlation cookie if it still belongs to this attempt.
|
|
325
359
|
*
|
|
326
360
|
* @param {string} testExecutionId
|
|
327
|
-
* @returns {void}
|
|
328
361
|
*/
|
|
329
362
|
function clearRumCorrelationCookie (testExecutionId) {
|
|
330
363
|
try {
|
|
@@ -440,7 +473,6 @@ function recordManualRepeatStatus (task, attemptIndex) {
|
|
|
440
473
|
* Records cumulative errors at the end of each configured retry attempt.
|
|
441
474
|
*
|
|
442
475
|
* @param {object} task
|
|
443
|
-
* @returns {void}
|
|
444
476
|
*/
|
|
445
477
|
function recordRetryErrorCount (task) {
|
|
446
478
|
const retryLimit = getRetryLimit(task)
|
|
@@ -457,7 +489,6 @@ function recordRetryErrorCount (task) {
|
|
|
457
489
|
* @param {object} task
|
|
458
490
|
* @param {number} attemptIndex
|
|
459
491
|
* @param {number} attemptStart
|
|
460
|
-
* @returns {void}
|
|
461
492
|
*/
|
|
462
493
|
function recordTestAttemptTiming (task, attemptIndex, attemptStart) {
|
|
463
494
|
task.meta.__ddTestOptAttemptStartTimes ||= []
|
|
@@ -470,17 +501,15 @@ function recordTestAttemptTiming (task, attemptIndex, attemptStart) {
|
|
|
470
501
|
* Returns the configured retry count for numeric and object-form retry options.
|
|
471
502
|
*
|
|
472
503
|
* @param {object} task
|
|
473
|
-
* @returns {number}
|
|
474
504
|
*/
|
|
475
505
|
function getRetryLimit (task) {
|
|
476
|
-
return typeof task.retry === 'number' ? task.retry : task.retry?.count || 0
|
|
506
|
+
return task.meta.__ddTestOptAtrRetries ?? (typeof task.retry === 'number' ? task.retry : task.retry?.count || 0)
|
|
477
507
|
}
|
|
478
508
|
|
|
479
509
|
/**
|
|
480
510
|
* Wraps Vitest's retry condition so final-attempt handling follows the condition's actual result.
|
|
481
511
|
*
|
|
482
512
|
* @param {object} task
|
|
483
|
-
* @returns {void}
|
|
484
513
|
*/
|
|
485
514
|
function wrapRetryCondition (task) {
|
|
486
515
|
if (typeof task.retry !== 'object' || !task.retry?.condition || getRetryLimit(task) === 0) return
|
|
@@ -572,7 +601,6 @@ function switchQuarantinedFinalFailure (task, attemptIndex) {
|
|
|
572
601
|
* Converts a quarantined failure into the passing runner state expected by Vitest.
|
|
573
602
|
*
|
|
574
603
|
* @param {object} task
|
|
575
|
-
* @returns {void}
|
|
576
604
|
*/
|
|
577
605
|
function markQuarantinedFailure (task) {
|
|
578
606
|
const testSuite = getTestSuite(task)
|
|
@@ -676,7 +704,6 @@ function noopTest () {}
|
|
|
676
704
|
/**
|
|
677
705
|
* Returns whether Vitest's private task function setter is available.
|
|
678
706
|
*
|
|
679
|
-
* @returns {boolean}
|
|
680
707
|
*/
|
|
681
708
|
function canReplaceVitestTaskFn () {
|
|
682
709
|
return typeof setVitestTaskFn === 'function'
|
|
@@ -703,7 +730,6 @@ function isEarlyFlakeDetectionTest (testSuite, testName) {
|
|
|
703
730
|
* Returns whether Datadog admitted this task for EFD retries.
|
|
704
731
|
*
|
|
705
732
|
* @param {object} task
|
|
706
|
-
* @returns {boolean}
|
|
707
733
|
*/
|
|
708
734
|
function isEarlyFlakeDetectionTask (task) {
|
|
709
735
|
return task.meta.__ddTestOptEfdRetries !== undefined
|
|
@@ -751,7 +777,6 @@ function getEarlyFlakeDetectionSuiteCandidate (suite) {
|
|
|
751
777
|
*
|
|
752
778
|
* @param {string} testSuite
|
|
753
779
|
* @param {string} testName
|
|
754
|
-
* @returns {boolean}
|
|
755
780
|
*/
|
|
756
781
|
function isNewTest (testSuite, testName) {
|
|
757
782
|
return !(knownTests[testSuite] || []).includes(testName)
|
package/index.d.ts
CHANGED
|
@@ -298,6 +298,7 @@ interface Plugins {
|
|
|
298
298
|
"playwright": tracer.plugins.playwright;
|
|
299
299
|
"pg": tracer.plugins.pg;
|
|
300
300
|
"pino": tracer.plugins.pino;
|
|
301
|
+
"postgres": tracer.plugins.postgres;
|
|
301
302
|
"prisma": tracer.plugins.prisma;
|
|
302
303
|
"protobufjs": tracer.plugins.protobufjs;
|
|
303
304
|
"redis": tracer.plugins.redis;
|
|
@@ -306,6 +307,7 @@ interface Plugins {
|
|
|
306
307
|
"router": tracer.plugins.router;
|
|
307
308
|
"selenium": tracer.plugins.selenium;
|
|
308
309
|
"sharedb": tracer.plugins.sharedb;
|
|
310
|
+
"supabase": tracer.plugins.supabase;
|
|
309
311
|
"tedious": tracer.plugins.tedious;
|
|
310
312
|
"undici": tracer.plugins.undici;
|
|
311
313
|
"vitest": tracer.plugins.vitest;
|
|
@@ -3126,6 +3128,25 @@ declare namespace tracer {
|
|
|
3126
3128
|
*/
|
|
3127
3129
|
interface pino extends Integration {}
|
|
3128
3130
|
|
|
3131
|
+
/**
|
|
3132
|
+
* This plugin automatically instruments the
|
|
3133
|
+
* [Postgres.js](https://github.com/porsager/postgres) module.
|
|
3134
|
+
*/
|
|
3135
|
+
interface postgres extends DatabaseInstrumentation {
|
|
3136
|
+
/**
|
|
3137
|
+
* The service name to be used for this plugin.
|
|
3138
|
+
*/
|
|
3139
|
+
service?: string;
|
|
3140
|
+
/**
|
|
3141
|
+
* The database monitoring propagation mode to be used for this plugin.
|
|
3142
|
+
*/
|
|
3143
|
+
dbmPropagationMode?: TracerOptions['dbmPropagationMode'];
|
|
3144
|
+
/**
|
|
3145
|
+
* Appends the SQL comment propagation to the query string. Prepends the comment if `false`. For long query strings, the appended propagation comment might be truncated, causing loss of correlation between the query and trace.
|
|
3146
|
+
*/
|
|
3147
|
+
appendComment?: boolean;
|
|
3148
|
+
}
|
|
3149
|
+
|
|
3129
3150
|
/**
|
|
3130
3151
|
* This plugin automatically instruments the
|
|
3131
3152
|
* [@prisma/client](https://www.prisma.io/docs/orm/prisma-client) module.
|
|
@@ -3241,6 +3262,12 @@ declare namespace tracer {
|
|
|
3241
3262
|
};
|
|
3242
3263
|
}
|
|
3243
3264
|
|
|
3265
|
+
/**
|
|
3266
|
+
* This plugin automatically instruments the
|
|
3267
|
+
* [Supabase JavaScript client](https://github.com/supabase/supabase-js).
|
|
3268
|
+
*/
|
|
3269
|
+
interface supabase extends Instrumentation {}
|
|
3270
|
+
|
|
3244
3271
|
/**
|
|
3245
3272
|
* This plugin automatically instruments the
|
|
3246
3273
|
* [tedious](https://github.com/tediousjs/tedious/) module.
|
|
@@ -3686,6 +3713,9 @@ declare namespace tracer {
|
|
|
3686
3713
|
*/
|
|
3687
3714
|
experiments: Experiments,
|
|
3688
3715
|
|
|
3716
|
+
/** Prompt Management API. */
|
|
3717
|
+
prompts: Prompts,
|
|
3718
|
+
|
|
3689
3719
|
/**
|
|
3690
3720
|
* Enable LLM Observability tracing.
|
|
3691
3721
|
*
|
|
@@ -3846,9 +3876,181 @@ declare namespace tracer {
|
|
|
3846
3876
|
flush (): void
|
|
3847
3877
|
}
|
|
3848
3878
|
|
|
3879
|
+
interface Prompts {
|
|
3880
|
+
/** Resolve an exact, environment-targeted, or latest managed prompt. */
|
|
3881
|
+
getPrompt (promptId: string, options?: GetPromptOptions): Promise<ManagedPrompt>
|
|
3882
|
+
/** Refresh the prompt selected by the current environment. */
|
|
3883
|
+
refreshPrompt (promptId: string): Promise<ManagedPrompt | undefined>
|
|
3884
|
+
/** Clear the in-memory and/or persistent prompt caches. */
|
|
3885
|
+
clearPromptCache (options?: ClearPromptCacheOptions): void
|
|
3886
|
+
/** Create a text or chat prompt and its first version. */
|
|
3887
|
+
createPrompt (
|
|
3888
|
+
promptId: string,
|
|
3889
|
+
template: string | PromptTemplateItem[],
|
|
3890
|
+
options?: CreatePromptOptions
|
|
3891
|
+
): Promise<PromptResponse>
|
|
3892
|
+
/** Add a text or chat version to an existing prompt. */
|
|
3893
|
+
createPromptVersion (
|
|
3894
|
+
promptId: string,
|
|
3895
|
+
template: string | PromptTemplateItem[],
|
|
3896
|
+
options?: CreatePromptVersionOptions
|
|
3897
|
+
): Promise<PromptVersionResponse>
|
|
3898
|
+
/** Update prompt metadata. */
|
|
3899
|
+
updatePrompt (promptId: string, options: UpdatePromptOptions): Promise<PromptResponse>
|
|
3900
|
+
/** Update prompt-version metadata or environment assignments. */
|
|
3901
|
+
updatePromptVersion (
|
|
3902
|
+
promptId: string,
|
|
3903
|
+
version: number,
|
|
3904
|
+
options: UpdatePromptVersionOptions
|
|
3905
|
+
): Promise<PromptVersionResponse>
|
|
3906
|
+
/** Delete a prompt. */
|
|
3907
|
+
deletePrompt (promptId: string): Promise<DeletedPromptResponse>
|
|
3908
|
+
/** List prompts. */
|
|
3909
|
+
listPrompts (): Promise<PromptResponse[]>
|
|
3910
|
+
/** List versions for a prompt. */
|
|
3911
|
+
listPromptVersions (promptId: string): Promise<PromptVersionResponse[]>
|
|
3912
|
+
}
|
|
3913
|
+
|
|
3914
|
+
interface PromptTemplateMessage {
|
|
3915
|
+
role: string,
|
|
3916
|
+
content: string
|
|
3917
|
+
}
|
|
3918
|
+
|
|
3919
|
+
/** Provider fields on expanded messages; authored templates remain text-only. */
|
|
3920
|
+
interface FormattedPromptMessage extends PromptTemplateMessage {
|
|
3921
|
+
// The inherited content type stays string for compatibility; tool-only payloads can omit it or contain null.
|
|
3922
|
+
tool_calls?: PromptToolCall[] | null,
|
|
3923
|
+
tool_results?: PromptToolResult[] | null,
|
|
3924
|
+
tool_call_id?: string | null
|
|
3925
|
+
}
|
|
3926
|
+
|
|
3927
|
+
interface PromptToolCall {
|
|
3928
|
+
id?: string | null,
|
|
3929
|
+
type?: string | null,
|
|
3930
|
+
tool_id?: string | null,
|
|
3931
|
+
name?: string | null,
|
|
3932
|
+
arguments?: unknown,
|
|
3933
|
+
function?: {
|
|
3934
|
+
name: string,
|
|
3935
|
+
arguments: string
|
|
3936
|
+
} | null
|
|
3937
|
+
}
|
|
3938
|
+
|
|
3939
|
+
interface PromptToolResult {
|
|
3940
|
+
id?: string | null,
|
|
3941
|
+
type?: string | null,
|
|
3942
|
+
tool_id?: string | null,
|
|
3943
|
+
name?: string | null,
|
|
3944
|
+
result?: unknown
|
|
3945
|
+
}
|
|
3946
|
+
|
|
3947
|
+
interface PromptMessagePlaceholder {
|
|
3948
|
+
type: 'placeholder',
|
|
3949
|
+
name: string
|
|
3950
|
+
}
|
|
3951
|
+
|
|
3952
|
+
type PromptTemplateItem = PromptTemplateMessage | PromptMessagePlaceholder
|
|
3953
|
+
|
|
3954
|
+
type PromptFallbackValue =
|
|
3955
|
+
| string
|
|
3956
|
+
| PromptTemplateItem[]
|
|
3957
|
+
| { template: string | PromptTemplateItem[], version?: string, config?: Record<string, JSONType> }
|
|
3958
|
+
type PromptFallback = PromptFallbackValue | (() => PromptFallbackValue)
|
|
3959
|
+
|
|
3960
|
+
interface GetPromptOptions {
|
|
3961
|
+
version?: number,
|
|
3962
|
+
fallback?: PromptFallback,
|
|
3963
|
+
targetingKey?: string,
|
|
3964
|
+
attributes?: Record<string, string | number | boolean>
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3967
|
+
interface ClearPromptCacheOptions {
|
|
3968
|
+
hot?: boolean,
|
|
3969
|
+
warm?: boolean
|
|
3970
|
+
}
|
|
3971
|
+
|
|
3972
|
+
interface CreatePromptOptions {
|
|
3973
|
+
title?: string,
|
|
3974
|
+
description?: string,
|
|
3975
|
+
userVersion?: string,
|
|
3976
|
+
envIds?: string[],
|
|
3977
|
+
config?: Record<string, JSONType>
|
|
3978
|
+
}
|
|
3979
|
+
|
|
3980
|
+
interface CreatePromptVersionOptions {
|
|
3981
|
+
description?: string,
|
|
3982
|
+
userVersion?: string,
|
|
3983
|
+
envIds?: string[],
|
|
3984
|
+
config?: Record<string, JSONType>
|
|
3985
|
+
}
|
|
3986
|
+
|
|
3987
|
+
interface UpdatePromptOptions {
|
|
3988
|
+
title?: string,
|
|
3989
|
+
description?: string
|
|
3990
|
+
}
|
|
3991
|
+
|
|
3992
|
+
interface UpdatePromptVersionOptions {
|
|
3993
|
+
description?: string,
|
|
3994
|
+
envIds?: string[]
|
|
3995
|
+
}
|
|
3996
|
+
|
|
3997
|
+
// Preserve released output types; placeholder entries and null/omitted tool content are not fully described here.
|
|
3998
|
+
interface ManagedPrompt {
|
|
3999
|
+
readonly id: string,
|
|
4000
|
+
readonly version: string,
|
|
4001
|
+
readonly source: 'registry' | 'cache' | 'fallback' | 'ff' | 'resolve',
|
|
4002
|
+
readonly template: string | ReadonlyArray<Readonly<PromptTemplateMessage>>,
|
|
4003
|
+
readonly config: Readonly<Record<string, ReadonlyJSONType>>,
|
|
4004
|
+
readonly promptUuid?: string,
|
|
4005
|
+
readonly promptVersionUuid?: string,
|
|
4006
|
+
format (variables?: Record<string, unknown>): string | FormattedPromptMessage[]
|
|
4007
|
+
toAnnotation (variables?: Record<string, unknown>): Prompt
|
|
4008
|
+
}
|
|
4009
|
+
|
|
4010
|
+
interface PromptResponse {
|
|
4011
|
+
id?: string,
|
|
4012
|
+
prompt_id?: string,
|
|
4013
|
+
title?: string,
|
|
4014
|
+
description?: string,
|
|
4015
|
+
created_at?: string,
|
|
4016
|
+
source?: string,
|
|
4017
|
+
num_versions?: number,
|
|
4018
|
+
in_registry?: boolean,
|
|
4019
|
+
created_from?: string,
|
|
4020
|
+
author?: string,
|
|
4021
|
+
ml_app?: string,
|
|
4022
|
+
ml_apps?: string[],
|
|
4023
|
+
last_version_created_at?: string,
|
|
4024
|
+
extracted_from?: string,
|
|
4025
|
+
config?: Record<string, JSONType>
|
|
4026
|
+
}
|
|
4027
|
+
|
|
4028
|
+
interface PromptVersionResponse {
|
|
4029
|
+
id?: string,
|
|
4030
|
+
prompt_uuid?: string,
|
|
4031
|
+
prompt_id?: string,
|
|
4032
|
+
template?: string | PromptTemplateMessage[],
|
|
4033
|
+
version?: number,
|
|
4034
|
+
user_version?: string,
|
|
4035
|
+
created_at?: string,
|
|
4036
|
+
version_created_at?: string,
|
|
4037
|
+
author?: string,
|
|
4038
|
+
description?: string,
|
|
4039
|
+
ml_app?: string,
|
|
4040
|
+
config?: Record<string, JSONType>
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
interface DeletedPromptResponse {
|
|
4044
|
+
id?: string,
|
|
4045
|
+
prompt_id?: string,
|
|
4046
|
+
deleted_at?: string
|
|
4047
|
+
}
|
|
4048
|
+
|
|
3849
4049
|
/** JSON-serializable value accepted by LLMObs Experiments. */
|
|
3850
4050
|
type JSONType = string | number | boolean | null | JSONType[] | { [key: string]: JSONType }
|
|
3851
4051
|
|
|
4052
|
+
type ReadonlyJSONType = string | number | boolean | null | ReadonlyArray<ReadonlyJSONType> | { readonly [key: string]: ReadonlyJSONType }
|
|
4053
|
+
|
|
3852
4054
|
/**
|
|
3853
4055
|
* A task run over each dataset record during an experiment.
|
|
3854
4056
|
*/
|
|
@@ -4449,6 +4651,12 @@ declare namespace tracer {
|
|
|
4449
4651
|
* A template string or chat message template list.
|
|
4450
4652
|
*/
|
|
4451
4653
|
template?: string | Message[]
|
|
4654
|
+
|
|
4655
|
+
/** Internal Datadog prompt identity. */
|
|
4656
|
+
promptUuid?: string,
|
|
4657
|
+
|
|
4658
|
+
/** Internal Datadog prompt-version identity. */
|
|
4659
|
+
promptVersionUuid?: string
|
|
4452
4660
|
}
|
|
4453
4661
|
|
|
4454
4662
|
interface ToolDefinition {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/dd-trace",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.18.0-depup.0",
|
|
4
4
|
"description": "Datadog APM tracing client for JavaScript (with updated dependencies)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"lint:inspect": "npx @eslint/config-inspector@latest",
|
|
27
27
|
"lint:codeowners": "codeowners-audit",
|
|
28
28
|
"lint:editorconfig": "docker build -q -t ec .github/editorconfig-checker && docker run --rm --volume=$PWD:/check ec",
|
|
29
|
+
"release:merge-proposal": "node scripts/release/merge-proposal.js",
|
|
29
30
|
"release:proposal": "node scripts/release/proposal",
|
|
30
31
|
"services": "node ./scripts/install_plugin_modules && node packages/dd-trace/test/setup/services",
|
|
31
32
|
"test": "echo '\nError: The root \"npm test\" command is intentionally disabled.\n\nInstead, run specific test suites:\n - npm run test:trace:core\n - npm run test:appsec\n - etc.\n\nOr run individual test files:\n npx mocha path/to/test.spec.js\n\nSee CONTRIBUTING.md (Testing section) for more details.\n' && exit 1",
|
|
@@ -103,8 +104,8 @@
|
|
|
103
104
|
"test:integration:selenium": "mocha --timeout 60000 \"integration-tests/selenium/*.spec.js\"",
|
|
104
105
|
"test:integration:selenium:coverage": "node ./integration-tests/coverage/run-suite.js --timeout 60000 \"integration-tests/selenium/*.spec.js\"",
|
|
105
106
|
"test:integration:test-optimization:helpers": "mocha \"integration-tests/cypress/*dependencies.spec.js\" \"integration-tests/jest/*dependencies.spec.js\" \"integration-tests/playwright/version*.spec.js\"",
|
|
106
|
-
"test:integration:webdriverio": "mocha --timeout 60000 \"integration-tests/webdriverio
|
|
107
|
-
"test:integration:webdriverio:coverage": "node ./integration-tests/coverage/run-suite.js --timeout 60000 \"integration-tests/webdriverio
|
|
107
|
+
"test:integration:webdriverio": "mocha --timeout 60000 \"integration-tests/webdriverio/${SPEC:-*}.spec.js\"",
|
|
108
|
+
"test:integration:webdriverio:coverage": "node ./integration-tests/coverage/run-suite.js --timeout 60000 \"integration-tests/webdriverio/${SPEC:-*}.spec.js\"",
|
|
108
109
|
"test:integration:vitest": "mocha --timeout 60000 \"integration-tests/vitest/${SPEC:-vitest*}.spec.js\"",
|
|
109
110
|
"test:integration:vitest:coverage": "node ./integration-tests/coverage/run-suite.js --timeout 60000 \"integration-tests/vitest/${SPEC:-vitest*}.spec.js\"",
|
|
110
111
|
"test:integration:testopt": "mocha --timeout 120000 \"integration-tests/ci-visibility/*.spec.js\"",
|
|
@@ -197,7 +198,7 @@
|
|
|
197
198
|
"@datadog/native-appsec": "11.0.2",
|
|
198
199
|
"@datadog/native-iast-taint-tracking": "4.2.1",
|
|
199
200
|
"@datadog/native-metrics": "4.0.0",
|
|
200
|
-
"@datadog/pprof": "5.
|
|
201
|
+
"@datadog/pprof": "5.19.0",
|
|
201
202
|
"@datadog/wasm-js-rewriter": "5.0.4",
|
|
202
203
|
"@opentelemetry/api": ">=1.0.0 <1.10.0",
|
|
203
204
|
"@opentelemetry/api-logs": "<1.0.0",
|
|
@@ -206,11 +207,11 @@
|
|
|
206
207
|
"devDependencies": {
|
|
207
208
|
"@actions/core": "^3.0.1",
|
|
208
209
|
"@actions/github": "^9.1.1",
|
|
209
|
-
"@babel/helpers": "^8.0.
|
|
210
|
+
"@babel/helpers": "^8.0.5",
|
|
210
211
|
"@eslint/eslintrc": "^3.3.7",
|
|
211
212
|
"@eslint/js": "^10.0.1",
|
|
212
213
|
"@eslint/plugin-kit": "^0.7.3",
|
|
213
|
-
"@datadog/openfeature-node-server": "2.
|
|
214
|
+
"@datadog/openfeature-node-server": "2.3.0",
|
|
214
215
|
"@msgpack/msgpack": "^3.1.3",
|
|
215
216
|
"@openfeature/core": "^1.12.0",
|
|
216
217
|
"@openfeature/server-sdk": "~1.23.0",
|
|
@@ -223,18 +224,18 @@
|
|
|
223
224
|
"axios": "^1.20.0",
|
|
224
225
|
"benchmark": "^2.1.4",
|
|
225
226
|
"body-parser": "^2.3.0",
|
|
226
|
-
"bun": "1.4.
|
|
227
|
+
"bun": "1.4.2",
|
|
227
228
|
"c8": "^12.0.0",
|
|
228
229
|
"codeowners-audit": "^2.9.0",
|
|
229
|
-
"eslint": "^10.
|
|
230
|
-
"eslint-plugin-cypress": "^7.0.
|
|
230
|
+
"eslint": "^10.10.0",
|
|
231
|
+
"eslint-plugin-cypress": "^7.0.2",
|
|
231
232
|
"eslint-plugin-import-x": "^4.16.2",
|
|
232
|
-
"eslint-plugin-jsdoc": "^64.
|
|
233
|
+
"eslint-plugin-jsdoc": "^64.5.2",
|
|
233
234
|
"eslint-plugin-mocha": "^12.0.2",
|
|
234
235
|
"eslint-plugin-n": "^18.3.0",
|
|
235
236
|
"eslint-plugin-promise": "^7.3.0",
|
|
236
|
-
"eslint-plugin-regexp": "^3.
|
|
237
|
-
"eslint-plugin-sonarjs": "^4.2.
|
|
237
|
+
"eslint-plugin-regexp": "^3.3.0",
|
|
238
|
+
"eslint-plugin-sonarjs": "^4.2.1",
|
|
238
239
|
"eslint-plugin-unicorn": "^74.0.0",
|
|
239
240
|
"express": "^5.1.0",
|
|
240
241
|
"glob": "^10.4.5",
|
|
@@ -245,12 +246,12 @@
|
|
|
245
246
|
"istanbul-lib-report": "^3.0.0",
|
|
246
247
|
"istanbul-reports": "^3.0.2",
|
|
247
248
|
"jsonc-parser": "^3.3.1",
|
|
248
|
-
"jszip": "^3.10.
|
|
249
|
+
"jszip": "^3.10.2",
|
|
249
250
|
"minimatch": "^10.2.6",
|
|
250
251
|
"mocha": "^11.8.0",
|
|
251
252
|
"mocha-junit-reporter": "^2.2.1",
|
|
252
|
-
"mocha-multi-reporters": "^1.5.
|
|
253
|
-
"multer": "^2.
|
|
253
|
+
"mocha-multi-reporters": "^1.5.2",
|
|
254
|
+
"multer": "^2.4.0",
|
|
254
255
|
"nock": "^14.0.17",
|
|
255
256
|
"node-preload": "^0.2.1",
|
|
256
257
|
"nyc": "^18.0.0",
|
|
@@ -267,15 +268,15 @@
|
|
|
267
268
|
"typescript": "^6.0.3",
|
|
268
269
|
"v8-to-istanbul": "^9.0.0",
|
|
269
270
|
"workerpool": "^10.0.3",
|
|
270
|
-
"yaml": "^2.9.
|
|
271
|
+
"yaml": "^2.9.1",
|
|
271
272
|
"yarn-deduplicate": "^6.0.2"
|
|
272
273
|
},
|
|
273
274
|
"depup": {
|
|
274
275
|
"changes": {},
|
|
275
276
|
"depsUpdated": 0,
|
|
276
277
|
"originalPackage": "dd-trace",
|
|
277
|
-
"originalVersion": "6.
|
|
278
|
-
"processedAt": "2026-09-
|
|
278
|
+
"originalVersion": "6.18.0",
|
|
279
|
+
"processedAt": "2026-09-29T16:11:20.454Z",
|
|
279
280
|
"smokeTest": "passed"
|
|
280
281
|
}
|
|
281
282
|
}
|
|
@@ -78,7 +78,6 @@ function isBareSpecifier (specifier) {
|
|
|
78
78
|
/**
|
|
79
79
|
* @param {string} modulePath
|
|
80
80
|
* @param {string} format
|
|
81
|
-
* @returns {string}
|
|
82
81
|
*/
|
|
83
82
|
function getModuleFormat (modulePath, format) {
|
|
84
83
|
if (modulePath.endsWith('.mts')) return 'module-typescript'
|
|
@@ -287,7 +286,6 @@ async function processModuleWithResolver (
|
|
|
287
286
|
* @param {string} fullPathToModule File to analize
|
|
288
287
|
* @param {string} [modulePackageJsonPath] Path of the package.json
|
|
289
288
|
* @param {object} [packageJson] The content of the module package.json
|
|
290
|
-
* @returns {boolean}
|
|
291
289
|
*/
|
|
292
290
|
function isESMFile (fullPathToModule, modulePackageJsonPath, packageJson = {}) {
|
|
293
291
|
if (fullPathToModule.endsWith('.mjs') || fullPathToModule.endsWith('.mts')) return true
|