dd-trace 6.15.0 → 6.17.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 +15 -0
- 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 +4 -8
- 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/package-check.js +4 -1
- 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 +1 -2
- package/ci/test-optimization-validation/source-text.js +0 -3
- package/ci/vitest-no-worker-init-setup.mjs +41 -16
- package/index.d.ts +169 -0
- package/next.d.ts +27 -0
- package/next.js +3 -0
- package/package.json +28 -23
- package/packages/datadog-esbuild/index.js +14 -1
- package/packages/datadog-esbuild/src/resolver.js +284 -0
- package/packages/datadog-esbuild/src/utils.js +162 -120
- package/packages/datadog-instrumentations/src/aerospike.js +28 -6
- package/packages/datadog-instrumentations/src/ai.js +39 -97
- package/packages/datadog-instrumentations/src/anthropic.js +76 -134
- package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js.js +1 -3
- package/packages/datadog-instrumentations/src/aws-sdk.js +0 -2
- package/packages/datadog-instrumentations/src/azure-cosmos.js +1 -1
- package/packages/datadog-instrumentations/src/azure-durable-functions.js +23 -9
- package/packages/datadog-instrumentations/src/azure-functions.js +48 -0
- package/packages/datadog-instrumentations/src/bullmq.js +1 -1
- package/packages/datadog-instrumentations/src/claude-agent-sdk.js +1 -3
- package/packages/datadog-instrumentations/src/console.js +97 -0
- package/packages/datadog-instrumentations/src/cucumber.js +72 -12
- package/packages/datadog-instrumentations/src/cypress-config.js +0 -23
- package/packages/datadog-instrumentations/src/dd-trace-api.js +2 -2
- package/packages/datadog-instrumentations/src/graphql.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/bundler-register.js +39 -14
- package/packages/datadog-instrumentations/src/helpers/channel.js +0 -2
- package/packages/datadog-instrumentations/src/helpers/graphql-jit-runtime.js +0 -5
- package/packages/datadog-instrumentations/src/helpers/hooks.js +8 -0
- package/packages/datadog-instrumentations/src/helpers/instrument.js +25 -8
- package/packages/datadog-instrumentations/src/helpers/instrumentation-utils.js +69 -0
- package/packages/datadog-instrumentations/src/helpers/pool-acquire.js +0 -6
- package/packages/datadog-instrumentations/src/helpers/register.js +13 -64
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +109 -29
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentation-registry.js +39 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/azure-durable-functions.js +17 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +3 -16
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/playwright.js +12 -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 +6 -7
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +17 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms/postgres.js +388 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +99 -75
- package/packages/datadog-instrumentations/src/helpers/router-helper.js +0 -1
- package/packages/datadog-instrumentations/src/jest.js +141 -51
- package/packages/datadog-instrumentations/src/knex.js +0 -1
- package/packages/datadog-instrumentations/src/langchain.js +1 -1
- package/packages/datadog-instrumentations/src/langgraph.js +1 -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/mercurius.js +1 -1
- package/packages/datadog-instrumentations/src/mocha/common.js +0 -1
- package/packages/datadog-instrumentations/src/mocha/main.js +22 -25
- 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/modelcontextprotocol-sdk.js +1 -1
- package/packages/datadog-instrumentations/src/mysql2.js +0 -2
- package/packages/datadog-instrumentations/src/openai-agents.js +1 -1
- 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 +97 -80
- package/packages/datadog-instrumentations/src/oracledb.js +9 -3
- package/packages/datadog-instrumentations/src/playwright-reporter.js +3 -16
- package/packages/datadog-instrumentations/src/playwright.js +238 -55
- package/packages/datadog-instrumentations/src/postgres.js +7 -0
- 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/vitest-main-no-worker-init.js +18 -18
- package/packages/datadog-instrumentations/src/vitest-main.js +37 -17
- package/packages/datadog-instrumentations/src/vitest-util.js +7 -1
- package/packages/datadog-instrumentations/src/vitest-worker.js +56 -23
- package/packages/datadog-instrumentations/src/webdriverio.js +23 -42
- package/packages/datadog-instrumentations/src/ws.js +0 -1
- 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 +7 -2
- 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-cosmos/src/index.js +1 -1
- package/packages/datadog-plugin-azure-durable-functions/src/index.js +95 -1
- package/packages/datadog-plugin-cucumber/src/index.js +10 -0
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +171 -75
- package/packages/datadog-plugin-cypress/src/finalization.js +0 -3
- 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-google-cloud-pubsub/src/consumer.js +2 -24
- package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-push-subscription.js +2 -36
- package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-request-context.js +31 -0
- package/packages/datadog-plugin-graphql/src/resolve-error.js +32 -11
- package/packages/datadog-plugin-graphql/src/utils.js +0 -5
- package/packages/datadog-plugin-jest/src/index.js +13 -0
- package/packages/datadog-plugin-kafkajs/src/producer.js +0 -1
- package/packages/datadog-plugin-mocha/src/index.js +39 -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 +76 -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 +10 -0
- package/packages/datadog-plugin-ws/src/util.js +0 -4
- package/packages/datadog-turbopack/index.js +206 -0
- package/packages/datadog-turbopack/src/constants.js +5 -0
- package/packages/datadog-turbopack/src/loader.js +484 -0
- package/packages/datadog-webpack/src/loader.js +0 -1
- 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 +3 -2
- package/packages/dd-trace/src/aiguard/integrations/anthropic.js +53 -25
- package/packages/dd-trace/src/aiguard/integrations/evaluate.js +49 -25
- package/packages/dd-trace/src/aiguard/integrations/index.js +4 -3
- package/packages/dd-trace/src/aiguard/integrations/openai.js +132 -29
- package/packages/dd-trace/src/aiguard/integrations/vercel-ai.js +116 -42
- 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 +29 -2
- package/packages/dd-trace/src/aiguard/messages/vercel-ai.js +25 -0
- 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-analyzers/url-sensitive-analyzer.js +2 -2
- 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/telemetry/api_security.js +1 -3
- package/packages/dd-trace/src/appsec/telemetry/common.js +4 -0
- package/packages/dd-trace/src/appsec/telemetry/index.js +23 -5
- package/packages/dd-trace/src/appsec/telemetry/rasp.js +1 -20
- package/packages/dd-trace/src/appsec/telemetry/user.js +1 -3
- package/packages/dd-trace/src/appsec/telemetry/waf.js +1 -20
- 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 +74 -66
- package/packages/dd-trace/src/config/helper.js +9 -2
- package/packages/dd-trace/src/config/index.js +44 -29
- 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 +146 -9
- 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 +76 -17
- package/packages/dd-trace/src/debugger/devtools_client/config.js +2 -0
- 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 +34 -8
- package/packages/dd-trace/src/debugger/devtools_client/send.js +40 -14
- 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-pruner.js +0 -3
- package/packages/dd-trace/src/debugger/devtools_client/status.js +20 -6
- package/packages/dd-trace/src/debugger/guardrail-metrics.js +167 -0
- package/packages/dd-trace/src/debugger/index.js +50 -2
- 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/discovery.js +3 -5
- package/packages/dd-trace/src/evp_proxy/path.js +11 -4
- 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/docker.js +4 -1
- package/packages/dd-trace/src/exporters/common/final-flush-request-tracker.js +0 -6
- package/packages/dd-trace/src/exporters/common/proxy.js +3 -0
- package/packages/dd-trace/src/exporters/common/request.js +1 -0
- package/packages/dd-trace/src/exporters/common/url.js +0 -2
- 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 +639 -0
- package/packages/dd-trace/src/llmobs/prompts/noop.js +29 -0
- package/packages/dd-trace/src/llmobs/prompts/prompt.js +92 -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 +30 -7
- 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/encoding.js +0 -2
- package/packages/dd-trace/src/openfeature/eval-metrics-hook.js +0 -1
- package/packages/dd-trace/src/openfeature/index.js +0 -4
- 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 +0 -6
- package/packages/dd-trace/src/openfeature/writers/exposures.js +0 -5
- package/packages/dd-trace/src/openfeature/writers/util.js +0 -4
- 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/index.js +1 -1
- package/packages/dd-trace/src/opentelemetry/metrics/meter_provider.js +4 -4
- 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 +103 -35
- package/packages/dd-trace/src/opentelemetry/metrics/time.js +0 -1
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +36 -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/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 +9 -3
- package/packages/dd-trace/src/plugins/ci_plugin.js +0 -1
- package/packages/dd-trace/src/plugins/database.js +2 -6
- package/packages/dd-trace/src/plugins/index.js +8 -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 +25 -21
- 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 +21 -45
- 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/telemetry.js +4 -1
- package/packages/dd-trace/src/util.js +13 -1
- package/vendor/dist/@datadog/openfeature-node-server/index.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/claude-agent-sdk/utils.js +0 -10
|
@@ -119,7 +119,6 @@ addHook({
|
|
|
119
119
|
* Returns whether this browser can preload and clean correlation across every browsing context.
|
|
120
120
|
*
|
|
121
121
|
* @param {object} browser
|
|
122
|
-
* @returns {boolean}
|
|
123
122
|
*/
|
|
124
123
|
function canCorrelateRumBrowser (browser) {
|
|
125
124
|
return browser?.isBidi &&
|
|
@@ -132,7 +131,6 @@ function canCorrelateRumBrowser (browser) {
|
|
|
132
131
|
* Releases retained state when a WebDriver session ends.
|
|
133
132
|
*
|
|
134
133
|
* @param {object} browser
|
|
135
|
-
* @returns {void}
|
|
136
134
|
*/
|
|
137
135
|
function releaseRumBrowser (browser) {
|
|
138
136
|
rumBrowsers.delete(browser)
|
|
@@ -152,7 +150,6 @@ function releaseRumBrowser (browser) {
|
|
|
152
150
|
* Retains a browser and watches for WebDriver's deleteSession result event.
|
|
153
151
|
*
|
|
154
152
|
* @param {object} browser
|
|
155
|
-
* @returns {void}
|
|
156
153
|
*/
|
|
157
154
|
function retainRumBrowser (browser) {
|
|
158
155
|
rumBrowsers.add(browser)
|
|
@@ -171,7 +168,6 @@ function retainRumBrowser (browser) {
|
|
|
171
168
|
* Returns whether RUM is inactive because its configured sampling rate is below 100%.
|
|
172
169
|
*
|
|
173
170
|
* @param {{isRumActive: boolean, isRumInstrumented: boolean, rumSamplingRate: number|null}} rumState
|
|
174
|
-
* @returns {boolean}
|
|
175
171
|
*/
|
|
176
172
|
function isRumSampledOut (rumState) {
|
|
177
173
|
return rumState.isRumInstrumented && !rumState.isRumActive &&
|
|
@@ -652,7 +648,6 @@ function handleRumProtocolCommand (command) {
|
|
|
652
648
|
* Wraps only WebDriver commands that need to wait for RUM work before their request starts.
|
|
653
649
|
*
|
|
654
650
|
* @param {{arguments?: unknown[], result?: Function}} context
|
|
655
|
-
* @returns {void}
|
|
656
651
|
*/
|
|
657
652
|
function wrapRumProtocolCommand (context) {
|
|
658
653
|
const command = context.arguments?.[2]?.command
|
|
@@ -675,7 +670,6 @@ function wrapRumProtocolCommand (context) {
|
|
|
675
670
|
* A tracing-channel start subscriber is synchronous and cannot delay the static async handler itself.
|
|
676
671
|
*
|
|
677
672
|
* @param {{result?: {_bidiHandler?: {value?: object}}}} context
|
|
678
|
-
* @returns {void}
|
|
679
673
|
*/
|
|
680
674
|
function wrapRumBidiNavigation (context) {
|
|
681
675
|
const bidiHandler = context.result?._bidiHandler?.value
|
|
@@ -844,7 +838,6 @@ async function retryRumBrowsers (testExecutionId) {
|
|
|
844
838
|
* Delays BiDi navigation until its RUM correlation preload is installed.
|
|
845
839
|
*
|
|
846
840
|
* @param {{rumPreloadCallback?: () => Promise<void>}} context
|
|
847
|
-
* @returns {void}
|
|
848
841
|
*/
|
|
849
842
|
function waitForRumNavigationStart (context) {
|
|
850
843
|
if (!rumPageNavigateCh.hasSubscribers) return
|
|
@@ -860,7 +853,6 @@ function waitForRumNavigationStart (context) {
|
|
|
860
853
|
* }} context
|
|
861
854
|
* @param {() => Promise<unknown>} operation
|
|
862
855
|
* @param {boolean} [waitForResolve]
|
|
863
|
-
* @returns {void}
|
|
864
856
|
*/
|
|
865
857
|
function setRumWaitCallbacks (context, operation, waitForResolve = true) {
|
|
866
858
|
const waitForOperation = onDone => operation().then(onDone, onDone)
|
|
@@ -872,7 +864,6 @@ function setRumWaitCallbacks (context, operation, waitForResolve = true) {
|
|
|
872
864
|
* Delays URL completion until RUM detection and correlation settle.
|
|
873
865
|
*
|
|
874
866
|
* @param {object} context
|
|
875
|
-
* @returns {void}
|
|
876
867
|
*/
|
|
877
868
|
function waitForRumNavigation (context) {
|
|
878
869
|
if (!rumPageNavigateCh.hasSubscribers) return
|
|
@@ -884,7 +875,6 @@ function waitForRumNavigation (context) {
|
|
|
884
875
|
* Correlation remains active until every afterEach hook has run.
|
|
885
876
|
*
|
|
886
877
|
* @param {{arguments?: unknown[]}} context
|
|
887
|
-
* @returns {void}
|
|
888
878
|
*/
|
|
889
879
|
function waitForRumCleanup (context) {
|
|
890
880
|
const type = context.arguments?.[1]
|
|
@@ -904,7 +894,6 @@ function waitForRumCleanup (context) {
|
|
|
904
894
|
* Correlation remains active until every afterEach hook has run.
|
|
905
895
|
*
|
|
906
896
|
* @param {{arguments?: unknown[]}} context
|
|
907
|
-
* @returns {void}
|
|
908
897
|
*/
|
|
909
898
|
function waitForFailedRumCleanup (context) {
|
|
910
899
|
const type = context.arguments?.[1]
|
|
@@ -928,7 +917,6 @@ function waitForFailedRumCleanup (context) {
|
|
|
928
917
|
* Prepares retained RUM state before the next test or non-afterEach hook starts.
|
|
929
918
|
*
|
|
930
919
|
* @param {{arguments?: unknown[], rumCleanupCallback?: () => Promise<void>}} context
|
|
931
|
-
* @returns {void}
|
|
932
920
|
*/
|
|
933
921
|
function waitForRumTestStart (context) {
|
|
934
922
|
const type = context.arguments?.[1]
|
|
@@ -1014,12 +1002,14 @@ function waitForRumTestStart (context) {
|
|
|
1014
1002
|
*/
|
|
1015
1003
|
function createWorkerConfiguration () {
|
|
1016
1004
|
return {
|
|
1005
|
+
dynamicAtrBuckets: undefined,
|
|
1017
1006
|
earlyFlakeDetectionFaultyThreshold: 30,
|
|
1018
1007
|
earlyFlakeDetectionRetryPolicy: EMPTY_EFD_RETRY_POLICY,
|
|
1019
1008
|
flakyTestRetriesCount: 0,
|
|
1020
1009
|
isCodeCoverageEnabled: false,
|
|
1021
1010
|
isCoverageReportUploadEnabled: false,
|
|
1022
1011
|
isDiEnabled: false,
|
|
1012
|
+
isDynamicAtrEnabled: false,
|
|
1023
1013
|
isEarlyFlakeDetectionEnabled: false,
|
|
1024
1014
|
isFlakyTestRetriesEnabled: false,
|
|
1025
1015
|
isImpactedTestsEnabled: false,
|
|
@@ -1046,7 +1036,6 @@ function createWorkerConfiguration () {
|
|
|
1046
1036
|
* resolveCallback?: (onDone: () => void) => void,
|
|
1047
1037
|
* rejectCallback?: (onDone: () => void) => void
|
|
1048
1038
|
* }} context
|
|
1049
|
-
* @returns {void}
|
|
1050
1039
|
*/
|
|
1051
1040
|
function initializeJasmineWorker (adapter, context) {
|
|
1052
1041
|
if (!isWebdriverioWorker) {
|
|
@@ -1061,7 +1050,6 @@ function initializeJasmineWorker (adapter, context) {
|
|
|
1061
1050
|
* Publishes run-level failures that are absent from suiteDone.
|
|
1062
1051
|
*
|
|
1063
1052
|
* @param {object} result
|
|
1064
|
-
* @returns {void}
|
|
1065
1053
|
*/
|
|
1066
1054
|
jasmineDone (result) {
|
|
1067
1055
|
jasmineDoneCh.publish({ result })
|
|
@@ -1073,7 +1061,6 @@ function initializeJasmineWorker (adapter, context) {
|
|
|
1073
1061
|
* Waits until the coordinator has started this worker's parent spans.
|
|
1074
1062
|
*
|
|
1075
1063
|
* @param {() => void} onDone
|
|
1076
|
-
* @returns {void}
|
|
1077
1064
|
*/
|
|
1078
1065
|
const waitForCoordinator = onDone => {
|
|
1079
1066
|
const requestId = `${process.pid}-${++jasmineWorkerRequestId}`
|
|
@@ -1083,7 +1070,6 @@ function initializeJasmineWorker (adapter, context) {
|
|
|
1083
1070
|
* Releases Jasmine initialization exactly once.
|
|
1084
1071
|
*
|
|
1085
1072
|
* @param {object} [configuration]
|
|
1086
|
-
* @returns {void}
|
|
1087
1073
|
*/
|
|
1088
1074
|
function finish (configuration = createWorkerConfiguration()) {
|
|
1089
1075
|
if (finished) {
|
|
@@ -1107,7 +1093,6 @@ function initializeJasmineWorker (adapter, context) {
|
|
|
1107
1093
|
* Receives coordinator readiness for this worker.
|
|
1108
1094
|
*
|
|
1109
1095
|
* @param {object} message
|
|
1110
|
-
* @returns {void}
|
|
1111
1096
|
*/
|
|
1112
1097
|
function onMessage (message) {
|
|
1113
1098
|
if (message?.name === WORKER_READY_RESPONSE && message.content?.requestId === requestId) {
|
|
@@ -1190,7 +1175,6 @@ function getCoordinatorState (localRunner) {
|
|
|
1190
1175
|
* Normalizes a WebdriverIO spec identifier to a filesystem path.
|
|
1191
1176
|
*
|
|
1192
1177
|
* @param {string} file
|
|
1193
|
-
* @returns {string}
|
|
1194
1178
|
*/
|
|
1195
1179
|
function normalizeFile (file) {
|
|
1196
1180
|
return file.startsWith('file://') ? fileURLToPath(file) : file
|
|
@@ -1201,7 +1185,6 @@ function normalizeFile (file) {
|
|
|
1201
1185
|
*
|
|
1202
1186
|
* @param {CoordinatorState} state
|
|
1203
1187
|
* @param {string[]} files
|
|
1204
|
-
* @returns {void}
|
|
1205
1188
|
*/
|
|
1206
1189
|
function addScheduledFiles (state, files) {
|
|
1207
1190
|
for (const file of files) {
|
|
@@ -1214,7 +1197,6 @@ function addScheduledFiles (state, files) {
|
|
|
1214
1197
|
*
|
|
1215
1198
|
* @param {string|undefined} workerNodeOptions
|
|
1216
1199
|
* @param {string} launcherNodeOptions
|
|
1217
|
-
* @returns {boolean}
|
|
1218
1200
|
*/
|
|
1219
1201
|
function includesNodeOptions (workerNodeOptions, launcherNodeOptions) {
|
|
1220
1202
|
if (!workerNodeOptions) {
|
|
@@ -1240,7 +1222,6 @@ function includesNodeOptions (workerNodeOptions, launcherNodeOptions) {
|
|
|
1240
1222
|
* Starts the single test session owned by the WebdriverIO launcher.
|
|
1241
1223
|
*
|
|
1242
1224
|
* @param {CoordinatorState} state
|
|
1243
|
-
* @returns {void}
|
|
1244
1225
|
*/
|
|
1245
1226
|
function startSession (state) {
|
|
1246
1227
|
if (state.sessionStarted) {
|
|
@@ -1264,7 +1245,6 @@ function startSession (state) {
|
|
|
1264
1245
|
* Completes coordinator initialization and releases waiting workers.
|
|
1265
1246
|
*
|
|
1266
1247
|
* @param {CoordinatorState} state
|
|
1267
|
-
* @returns {void}
|
|
1268
1248
|
*/
|
|
1269
1249
|
function completeCoordinatorInitialization (state) {
|
|
1270
1250
|
if (state.initialized) {
|
|
@@ -1288,7 +1268,6 @@ function completeCoordinatorInitialization (state) {
|
|
|
1288
1268
|
* @param {CoordinatorState} state
|
|
1289
1269
|
* @param {import('node:diagnostics_channel').Channel} requestChannel
|
|
1290
1270
|
* @param {(response: object) => void} onDone
|
|
1291
|
-
* @returns {void}
|
|
1292
1271
|
*/
|
|
1293
1272
|
function requestCoordinatorData (state, requestChannel, onDone) {
|
|
1294
1273
|
if (!requestChannel.hasSubscribers) {
|
|
@@ -1320,7 +1299,6 @@ function getMochaFrameworkData (frameworkData) {
|
|
|
1320
1299
|
* Applies the worker configuration for an EFD session with faulty known-tests data.
|
|
1321
1300
|
*
|
|
1322
1301
|
* @param {object} configuration
|
|
1323
|
-
* @returns {void}
|
|
1324
1302
|
*/
|
|
1325
1303
|
function setEarlyFlakeDetectionFaulty (configuration) {
|
|
1326
1304
|
configuration.isEarlyFlakeDetectionEnabled = false
|
|
@@ -1333,7 +1311,6 @@ function setEarlyFlakeDetectionFaulty (configuration) {
|
|
|
1333
1311
|
*
|
|
1334
1312
|
* @param {CoordinatorState} state
|
|
1335
1313
|
* @param {object|undefined} response
|
|
1336
|
-
* @returns {void}
|
|
1337
1314
|
*/
|
|
1338
1315
|
function configureCoordinator (state, response) {
|
|
1339
1316
|
const { configuration } = state
|
|
@@ -1354,10 +1331,14 @@ function configureCoordinator (state, response) {
|
|
|
1354
1331
|
return
|
|
1355
1332
|
}
|
|
1356
1333
|
|
|
1334
|
+
configuration.dynamicAtrBuckets = libraryConfig.isDynamicAtrEnabled === true
|
|
1335
|
+
? libraryConfig.dynamicAtrBuckets
|
|
1336
|
+
: undefined
|
|
1357
1337
|
configuration.earlyFlakeDetectionFaultyThreshold = libraryConfig.earlyFlakeDetectionFaultyThreshold
|
|
1358
1338
|
configuration.earlyFlakeDetectionRetryPolicy = libraryConfig.earlyFlakeDetectionRetryPolicy ?? EMPTY_EFD_RETRY_POLICY
|
|
1359
1339
|
configuration.flakyTestRetriesCount = libraryConfig.flakyTestRetriesCount
|
|
1360
1340
|
configuration.isDiEnabled = libraryConfig.isDiEnabled
|
|
1341
|
+
configuration.isDynamicAtrEnabled = libraryConfig.isDynamicAtrEnabled === true
|
|
1361
1342
|
configuration.isEarlyFlakeDetectionEnabled = libraryConfig.isEarlyFlakeDetectionEnabled
|
|
1362
1343
|
configuration.isFlakyTestRetriesEnabled = libraryConfig.isFlakyTestRetriesEnabled
|
|
1363
1344
|
configuration.isImpactedTestsEnabled = libraryConfig.isImpactedTestsEnabled
|
|
@@ -1371,7 +1352,6 @@ function configureCoordinator (state, response) {
|
|
|
1371
1352
|
/**
|
|
1372
1353
|
* Completes initialization after all enabled requests settle.
|
|
1373
1354
|
*
|
|
1374
|
-
* @returns {void}
|
|
1375
1355
|
*/
|
|
1376
1356
|
function finishRequest () {
|
|
1377
1357
|
pendingRequests--
|
|
@@ -1430,7 +1410,6 @@ function configureCoordinator (state, response) {
|
|
|
1430
1410
|
*
|
|
1431
1411
|
* @param {CoordinatorState} state
|
|
1432
1412
|
* @param {(configuration: object) => void} [onDone]
|
|
1433
|
-
* @returns {void}
|
|
1434
1413
|
*/
|
|
1435
1414
|
function initializeCoordinator (state, onDone) {
|
|
1436
1415
|
if (state.initialized) {
|
|
@@ -1474,7 +1453,6 @@ function initializeCoordinator (state, onDone) {
|
|
|
1474
1453
|
*
|
|
1475
1454
|
* @param {WorkerRecord} workerRecord
|
|
1476
1455
|
* @param {string[]} files
|
|
1477
|
-
* @returns {void}
|
|
1478
1456
|
*/
|
|
1479
1457
|
function startWorkerSuites (workerRecord, files) {
|
|
1480
1458
|
for (const rawFile of files) {
|
|
@@ -1502,7 +1480,6 @@ function startWorkerSuites (workerRecord, files) {
|
|
|
1502
1480
|
* @param {WorkerRecord} workerRecord
|
|
1503
1481
|
* @param {string} rawFile
|
|
1504
1482
|
* @param {string} status
|
|
1505
|
-
* @returns {void}
|
|
1506
1483
|
*/
|
|
1507
1484
|
function finishWorkerSuite (state, workerRecord, rawFile, status) {
|
|
1508
1485
|
const file = normalizeFile(rawFile)
|
|
@@ -1524,7 +1501,6 @@ function finishWorkerSuite (state, workerRecord, rawFile, status) {
|
|
|
1524
1501
|
* @param {CoordinatorState} state
|
|
1525
1502
|
* @param {WorkerRecord} workerRecord
|
|
1526
1503
|
* @param {string} status
|
|
1527
|
-
* @returns {void}
|
|
1528
1504
|
*/
|
|
1529
1505
|
function finishAllWorkerSuites (state, workerRecord, status) {
|
|
1530
1506
|
let hasFailedSuite = false
|
|
@@ -1549,7 +1525,6 @@ function finishAllWorkerSuites (state, workerRecord, status) {
|
|
|
1549
1525
|
*
|
|
1550
1526
|
* @param {WorkerRecord} workerRecord
|
|
1551
1527
|
* @param {object} message
|
|
1552
|
-
* @returns {void}
|
|
1553
1528
|
*/
|
|
1554
1529
|
function sendWorkerMessage (workerRecord, message) {
|
|
1555
1530
|
const childProcess = workerRecord.worker.childProcess
|
|
@@ -1570,7 +1545,6 @@ function sendWorkerMessage (workerRecord, message) {
|
|
|
1570
1545
|
* @param {CoordinatorState} state
|
|
1571
1546
|
* @param {WorkerRecord} workerRecord
|
|
1572
1547
|
* @param {object} message
|
|
1573
|
-
* @returns {void}
|
|
1574
1548
|
*/
|
|
1575
1549
|
function handleConfigurationRequest (state, workerRecord, message) {
|
|
1576
1550
|
const { files = [], requestId } = message.content || {}
|
|
@@ -1594,7 +1568,6 @@ function handleConfigurationRequest (state, workerRecord, message) {
|
|
|
1594
1568
|
*
|
|
1595
1569
|
* @param {CoordinatorState} state
|
|
1596
1570
|
* @param {string[]} files
|
|
1597
|
-
* @returns {void}
|
|
1598
1571
|
*/
|
|
1599
1572
|
function updateEarlyFlakeDetectionFaultyState (state, files) {
|
|
1600
1573
|
const { configuration } = state
|
|
@@ -1641,7 +1614,6 @@ function getWebdriverioSuiteError (error) {
|
|
|
1641
1614
|
*
|
|
1642
1615
|
* @param {WorkerRecord} workerRecord
|
|
1643
1616
|
* @param {object} message
|
|
1644
|
-
* @returns {void}
|
|
1645
1617
|
*/
|
|
1646
1618
|
function handleSuiteResults (workerRecord, message) {
|
|
1647
1619
|
const { results = [] } = message.content || {}
|
|
@@ -1662,7 +1634,6 @@ function handleSuiteResults (workerRecord, message) {
|
|
|
1662
1634
|
* @param {CoordinatorState} state
|
|
1663
1635
|
* @param {WorkerRecord} workerRecord
|
|
1664
1636
|
* @param {object|unknown[]} message
|
|
1665
|
-
* @returns {void}
|
|
1666
1637
|
*/
|
|
1667
1638
|
function handleWorkerMessage (state, workerRecord, message) {
|
|
1668
1639
|
if (message?.origin === WEBDRIVERIO_WORKER_ORIGIN && message.name === WEBDRIVERIO_WORKER_EVENT) {
|
|
@@ -1756,7 +1727,6 @@ function handleWorkerMessage (state, workerRecord, message) {
|
|
|
1756
1727
|
* @param {CoordinatorState} state
|
|
1757
1728
|
* @param {WorkerRecord} workerRecord
|
|
1758
1729
|
* @param {object} exit
|
|
1759
|
-
* @returns {void}
|
|
1760
1730
|
*/
|
|
1761
1731
|
function handleWorkerExit (state, workerRecord, exit) {
|
|
1762
1732
|
state.activeWorkers--
|
|
@@ -1779,7 +1749,6 @@ function handleWorkerExit (state, workerRecord, exit) {
|
|
|
1779
1749
|
* @param {CoordinatorState} state
|
|
1780
1750
|
* @param {object} worker
|
|
1781
1751
|
* @param {string[]} specs
|
|
1782
|
-
* @returns {void}
|
|
1783
1752
|
*/
|
|
1784
1753
|
function registerWorker (state, worker, specs) {
|
|
1785
1754
|
const normalizedSpecs = []
|
|
@@ -1811,7 +1780,6 @@ function registerWorker (state, worker, specs) {
|
|
|
1811
1780
|
* Calculates the final status for the coordinated session.
|
|
1812
1781
|
*
|
|
1813
1782
|
* @param {CoordinatorState} state
|
|
1814
|
-
* @returns {string}
|
|
1815
1783
|
*/
|
|
1816
1784
|
function getSessionStatus (state) {
|
|
1817
1785
|
let hasPassingSuite = false
|
|
@@ -1837,13 +1805,26 @@ function getSessionStatus (state) {
|
|
|
1837
1805
|
return hasPassingSuite ? 'pass' : 'skip'
|
|
1838
1806
|
}
|
|
1839
1807
|
|
|
1808
|
+
/**
|
|
1809
|
+
* Returns whether every started worker reported that it discovered no tests.
|
|
1810
|
+
*
|
|
1811
|
+
* @param {CoordinatorState} state
|
|
1812
|
+
*/
|
|
1813
|
+
function isExpectedEmptySession (state) {
|
|
1814
|
+
if (state.workers.size === 0) return false
|
|
1815
|
+
|
|
1816
|
+
for (const workerRecord of state.workers) {
|
|
1817
|
+
if (workerRecord.hasTests !== false) return false
|
|
1818
|
+
}
|
|
1819
|
+
return true
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1840
1822
|
/**
|
|
1841
1823
|
* Finishes the single WebdriverIO-owned test session.
|
|
1842
1824
|
*
|
|
1843
1825
|
* @param {CoordinatorState} state
|
|
1844
1826
|
* @param {unknown} error
|
|
1845
1827
|
* @param {() => void} onDone
|
|
1846
|
-
* @returns {void}
|
|
1847
1828
|
*/
|
|
1848
1829
|
function finishCoordinator (state, error, onDone) {
|
|
1849
1830
|
if (state.finished) {
|
|
@@ -1877,8 +1858,10 @@ function finishCoordinator (state, error, onDone) {
|
|
|
1877
1858
|
return
|
|
1878
1859
|
}
|
|
1879
1860
|
|
|
1861
|
+
const status = error ? 'fail' : getSessionStatus(state)
|
|
1880
1862
|
testSessionFinishCh.publish({
|
|
1881
|
-
status
|
|
1863
|
+
status,
|
|
1864
|
+
isExpectedEmptySession: status === 'skip' && isExpectedEmptySession(state),
|
|
1882
1865
|
error,
|
|
1883
1866
|
isEarlyFlakeDetectionEnabled: state.configuration.isEarlyFlakeDetectionEnabled,
|
|
1884
1867
|
isEarlyFlakeDetectionFaulty: state.configuration.isEarlyFlakeDetectionFaulty,
|
|
@@ -1901,7 +1884,6 @@ function finishCoordinator (state, error, onDone) {
|
|
|
1901
1884
|
* resolveCallback?: (onDone: () => void) => void,
|
|
1902
1885
|
* rejectCallback?: (onDone: () => void) => void
|
|
1903
1886
|
* }} context
|
|
1904
|
-
* @returns {void}
|
|
1905
1887
|
*/
|
|
1906
1888
|
function waitForLogSubmissionAtWorkerExit (context) {
|
|
1907
1889
|
const shouldCleanRum = rumBrowsers.size > 0
|
|
@@ -1926,7 +1908,6 @@ function waitForLogSubmissionAtWorkerExit (context) {
|
|
|
1926
1908
|
* Cleans retained RUM browsers before WebdriverIO deletes the worker session.
|
|
1927
1909
|
*
|
|
1928
1910
|
* @param {{rumCleanupCallback?: () => Promise<void>}} context
|
|
1929
|
-
* @returns {void}
|
|
1930
1911
|
*/
|
|
1931
1912
|
function waitForRumCleanupBeforeSessionEnd (context) {
|
|
1932
1913
|
context.rumCleanupCallback = cleanupAllRumBrowsers
|
|
@@ -7,7 +7,6 @@ const { parseModelId: parseBedrockModelId } = require('../../datadog-plugin-aws-
|
|
|
7
7
|
* This is normalized to LLM Observability model provider standards.
|
|
8
8
|
*
|
|
9
9
|
* @param {Record<string, string>} tags
|
|
10
|
-
* @returns {string}
|
|
11
10
|
*/
|
|
12
11
|
function getModelProvider (tags) {
|
|
13
12
|
const modelProviderTag = tags['ai.model.provider']
|
|
@@ -21,7 +20,6 @@ function getModelProvider (tags) {
|
|
|
21
20
|
*
|
|
22
21
|
* @param {string} rawProvider
|
|
23
22
|
* @param {string} modelId
|
|
24
|
-
* @returns {string}
|
|
25
23
|
*/
|
|
26
24
|
function parseModelProvider (rawProvider, modelId) {
|
|
27
25
|
const providerParts = rawProvider?.split('.')
|
|
@@ -66,7 +66,6 @@ function overrideParentId (headers, parentId) {
|
|
|
66
66
|
* Whether the current trace context warrants a new checkpoint over the previously-saved one.
|
|
67
67
|
* @param {Record<string, string>} currentHeaders
|
|
68
68
|
* @param {Record<string, string>} previousHeaders
|
|
69
|
-
* @returns {boolean}
|
|
70
69
|
*/
|
|
71
70
|
function needsCheckpointUpdate (currentHeaders, previousHeaders) {
|
|
72
71
|
for (const key of Object.keys(currentHeaders)) {
|
|
@@ -30,7 +30,6 @@ function getStepDataForNext (ctxImpl) {
|
|
|
30
30
|
* mirroring the SDK's internal calculation — is only added when a stepId exists.
|
|
31
31
|
* @param {Record<string, string>} meta - The span meta/tags object to populate.
|
|
32
32
|
* @param {{ stepId?: string, stepData?: object }} stepInfo - Resolved next stepId and checkpoint entry.
|
|
33
|
-
* @returns {void}
|
|
34
33
|
*/
|
|
35
34
|
function addOpMeta (meta, { stepId, stepData }) {
|
|
36
35
|
if (!stepId) {
|
|
@@ -52,7 +51,6 @@ function addOpMeta (meta, { stepId, stepData }) {
|
|
|
52
51
|
* 0 since the 1-indexing is observed server behavior, not an SDK guarantee.
|
|
53
52
|
*
|
|
54
53
|
* @param {object} [stepData] - The checkpoint entry for the next stepId.
|
|
55
|
-
* @returns {number}
|
|
56
54
|
*/
|
|
57
55
|
function getOperationAttempt (stepData) {
|
|
58
56
|
const attempt = stepData?.StepDetails?.Attempt
|
|
@@ -32,7 +32,6 @@ class BaseAwsSdkPlugin extends ClientPlugin {
|
|
|
32
32
|
* @param {string} key Top-level key to insert. Must be a simple
|
|
33
33
|
* identifier that does not need JSON escaping.
|
|
34
34
|
* @param {object} value Value to inject; will be `JSON.stringify`'d.
|
|
35
|
-
* @returns {string}
|
|
36
35
|
*/
|
|
37
36
|
static injectFieldIntoJsonObject (payload, key, value) {
|
|
38
37
|
const last = payload.length - 1
|
|
@@ -500,6 +500,8 @@ function extractMessagesFromConverseContent (role, contentBlocks) {
|
|
|
500
500
|
if (block == null || typeof block !== 'object') continue
|
|
501
501
|
if (typeof block.text === 'string') {
|
|
502
502
|
content += block.text
|
|
503
|
+
} else if (typeof block.guardContent?.text?.text === 'string') {
|
|
504
|
+
content += block.guardContent.text.text
|
|
503
505
|
} else if (block.toolUse) {
|
|
504
506
|
toolCalls.push(buildToolCall(block.toolUse))
|
|
505
507
|
} else if (block.toolResult) {
|
|
@@ -526,7 +528,6 @@ function extractMessagesFromConverseContent (role, contentBlocks) {
|
|
|
526
528
|
* of the `[name, value]` tuple.
|
|
527
529
|
*
|
|
528
530
|
* @param {object} block
|
|
529
|
-
* @returns {string}
|
|
530
531
|
*/
|
|
531
532
|
function getContentBlockType (block) {
|
|
532
533
|
const key = Object.keys(block)[0]
|
|
@@ -611,7 +612,11 @@ function extractRequestParamsConverse (params) {
|
|
|
611
612
|
const prompt = []
|
|
612
613
|
if (params.system) {
|
|
613
614
|
for (const block of params.system) {
|
|
614
|
-
if (typeof block?.text === 'string')
|
|
615
|
+
if (typeof block?.text === 'string') {
|
|
616
|
+
prompt.push({ content: block.text, role: 'system' })
|
|
617
|
+
} else if (typeof block?.guardContent?.text?.text === 'string') {
|
|
618
|
+
prompt.push({ content: block.guardContent.text.text, role: 'system' })
|
|
619
|
+
}
|
|
615
620
|
}
|
|
616
621
|
}
|
|
617
622
|
if (params.messages) {
|
|
@@ -30,7 +30,6 @@ const PATHWAY_SIZE_PROBE = { hash: Buffer.alloc(8), pathwayStartNs: 0, edgeStart
|
|
|
30
30
|
* consumer receives, which is also why this differs from `putEventEntrySize`.
|
|
31
31
|
*
|
|
32
32
|
* @param {PutEventsRequestEntry} entry whose `Detail` the caller has already checked is a string.
|
|
33
|
-
* @returns {number}
|
|
34
33
|
*/
|
|
35
34
|
function dsmPayloadSize (entry) {
|
|
36
35
|
let size = Buffer.byteLength(entry.Detail)
|
|
@@ -7,7 +7,6 @@ const log = require('../../dd-trace/src/log')
|
|
|
7
7
|
* Generates a unique hash from an array of strings by joining them with | before hashing.
|
|
8
8
|
* Used to uniquely identify AWS requests for span pointers.
|
|
9
9
|
* @param {string[]} components - Array of strings to hash
|
|
10
|
-
* @returns {string} A 32-character hash uniquely identifying the components
|
|
11
10
|
*/
|
|
12
11
|
function generatePointerHash (components) {
|
|
13
12
|
// If passing S3's ETag as a component, make sure any quotes have already been removed!
|
|
@@ -26,7 +26,7 @@ class AzureCosmosPlugin extends DatabasePlugin {
|
|
|
26
26
|
const result = ctx.result
|
|
27
27
|
if (result?.code) span.setTag('db.response.status_code', (result.code).toString())
|
|
28
28
|
if (result?.substatus) span.setTag('cosmosdb.response.sub_status_code', result.substatus)
|
|
29
|
-
|
|
29
|
+
this.finish(ctx)
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const TracingPlugin = require('../../dd-trace/src/plugins/tracing')
|
|
4
|
+
const { AUTO_KEEP } = require('../../../ext/priority')
|
|
5
|
+
const { writeTraceparent, writeTracestate } = require('../../dd-trace/src/carrier')
|
|
6
|
+
|
|
7
|
+
const ORCHESTRATION_FAILURE_END_CHANNEL =
|
|
8
|
+
'tracing:orchestrion:durable-functions:TaskOrchestrationExecutor_failure:end'
|
|
9
|
+
const ORCHESTRATOR_COMPLETED_EVENT_TYPE = 13
|
|
4
10
|
|
|
5
11
|
class AzureDurableFunctionsPlugin extends TracingPlugin {
|
|
6
12
|
static get id () { return 'azure-durable-functions' }
|
|
@@ -9,9 +15,35 @@ class AzureDurableFunctionsPlugin extends TracingPlugin {
|
|
|
9
15
|
static get type () { return 'serverless' }
|
|
10
16
|
static get kind () { return 'server' }
|
|
11
17
|
|
|
18
|
+
addTraceSubs () {
|
|
19
|
+
super.addTraceSubs()
|
|
20
|
+
this.addSub(ORCHESTRATION_FAILURE_END_CHANNEL, this.orchestrationFailure)
|
|
21
|
+
}
|
|
22
|
+
|
|
12
23
|
bindStart (ctx) {
|
|
24
|
+
// Continue the trace propagated by the Durable Functions host (W3C traceparent
|
|
25
|
+
// supplied on the invocation's traceContext) so activity/entity invocations join
|
|
26
|
+
// the same trace as the HTTP root instead of each starting a new root.
|
|
27
|
+
let childOf
|
|
28
|
+
if (ctx.traceparent) {
|
|
29
|
+
// extract() returns null when the carrier can't be parsed. Normalize to
|
|
30
|
+
// undefined so startSpan still falls back to any active in-process parent
|
|
31
|
+
// rather than being forced to start a brand new root span.
|
|
32
|
+
const carrier = {}
|
|
33
|
+
|
|
34
|
+
writeTraceparent(carrier, ctx.traceparent)
|
|
35
|
+
if (ctx.tracestate) {
|
|
36
|
+
writeTracestate(carrier, ctx.tracestate)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
childOf = this.tracer.extract('text_map', carrier) ?? undefined
|
|
40
|
+
}
|
|
41
|
+
const extractedAsDrop = childOf?._sampling.priority < AUTO_KEEP
|
|
42
|
+
|
|
13
43
|
const span = this.startSpan(this.operationName(), {
|
|
14
|
-
|
|
44
|
+
startTime: ctx.startTime,
|
|
45
|
+
childOf,
|
|
46
|
+
kind: ctx.trigger === 'Orchestration' ? 'server' : 'internal',
|
|
15
47
|
type: 'serverless',
|
|
16
48
|
|
|
17
49
|
meta: {
|
|
@@ -29,6 +61,19 @@ class AzureDurableFunctionsPlugin extends TracingPlugin {
|
|
|
29
61
|
)
|
|
30
62
|
}
|
|
31
63
|
|
|
64
|
+
// The host clears the W3C sampled flag in traceparent while datadog tracestate
|
|
65
|
+
// still says keep, so extraction would drop this chunk. Re-apply only the propagated
|
|
66
|
+
// `s` priority when it indicates keep, preserving the extracted sampling mechanism.
|
|
67
|
+
if (span._prioritySampler && childOf && extractedAsDrop) {
|
|
68
|
+
const propagatedPriority = propagatedSamplingPriority(childOf._tracestate)
|
|
69
|
+
if (propagatedPriority >= AUTO_KEEP) {
|
|
70
|
+
const spanContext = span.context()
|
|
71
|
+
if (spanContext._parentId === childOf._spanId) {
|
|
72
|
+
spanContext._sampling.priority = propagatedPriority
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
32
77
|
ctx.span = span
|
|
33
78
|
return ctx.currentStore
|
|
34
79
|
}
|
|
@@ -44,6 +89,55 @@ class AzureDurableFunctionsPlugin extends TracingPlugin {
|
|
|
44
89
|
asyncStart (ctx) {
|
|
45
90
|
super.finish(ctx)
|
|
46
91
|
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Tags the active initial orchestration span or creates a failure-only span after
|
|
95
|
+
* a resumed orchestration throws. The executor publishes synchronously before
|
|
96
|
+
* Durable Functions serializes the error, so this does not add a promise to
|
|
97
|
+
* orchestration activations.
|
|
98
|
+
*
|
|
99
|
+
* @param {{ arguments?: unknown[], error?: unknown }} executorCtx
|
|
100
|
+
*/
|
|
101
|
+
orchestrationFailure (executorCtx) {
|
|
102
|
+
const args = executorCtx?.arguments
|
|
103
|
+
if (!Array.isArray(args)) return
|
|
104
|
+
|
|
105
|
+
const invocationContext = args[0]
|
|
106
|
+
const history = args[1]
|
|
107
|
+
if (!Array.isArray(history)) return
|
|
108
|
+
|
|
109
|
+
const hasPreviousActivation = history.some(
|
|
110
|
+
event => event?.EventType === ORCHESTRATOR_COMPLETED_EVENT_TYPE
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
if (!hasPreviousActivation) {
|
|
114
|
+
this.addError(executorCtx.error)
|
|
115
|
+
return
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const traceContext = invocationContext?.traceContext
|
|
119
|
+
const ctx = {
|
|
120
|
+
trigger: 'Orchestration',
|
|
121
|
+
functionName: invocationContext?.functionName,
|
|
122
|
+
traceparent: traceContext?.traceParent,
|
|
123
|
+
tracestate: traceContext?.traceState,
|
|
124
|
+
error: executorCtx.error,
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
this.bindStart(ctx)
|
|
128
|
+
this.error(ctx)
|
|
129
|
+
super.finish(ctx)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Read the datadog-propagated sampling priority (`dd=...;s:<n>`) from a W3C
|
|
134
|
+
// tracestate. Returns undefined when there is no datadog tracestate or no valid
|
|
135
|
+
// `s` value, so callers can distinguish "no propagated decision" from a drop.
|
|
136
|
+
function propagatedSamplingPriority (tracestate) {
|
|
137
|
+
return tracestate?.forVendor('dd', state => {
|
|
138
|
+
const priority = Number(state.get('s'))
|
|
139
|
+
return Number.isInteger(priority) ? priority : undefined
|
|
140
|
+
})
|
|
47
141
|
}
|
|
48
142
|
|
|
49
143
|
module.exports = AzureDurableFunctionsPlugin
|
|
@@ -35,6 +35,7 @@ const {
|
|
|
35
35
|
TEST_SOURCE_START,
|
|
36
36
|
TEST_STATUS,
|
|
37
37
|
TEST_FINAL_STATUS,
|
|
38
|
+
setExpectedEmptyTestSessionTags,
|
|
38
39
|
} = require('../../dd-trace/src/plugins/util/test')
|
|
39
40
|
const { RESOURCE_NAME } = require('../../../ext/tags')
|
|
40
41
|
const { COMPONENT, ERROR_MESSAGE } = require('../../dd-trace/src/constants')
|
|
@@ -72,6 +73,7 @@ class CucumberPlugin extends CiPlugin {
|
|
|
72
73
|
isEarlyFlakeDetectionFaulty,
|
|
73
74
|
isTestManagementTestsEnabled,
|
|
74
75
|
isParallel,
|
|
76
|
+
isExpectedEmptySession,
|
|
75
77
|
error,
|
|
76
78
|
onDone,
|
|
77
79
|
}) => {
|
|
@@ -116,6 +118,14 @@ class CucumberPlugin extends CiPlugin {
|
|
|
116
118
|
|
|
117
119
|
this.testSessionSpan.setTag(TEST_STATUS, status)
|
|
118
120
|
this.testModuleSpan.setTag(TEST_STATUS, status)
|
|
121
|
+
if (isExpectedEmptySession) {
|
|
122
|
+
setExpectedEmptyTestSessionTags(
|
|
123
|
+
this.testSessionSpan,
|
|
124
|
+
this.testModuleSpan,
|
|
125
|
+
'No scenarios were executed',
|
|
126
|
+
'zero_tests'
|
|
127
|
+
)
|
|
128
|
+
}
|
|
119
129
|
if (error) {
|
|
120
130
|
for (const testSuiteSpan of this._testSuiteSpansByTestSuite.values()) {
|
|
121
131
|
testSuiteSpan.setTag(TEST_STATUS, 'fail')
|