dd-trace 5.134.0 → 5.136.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-3rdparty.csv +0 -1
- package/ci/cypress/support.js +15 -1
- package/ci/init.js +2 -22
- package/ci/test-annotations.d.ts +5 -0
- package/ci/test-annotations.js +5 -0
- package/ci/vitest-no-worker-init-annotations.mjs +4 -0
- package/ci/vitest-no-worker-init-node-setup.mjs +22 -0
- package/ci/vitest-no-worker-init-runner-setup.mjs +7 -32
- package/ci/vitest-no-worker-init-setup.mjs +34 -12
- package/ci/vitest-no-worker-init-v5-setup.mjs +6 -0
- package/ext/exporters.js +1 -1
- package/index.d.ts +124 -5
- package/initialize.mjs +5 -2
- package/lambda.d.ts +39 -0
- package/lambda.js +3 -0
- package/loader-hook.mjs +53 -0
- package/openfeature/exposure-hook.d.ts +66 -0
- package/openfeature/exposure-hook.js +5 -0
- package/package.json +19 -15
- package/packages/datadog-core/src/storage.js +1 -1
- package/packages/datadog-esbuild/index.js +78 -62
- package/packages/datadog-instrumentations/src/aws-lambda.js +88 -0
- package/packages/datadog-instrumentations/src/cucumber.js +56 -19
- package/packages/datadog-instrumentations/src/cypress-config.js +163 -15
- package/packages/datadog-instrumentations/src/elevenlabs/activity.js +114 -0
- package/packages/datadog-instrumentations/src/elevenlabs/audio.js +104 -0
- package/packages/datadog-instrumentations/src/elevenlabs/index.js +288 -0
- package/packages/datadog-instrumentations/src/elevenlabs/session.js +444 -0
- package/packages/datadog-instrumentations/src/graphql.js +29 -20
- package/packages/datadog-instrumentations/src/grpc/server.js +23 -6
- package/packages/{datadog-esbuild/src/utils.js → datadog-instrumentations/src/helpers/bundler-esm-exports.js} +282 -40
- package/packages/datadog-instrumentations/src/helpers/bundler-transform.js +573 -0
- package/packages/datadog-instrumentations/src/helpers/bundler-utils.js +104 -0
- package/packages/datadog-instrumentations/src/helpers/fetch.js +5 -1
- package/packages/datadog-instrumentations/src/helpers/graphql-jit-runtime.js +30 -8
- package/packages/datadog-instrumentations/src/helpers/hook.js +29 -1
- package/packages/datadog-instrumentations/src/helpers/hooks.js +4 -8
- package/packages/datadog-instrumentations/src/helpers/lambda-handler.js +189 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +18 -6
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentation-registry.js +26 -1
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/async-mutex.js +41 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/elevenlabs.js +25 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql-jit.js +3 -1
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql.js +0 -36
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/next.js +40 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/openai-agents-realtime.js +23 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/react-router.js +49 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/trpc.js +148 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/typesafe.js +23 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js +12 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/target-patterns.json +58 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.js +19 -2
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +25 -3
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +59 -2
- package/packages/datadog-instrumentations/src/ioredis.js +101 -3
- package/packages/datadog-instrumentations/src/jest.js +265 -82
- package/packages/datadog-instrumentations/src/mariadb-bundle.js +69 -11
- package/packages/datadog-instrumentations/src/mariadb.js +13 -6
- package/packages/datadog-instrumentations/src/mocha/common.js +89 -8
- package/packages/datadog-instrumentations/src/mocha/main.js +11 -2
- package/packages/datadog-instrumentations/src/mocha/utils.js +58 -12
- package/packages/datadog-instrumentations/src/mocha/worker.js +1 -1
- package/packages/datadog-instrumentations/src/next.js +19 -6
- package/packages/datadog-instrumentations/src/openai-agents-realtime.js +149 -0
- package/packages/datadog-instrumentations/src/openai-realtime/audio-accumulator.js +27 -0
- package/packages/datadog-instrumentations/src/openai-realtime/index.js +17 -6
- package/packages/datadog-instrumentations/src/openai-realtime/server-playback.js +887 -0
- package/packages/datadog-instrumentations/src/openai-realtime/session.js +150 -25
- package/packages/datadog-instrumentations/src/openai-realtime/turns.js +29 -2
- package/packages/datadog-instrumentations/src/oracledb.js +33 -0
- package/packages/datadog-instrumentations/src/otel-sdk-trace.js +11 -9
- package/packages/datadog-instrumentations/src/pg.js +2 -1
- package/packages/datadog-instrumentations/src/playwright.js +81 -28
- package/packages/datadog-instrumentations/src/react-router.js +106 -0
- package/packages/datadog-instrumentations/src/typesafe.js +89 -0
- package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +84 -48
- package/packages/datadog-instrumentations/src/vitest-main.js +26 -0
- package/packages/datadog-instrumentations/src/vitest-test-annotations.js +20 -0
- package/packages/datadog-instrumentations/src/vitest-worker.js +39 -17
- package/packages/datadog-instrumentations/src/vitest.js +10 -8
- package/packages/datadog-instrumentations/src/webdriverio.js +12 -12
- package/packages/datadog-plugin-async-mutex/src/index.js +50 -0
- package/packages/datadog-plugin-aws-lambda/src/index.js +106 -0
- package/packages/datadog-plugin-cucumber/src/index.js +5 -0
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +296 -55
- package/packages/datadog-plugin-cypress/src/index.js +1 -1
- package/packages/datadog-plugin-cypress/src/lifecycle-owner.js +20 -0
- package/packages/datadog-plugin-cypress/src/plugin.js +10 -0
- package/packages/datadog-plugin-cypress/src/retry-config-observer.js +281 -0
- package/packages/datadog-plugin-cypress/src/setup-handoff.js +125 -0
- package/packages/datadog-plugin-cypress/src/support.js +1217 -439
- package/packages/datadog-plugin-elevenlabs/src/index.js +69 -0
- package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +10 -7
- package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +19 -52
- package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-push-subscription.js +4 -2
- package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-request-context.js +25 -4
- package/packages/datadog-plugin-graphql/src/execute.js +2 -2
- package/packages/datadog-plugin-graphql/src/utils.js +5 -5
- package/packages/datadog-plugin-http/src/client.js +32 -9
- package/packages/datadog-plugin-http2/src/client.js +38 -13
- package/packages/datadog-plugin-jest/src/index.js +25 -3
- package/packages/datadog-plugin-mocha/src/index.js +47 -6
- package/packages/datadog-plugin-next/src/index.js +112 -14
- package/packages/datadog-plugin-oracledb/src/connection-parser.js +21 -11
- package/packages/datadog-plugin-playwright/src/index.js +4 -0
- package/packages/datadog-plugin-prisma/src/datadog-tracing-helper.js +5 -3
- package/packages/datadog-plugin-react-router/src/index.js +118 -0
- package/packages/datadog-plugin-trpc/src/index.js +15 -0
- package/packages/datadog-plugin-trpc/src/procedure.js +48 -0
- package/packages/datadog-plugin-trpc/src/request.js +81 -0
- package/packages/datadog-plugin-typesafe/src/index.js +17 -0
- package/packages/datadog-plugin-typesafe/src/tracing.js +31 -0
- package/packages/datadog-plugin-undici/src/index.js +22 -7
- package/packages/datadog-plugin-vitest/src/index.js +8 -0
- package/packages/datadog-turbopack/index.js +4 -28
- package/packages/datadog-turbopack/src/loader.js +14 -452
- package/packages/datadog-webpack/index.js +3 -55
- package/packages/dd-trace/src/agent/info.js +2 -1
- package/packages/dd-trace/src/aiguard/evaluation.js +62 -1
- package/packages/dd-trace/src/aiguard/sdk.js +8 -13
- package/packages/dd-trace/src/aiguard/tags.js +2 -0
- package/packages/dd-trace/src/appsec/blocking/index.js +4 -0
- package/packages/dd-trace/src/appsec/graphql.js +91 -6
- package/packages/dd-trace/src/appsec/recommended.json +1287 -90
- package/packages/dd-trace/src/before-exit.js +32 -0
- package/packages/dd-trace/src/bootstrap.js +5 -3
- package/packages/dd-trace/src/ci-visibility/early-flake-detection/get-known-tests.js +24 -18
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +16 -36
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +41 -13
- package/packages/dd-trace/src/ci-visibility/exporters/request.js +2 -3
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +10 -18
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +10 -15
- package/packages/dd-trace/src/ci-visibility/requests/route.js +44 -0
- package/packages/dd-trace/src/ci-visibility/telemetry-logs.js +5 -0
- package/packages/dd-trace/src/ci-visibility/telemetry.js +6 -0
- package/packages/dd-trace/src/ci-visibility/test-annotations.js +72 -0
- package/packages/dd-trace/src/ci-visibility/test-declaration-annotations.js +170 -0
- package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +10 -17
- package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache-schema.js +9 -134
- package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache.js +11 -156
- package/packages/dd-trace/src/config/config-types.d.ts +3 -0
- package/packages/dd-trace/src/config/defaults.js +9 -3
- package/packages/dd-trace/src/config/generated-config-types.d.ts +46 -2
- package/packages/dd-trace/src/config/index.js +111 -43
- package/packages/dd-trace/src/config/parsers.js +18 -1
- package/packages/dd-trace/src/config/supported-configurations.json +174 -4
- package/packages/dd-trace/src/constants.js +1 -0
- package/packages/dd-trace/src/debugger/pause-duration-histogram.js +2 -1
- package/packages/dd-trace/src/debugger/probe_sampler.js +6 -6
- package/packages/dd-trace/src/encode/0.4.js +2 -2
- package/packages/dd-trace/src/esm-module-load.js +58 -0
- package/packages/dd-trace/src/exporter.js +23 -15
- package/packages/dd-trace/src/exporters/agent/index.js +3 -1
- package/packages/dd-trace/src/exporters/agentless/index.js +3 -1
- package/packages/dd-trace/src/exporters/common/request.js +83 -50
- package/packages/dd-trace/src/exporters/common/retry.js +12 -7
- package/packages/dd-trace/src/exporters/common/url.js +1 -1
- package/packages/dd-trace/src/exporters/llmobs/index.js +135 -0
- package/packages/dd-trace/src/exporters/log/index.js +4 -3
- package/packages/dd-trace/src/id.js +1 -1
- package/packages/dd-trace/src/lambda/facade.js +74 -0
- package/packages/dd-trace/src/lambda/handler.js +3 -41
- package/packages/dd-trace/src/lambda/index.js +38 -15
- package/packages/dd-trace/src/lambda/runtime/patch.js +19 -3
- package/packages/dd-trace/src/lambda/wrap.js +44 -0
- package/packages/dd-trace/src/llmobs/constants/tags.js +3 -0
- package/packages/dd-trace/src/llmobs/experiments/experiment.js +10 -5
- package/packages/dd-trace/src/llmobs/experiments/index.js +2 -3
- package/packages/dd-trace/src/llmobs/experiments/noop.js +5 -2
- package/packages/dd-trace/src/llmobs/index.js +13 -2
- package/packages/dd-trace/src/llmobs/plugins/claude-agent-sdk/index.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/elevenlabs.js +96 -0
- package/packages/dd-trace/src/llmobs/plugins/genai/index.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +27 -10
- package/packages/dd-trace/src/llmobs/plugins/openai/realtime.js +38 -11
- package/packages/dd-trace/src/llmobs/plugins/typesafe/index.js +102 -0
- package/packages/dd-trace/src/llmobs/plugins/vertexai.js +10 -2
- package/packages/dd-trace/src/llmobs/prompts/cache.js +3 -1
- package/packages/dd-trace/src/llmobs/sdk.js +21 -1
- package/packages/dd-trace/src/llmobs/span_processor.js +219 -12
- package/packages/dd-trace/src/llmobs/tagger.js +25 -0
- package/packages/dd-trace/src/llmobs/writers/util.js +3 -3
- package/packages/dd-trace/src/log/channels.js +4 -0
- package/packages/dd-trace/src/log/writer.js +13 -2
- package/packages/dd-trace/src/openfeature/agentless_configuration_source.js +68 -6
- package/packages/dd-trace/src/openfeature/configuration_source.js +41 -17
- package/packages/dd-trace/src/openfeature/debug-logging-hook.js +66 -3
- package/packages/dd-trace/src/openfeature/exposure-hook.js +185 -0
- package/packages/dd-trace/src/openfeature/flag-selection.js +152 -0
- package/packages/dd-trace/src/openfeature/flagging_provider.js +58 -14
- package/packages/dd-trace/src/openfeature/remote_config.js +16 -3
- package/packages/dd-trace/src/openfeature/writers/base.js +63 -30
- package/packages/dd-trace/src/openfeature/writers/exposures.js +161 -1
- package/packages/dd-trace/src/openfeature/writers/flag-eval-evp-hook.js +5 -0
- package/packages/dd-trace/src/openfeature/writers/flag-evaluation-aggregation.js +9 -4
- package/packages/dd-trace/src/openfeature/writers/flag-evaluation-payload.js +2 -0
- package/packages/dd-trace/src/openfeature/writers/flag-evaluation-pii.js +2 -0
- package/packages/dd-trace/src/openfeature/writers/split-features.js +25 -0
- package/packages/dd-trace/src/opentelemetry/logs/index.js +11 -0
- package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +1 -1
- package/packages/dd-trace/src/opentelemetry/metrics/index.js +7 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_http_metric_exporter.js +1 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_exporter.js +4 -1
- package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +2 -2
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +19 -1
- package/packages/dd-trace/src/opentelemetry/span-ending-hook.js +5 -1
- package/packages/dd-trace/src/opentelemetry/span-helpers.js +6 -1
- package/packages/dd-trace/src/opentelemetry/span.js +2 -2
- package/packages/dd-trace/src/opentelemetry/startup-config.js +174 -0
- package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +1 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +7 -1
- package/packages/dd-trace/src/opentelemetry/tracer_provider.js +5 -1
- package/packages/dd-trace/src/opentracing/propagation/tracestate.js +77 -23
- package/packages/dd-trace/src/opentracing/tracer.js +33 -13
- package/packages/dd-trace/src/otel-thread-ctx.js +72 -49
- package/packages/dd-trace/src/plugin_manager.js +34 -7
- package/packages/dd-trace/src/plugins/ci_plugin.js +45 -14
- package/packages/dd-trace/src/plugins/index.js +9 -0
- package/packages/dd-trace/src/plugins/plugin.js +4 -2
- package/packages/dd-trace/src/plugins/tracing.js +1 -1
- package/packages/dd-trace/src/plugins/util/ci.js +18 -1
- package/packages/dd-trace/src/plugins/util/git-cache.js +4 -4
- package/packages/dd-trace/src/plugins/util/git.js +273 -86
- package/packages/dd-trace/src/plugins/util/http-otel-semantics.js +77 -50
- package/packages/dd-trace/src/plugins/util/inferred_proxy.js +12 -4
- package/packages/dd-trace/src/plugins/util/status-validator.js +23 -10
- package/packages/dd-trace/src/plugins/util/tags.js +6 -0
- package/packages/dd-trace/src/plugins/util/test.js +90 -45
- package/packages/dd-trace/src/plugins/util/url.js +10 -2
- package/packages/dd-trace/src/plugins/util/user-provided-git.js +2 -2
- package/packages/dd-trace/src/plugins/util/web.js +81 -10
- package/packages/dd-trace/src/process-tags/index.js +1 -1
- package/packages/dd-trace/src/profiling/config.js +6 -3
- package/packages/dd-trace/src/profiling/webspan-utils.js +6 -5
- package/packages/dd-trace/src/proxy.js +48 -57
- package/packages/dd-trace/src/serverless.js +3 -2
- package/packages/dd-trace/src/span_processor.js +41 -9
- package/packages/dd-trace/src/span_stats.js +28 -2
- package/packages/dd-trace/src/startup-log.js +8 -5
- package/packages/dd-trace/src/tagger.js +7 -5
- package/packages/dd-trace/src/telemetry/dependencies.js +4 -0
- package/packages/dd-trace/src/telemetry/index.js +3 -0
- package/packages/dd-trace/src/telemetry/logs/index.js +21 -2
- package/packages/dd-trace/src/telemetry/logs/log-collector.js +1 -0
- package/packages/dd-trace/src/telemetry/metrics.js +2 -1
- package/packages/dd-trace/src/telemetry/telemetry.js +10 -3
- package/packages/dd-trace/src/tracer.js +0 -2
- package/packages/dd-trace/src/util.js +1 -1
- package/packages/dd-trace/src/web-tags-cache.js +8 -9
- package/register.js +4 -2
- package/vendor/dist/@apm-js-collab/code-transformer/LICENSE +489 -0
- package/vendor/dist/{@opentelemetry/resources → @datadog/flagging-core}/LICENSE +22 -2
- package/vendor/dist/@datadog/flagging-core/index.js +1 -0
- package/vendor/dist/@datadog/openfeature-node-server/LICENSE +21 -1
- package/vendor/dist/@datadog/openfeature-node-server/index.js +1 -1
- package/vendor/dist/@datadog/openfeature-node-server/rules-based/LICENSE +3 -1
- package/vendor/dist/@datadog/openfeature-node-server/rules-based/index.d.ts +78 -0
- package/vendor/dist/@datadog/openfeature-node-server/rules-based/index.js +1 -1
- package/vendor/dist/@datadog/sketches-js/LICENSE +263 -0
- package/vendor/dist/@datadog/source-map/LICENSE +1 -0
- package/vendor/dist/@isaacs/ttlcache/LICENSE +13 -0
- package/vendor/dist/@opentelemetry/core/LICENSE +209 -1
- package/vendor/dist/@opentelemetry/core/index.js +1 -1
- package/vendor/dist/crypto-randomuuid/LICENSE +3 -0
- package/vendor/dist/escape-string-regexp/LICENSE +13 -0
- package/vendor/dist/esquery/LICENSE +2 -0
- package/vendor/dist/https-proxy-agent/LICENSE +80 -1
- package/vendor/dist/istanbul-lib-coverage/LICENSE +2 -0
- package/vendor/dist/jest-docblock/LICENSE +16 -0
- package/vendor/dist/jsonpath-plus/LICENSE +13 -0
- package/vendor/dist/limiter/LICENSE +2 -0
- package/vendor/dist/lodash.sortby/LICENSE +2 -0
- package/vendor/dist/lru-cache/LICENSE +13 -0
- package/vendor/dist/meriyah/LICENSE +13 -0
- package/vendor/dist/module-details-from-path/LICENSE +2 -0
- package/vendor/dist/mutexify/promise/LICENSE +28 -0
- package/vendor/dist/pprof-format/LICENSE +13 -0
- package/vendor/dist/pprof-format/index.js +1 -1
- package/vendor/dist/protobufjs/LICENSE +219 -0
- package/vendor/dist/protobufjs/minimal/LICENSE +219 -0
- package/vendor/dist/proxy-from-env/LICENSE +13 -0
- package/vendor/dist/retry/LICENSE +2 -0
- package/vendor/dist/rfdc/LICENSE +2 -0
- package/vendor/dist/semifies/LICENSE +3 -1
- package/vendor/dist/shell-quote/LICENSE +3 -1
- package/vendor/dist/source-map/LICENSE +1 -0
- package/vendor/dist/source-map/lib/util/LICENSE +1 -0
- package/vendor/dist/tlhunter-sorted-set/LICENSE +2 -0
- package/vendor/dist/ttl-set/LICENSE +28 -0
- package/ci/diagnose.js +0 -2215
- package/ci/runbook.md +0 -299
- package/ci/test-optimization-validation/approval-artifacts.js +0 -175
- package/ci/test-optimization-validation/approval.js +0 -386
- package/ci/test-optimization-validation/artifact-id.js +0 -19
- package/ci/test-optimization-validation/blocker-category.js +0 -24
- package/ci/test-optimization-validation/bounded-json.js +0 -120
- package/ci/test-optimization-validation/ci-command-candidate.js +0 -77
- package/ci/test-optimization-validation/ci-discovery.js +0 -192
- package/ci/test-optimization-validation/ci-package-scripts.js +0 -169
- package/ci/test-optimization-validation/ci-remediation.js +0 -283
- package/ci/test-optimization-validation/cli.js +0 -954
- package/ci/test-optimization-validation/command-blocker.js +0 -377
- package/ci/test-optimization-validation/command-output-policy.js +0 -188
- package/ci/test-optimization-validation/command-runner.js +0 -650
- package/ci/test-optimization-validation/environment.js +0 -88
- package/ci/test-optimization-validation/executable-approval.js +0 -47
- package/ci/test-optimization-validation/executable.js +0 -244
- package/ci/test-optimization-validation/execution-lock.js +0 -70
- package/ci/test-optimization-validation/framework-adapters/cucumber-validation.json +0 -3
- package/ci/test-optimization-validation/framework-adapters/cucumber.js +0 -767
- package/ci/test-optimization-validation/framework-adapters/cypress.js +0 -99
- package/ci/test-optimization-validation/framework-adapters/playwright.js +0 -175
- package/ci/test-optimization-validation/framework-adapters/vitest.js +0 -513
- package/ci/test-optimization-validation/generated-file-policy.js +0 -63
- package/ci/test-optimization-validation/generated-files.js +0 -425
- package/ci/test-optimization-validation/generated-test-contract.js +0 -284
- package/ci/test-optimization-validation/generated-verifier.js +0 -235
- package/ci/test-optimization-validation/literal-environment.js +0 -56
- package/ci/test-optimization-validation/literal-glob.js +0 -52
- package/ci/test-optimization-validation/manifest-loader.js +0 -116
- package/ci/test-optimization-validation/manifest-scaffold.js +0 -1276
- package/ci/test-optimization-validation/manifest-schema.js +0 -695
- package/ci/test-optimization-validation/offline-fixtures.js +0 -335
- package/ci/test-optimization-validation/offline-output.js +0 -406
- package/ci/test-optimization-validation/package-check.js +0 -97
- package/ci/test-optimization-validation/payload-normalizer.js +0 -72
- package/ci/test-optimization-validation/plan-writer.js +0 -541
- package/ci/test-optimization-validation/preflight-runner.js +0 -186
- package/ci/test-optimization-validation/project-build-artifact.js +0 -31
- package/ci/test-optimization-validation/redaction.js +0 -319
- package/ci/test-optimization-validation/report-writer.js +0 -666
- package/ci/test-optimization-validation/result-semantics.js +0 -103
- package/ci/test-optimization-validation/runner-command.js +0 -264
- package/ci/test-optimization-validation/runner-contract.js +0 -695
- package/ci/test-optimization-validation/safe-files.js +0 -202
- package/ci/test-optimization-validation/scenarios/auto-test-retries.js +0 -171
- package/ci/test-optimization-validation/scenarios/basic-reporting.js +0 -407
- package/ci/test-optimization-validation/scenarios/ci-wiring.js +0 -666
- package/ci/test-optimization-validation/scenarios/early-flake-detection.js +0 -142
- package/ci/test-optimization-validation/scenarios/helpers.js +0 -621
- package/ci/test-optimization-validation/scenarios/test-management.js +0 -219
- package/ci/test-optimization-validation/source-text.js +0 -84
- package/ci/test-optimization-validation/static-diagnosis.js +0 -166
- package/ci/test-optimization-validation/test-output.js +0 -120
- package/ci/test-optimization-validation/validation-blocker.js +0 -21
- package/ci/validate-test-optimization.js +0 -3
- package/packages/datadog-esbuild/src/resolver.js +0 -284
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/index.js +0 -156
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/msgpack-to-json.js +0 -287
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/payload-projection.js +0 -84
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/sink.js +0 -368
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/writer.js +0 -59
- package/vendor/dist/@opentelemetry/resources/index.js +0 -1
|
@@ -210,18 +210,6 @@ const instrumentations = [
|
|
|
210
210
|
},
|
|
211
211
|
channelName: 'dd:graphql:printer:load',
|
|
212
212
|
},
|
|
213
|
-
{
|
|
214
|
-
module: {
|
|
215
|
-
name: 'graphql',
|
|
216
|
-
versionRange: '>=0.10',
|
|
217
|
-
filePath: 'language/printer.mjs',
|
|
218
|
-
},
|
|
219
|
-
functionQuery: {
|
|
220
|
-
functionName: '__module_export__',
|
|
221
|
-
kind: 'Sync',
|
|
222
|
-
},
|
|
223
|
-
channelName: 'dd:graphql:printer:load',
|
|
224
|
-
},
|
|
225
213
|
{
|
|
226
214
|
module: {
|
|
227
215
|
name: 'graphql',
|
|
@@ -234,18 +222,6 @@ const instrumentations = [
|
|
|
234
222
|
},
|
|
235
223
|
channelName: 'dd:graphql:visitor:load',
|
|
236
224
|
},
|
|
237
|
-
{
|
|
238
|
-
module: {
|
|
239
|
-
name: 'graphql',
|
|
240
|
-
versionRange: '>=0.10',
|
|
241
|
-
filePath: 'language/visitor.mjs',
|
|
242
|
-
},
|
|
243
|
-
functionQuery: {
|
|
244
|
-
functionName: '__module_export__',
|
|
245
|
-
kind: 'Sync',
|
|
246
|
-
},
|
|
247
|
-
channelName: 'dd:graphql:visitor:load',
|
|
248
|
-
},
|
|
249
225
|
{
|
|
250
226
|
module: {
|
|
251
227
|
name: 'graphql',
|
|
@@ -258,18 +234,6 @@ const instrumentations = [
|
|
|
258
234
|
},
|
|
259
235
|
channelName: 'dd:graphql:utilities:load',
|
|
260
236
|
},
|
|
261
|
-
{
|
|
262
|
-
module: {
|
|
263
|
-
name: 'graphql',
|
|
264
|
-
versionRange: '>=0.10',
|
|
265
|
-
filePath: 'utilities/index.mjs',
|
|
266
|
-
},
|
|
267
|
-
functionQuery: {
|
|
268
|
-
functionName: '__module_export__',
|
|
269
|
-
kind: 'Sync',
|
|
270
|
-
},
|
|
271
|
-
channelName: 'dd:graphql:utilities:load',
|
|
272
|
-
},
|
|
273
237
|
]
|
|
274
238
|
|
|
275
239
|
const fastPathInstrumentations = []
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const astQuery = 'MethodDefinition[key.name="handleNextImageRequest"] > FunctionExpression, ' +
|
|
4
|
+
'AssignmentExpression[left.object.type="ThisExpression"]' +
|
|
5
|
+
'[left.property.name="handleNextImageRequest"] > ArrowFunctionExpression, ' +
|
|
6
|
+
'ObjectExpression:has(Property[key.name="name"][value.value="_next/image catchall"])' +
|
|
7
|
+
' > Property[key.name="fn"] > ArrowFunctionExpression'
|
|
8
|
+
|
|
9
|
+
module.exports = [
|
|
10
|
+
{
|
|
11
|
+
module: {
|
|
12
|
+
name: 'next',
|
|
13
|
+
versionRange: '>=10.2 <11.1',
|
|
14
|
+
filePath: 'dist/next-server/server/next-server.js',
|
|
15
|
+
},
|
|
16
|
+
functionQuery: { kind: 'Async', index: null },
|
|
17
|
+
astQuery,
|
|
18
|
+
channelName: 'imageRequest',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
module: {
|
|
22
|
+
name: 'next',
|
|
23
|
+
versionRange: '>=11.1 <15.2',
|
|
24
|
+
filePath: 'dist/server/next-server.js',
|
|
25
|
+
},
|
|
26
|
+
functionQuery: { kind: 'Async', index: null },
|
|
27
|
+
astQuery,
|
|
28
|
+
channelName: 'imageRequest',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
module: {
|
|
32
|
+
name: 'next',
|
|
33
|
+
versionRange: '>=15.2',
|
|
34
|
+
filePath: 'dist/server/next-server.js',
|
|
35
|
+
},
|
|
36
|
+
functionQuery: { kind: 'Async', index: null },
|
|
37
|
+
astQuery,
|
|
38
|
+
channelName: 'imageRequestWithMiddleware',
|
|
39
|
+
},
|
|
40
|
+
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const entries = []
|
|
4
|
+
for (const extension of ['js', 'mjs']) {
|
|
5
|
+
for (const [channelName, functionQuery] of Object.entries({
|
|
6
|
+
constructor: { methodName: 'constructor', kind: 'Sync' },
|
|
7
|
+
connect: { methodName: 'connect', kind: 'Async' },
|
|
8
|
+
send: { privateMethodName: 'sendEventNow', kind: 'Sync' },
|
|
9
|
+
close: { methodName: 'close', kind: 'Sync' },
|
|
10
|
+
})) {
|
|
11
|
+
entries.push({
|
|
12
|
+
module: {
|
|
13
|
+
name: '@openai/agents-realtime',
|
|
14
|
+
versionRange: '>=0.20.0',
|
|
15
|
+
filePath: 'dist/openaiRealtimeWebsocket.' + extension,
|
|
16
|
+
},
|
|
17
|
+
functionQuery: { className: 'OpenAIRealtimeWebSocket', ...functionQuery },
|
|
18
|
+
channelName,
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = entries
|
package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/react-router.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const instrumentations = []
|
|
4
|
+
|
|
5
|
+
for (const filePath of ['dist/development/index.js', 'dist/production/index.js']) {
|
|
6
|
+
for (const functionName of ['derive', 'matchServerRoutes']) {
|
|
7
|
+
instrumentations.push({
|
|
8
|
+
module: { name: 'react-router', versionRange: '>=7.9.5 <8', filePath },
|
|
9
|
+
functionQuery: { functionName },
|
|
10
|
+
channelName: functionName,
|
|
11
|
+
})
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const chunkFilePath = /^dist\/(?:development|production)\/chunk-[A-Z0-9]+\.mjs$/
|
|
16
|
+
for (const functionName of ['derive', 'matchServerRoutes']) {
|
|
17
|
+
instrumentations.push({
|
|
18
|
+
module: {
|
|
19
|
+
name: 'react-router',
|
|
20
|
+
versionRange: '>=7.9.5 <8',
|
|
21
|
+
filePath: chunkFilePath,
|
|
22
|
+
sourceMatch: 'function derive(',
|
|
23
|
+
},
|
|
24
|
+
functionQuery: { functionName },
|
|
25
|
+
channelName: functionName,
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
for (const mode of ['development', 'production']) {
|
|
30
|
+
instrumentations.push({
|
|
31
|
+
module: {
|
|
32
|
+
name: 'react-router',
|
|
33
|
+
versionRange: '>=8',
|
|
34
|
+
filePath: `dist/${mode}/lib/server-runtime/server.js`,
|
|
35
|
+
},
|
|
36
|
+
functionQuery: { functionName: 'derive' },
|
|
37
|
+
channelName: 'derive',
|
|
38
|
+
}, {
|
|
39
|
+
module: {
|
|
40
|
+
name: 'react-router',
|
|
41
|
+
versionRange: '>=8',
|
|
42
|
+
filePath: `dist/${mode}/lib/server-runtime/routeMatching.js`,
|
|
43
|
+
},
|
|
44
|
+
functionQuery: { functionName: 'matchServerRoutes' },
|
|
45
|
+
channelName: 'matchServerRoutes',
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
module.exports = instrumentations
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const v10Procedure = 'FunctionDeclaration[id.name="createProcedureCaller"] ' +
|
|
4
|
+
'VariableDeclarator[id.name="procedure"] > FunctionExpression[id.name="resolve"]'
|
|
5
|
+
const v11Procedure = 'FunctionDeclaration[id.name="createProcedureCaller"] FunctionDeclaration[id.name="procedure"]'
|
|
6
|
+
|
|
7
|
+
module.exports = [
|
|
8
|
+
{
|
|
9
|
+
module: { name: '@trpc/server', versionRange: '>=10.45.2 <11', filePath: 'dist/index.js' },
|
|
10
|
+
astQuery: v10Procedure,
|
|
11
|
+
functionQuery: { kind: 'Async' },
|
|
12
|
+
channelName: 'procedure',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
module: { name: '@trpc/server', versionRange: '>=10.45.2 <11', filePath: 'dist/index.mjs' },
|
|
16
|
+
astQuery: v10Procedure,
|
|
17
|
+
functionQuery: { kind: 'Async' },
|
|
18
|
+
channelName: 'procedure',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
module: {
|
|
22
|
+
name: '@trpc/server',
|
|
23
|
+
versionRange: '>=11 <11.4',
|
|
24
|
+
filePath: 'dist/unstable-core-do-not-import/procedureBuilder.js',
|
|
25
|
+
},
|
|
26
|
+
astQuery: v11Procedure,
|
|
27
|
+
functionQuery: { kind: 'Async' },
|
|
28
|
+
channelName: 'procedure',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
module: {
|
|
32
|
+
name: '@trpc/server',
|
|
33
|
+
versionRange: '>=11 <11.4',
|
|
34
|
+
filePath: 'dist/unstable-core-do-not-import/procedureBuilder.mjs',
|
|
35
|
+
},
|
|
36
|
+
astQuery: v11Procedure,
|
|
37
|
+
functionQuery: { kind: 'Async' },
|
|
38
|
+
channelName: 'procedure',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
module: {
|
|
42
|
+
name: '@trpc/server',
|
|
43
|
+
versionRange: '>=11.4',
|
|
44
|
+
filePath: /^dist\/initTRPC-[A-Za-z0-9_-]+\.cjs$/,
|
|
45
|
+
},
|
|
46
|
+
astQuery: v11Procedure,
|
|
47
|
+
functionQuery: { kind: 'Async' },
|
|
48
|
+
channelName: 'procedure',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
module: {
|
|
52
|
+
name: '@trpc/server',
|
|
53
|
+
versionRange: '>=11.4',
|
|
54
|
+
filePath: /^dist\/initTRPC-[A-Za-z0-9_-]+\.mjs$/,
|
|
55
|
+
},
|
|
56
|
+
astQuery: v11Procedure,
|
|
57
|
+
functionQuery: { kind: 'Async' },
|
|
58
|
+
channelName: 'procedure',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
module: { name: '@trpc/server', versionRange: '>=10.45.2 <11', filePath: /^dist\/nodeHTTPRequestHandler-[A-Za-z0-9_-]+\.js$/ },
|
|
62
|
+
astQuery: 'FunctionDeclaration[id.name="nodeHTTPRequestHandler"]',
|
|
63
|
+
functionQuery: { kind: 'Sync' },
|
|
64
|
+
channelName: 'request',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
module: { name: '@trpc/server', versionRange: '>=10.45.2 <11', filePath: /^dist\/nodeHTTPRequestHandler-[A-Za-z0-9_-]+\.mjs$/ },
|
|
68
|
+
astQuery: 'FunctionDeclaration[id.name="nodeHTTPRequestHandler"]',
|
|
69
|
+
functionQuery: { kind: 'Sync' },
|
|
70
|
+
channelName: 'request',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
module: {
|
|
74
|
+
name: '@trpc/server',
|
|
75
|
+
versionRange: '>=11 <11.4',
|
|
76
|
+
filePath: 'dist/adapters/node-http/nodeHTTPRequestHandler.js',
|
|
77
|
+
},
|
|
78
|
+
astQuery: 'FunctionDeclaration[id.name="nodeHTTPRequestHandler"]',
|
|
79
|
+
functionQuery: { kind: 'Sync' },
|
|
80
|
+
channelName: 'request',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
module: {
|
|
84
|
+
name: '@trpc/server',
|
|
85
|
+
versionRange: '>=11 <11.4',
|
|
86
|
+
filePath: 'dist/adapters/node-http/nodeHTTPRequestHandler.mjs',
|
|
87
|
+
},
|
|
88
|
+
astQuery: 'FunctionDeclaration[id.name="nodeHTTPRequestHandler"]',
|
|
89
|
+
functionQuery: { kind: 'Sync' },
|
|
90
|
+
channelName: 'request',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
module: { name: '@trpc/server', versionRange: '>=11.4', filePath: /^dist\/node-http-[A-Za-z0-9_-]+\.cjs$/ },
|
|
94
|
+
astQuery: 'FunctionDeclaration[id.name="nodeHTTPRequestHandler"]',
|
|
95
|
+
functionQuery: { kind: 'Sync' },
|
|
96
|
+
channelName: 'request',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
module: { name: '@trpc/server', versionRange: '>=11.4', filePath: /^dist\/node-http-[A-Za-z0-9_-]+\.mjs$/ },
|
|
100
|
+
astQuery: 'FunctionDeclaration[id.name="nodeHTTPRequestHandler"]',
|
|
101
|
+
functionQuery: { kind: 'Sync' },
|
|
102
|
+
channelName: 'request',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
module: { name: '@trpc/server', versionRange: '>=10.45.2 <11', filePath: /^dist\/resolveHTTPResponse-[A-Za-z0-9_-]+\.js$/ },
|
|
106
|
+
astQuery: 'FunctionDeclaration[id.name="resolveHTTPResponse"]',
|
|
107
|
+
transform: 'publishTrpcRequestInfo',
|
|
108
|
+
channelName: 'requestInfo',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
module: { name: '@trpc/server', versionRange: '>=10.45.2 <11', filePath: /^dist\/resolveHTTPResponse-[A-Za-z0-9_-]+\.mjs$/ },
|
|
112
|
+
astQuery: 'FunctionDeclaration[id.name="resolveHTTPResponse"]',
|
|
113
|
+
transform: 'publishTrpcRequestInfo',
|
|
114
|
+
channelName: 'requestInfo',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
module: {
|
|
118
|
+
name: '@trpc/server',
|
|
119
|
+
versionRange: '>=11 <11.4',
|
|
120
|
+
filePath: 'dist/unstable-core-do-not-import/http/contentType.js',
|
|
121
|
+
},
|
|
122
|
+
astQuery: 'FunctionDeclaration[id.name="getRequestInfo"]',
|
|
123
|
+
functionQuery: { kind: 'Async' },
|
|
124
|
+
channelName: 'requestInfo',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
module: {
|
|
128
|
+
name: '@trpc/server',
|
|
129
|
+
versionRange: '>=11 <11.4',
|
|
130
|
+
filePath: 'dist/unstable-core-do-not-import/http/contentType.mjs',
|
|
131
|
+
},
|
|
132
|
+
astQuery: 'FunctionDeclaration[id.name="getRequestInfo"]',
|
|
133
|
+
functionQuery: { kind: 'Async' },
|
|
134
|
+
channelName: 'requestInfo',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
module: { name: '@trpc/server', versionRange: '>=11.4', filePath: /^dist\/resolveResponse-[A-Za-z0-9_-]+\.cjs$/ },
|
|
138
|
+
astQuery: 'FunctionDeclaration[id.name="getRequestInfo"]',
|
|
139
|
+
functionQuery: { kind: 'Async' },
|
|
140
|
+
channelName: 'requestInfo',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
module: { name: '@trpc/server', versionRange: '>=11.4', filePath: /^dist\/resolveResponse-[A-Za-z0-9_-]+\.mjs$/ },
|
|
144
|
+
astQuery: 'FunctionDeclaration[id.name="getRequestInfo"]',
|
|
145
|
+
functionQuery: { kind: 'Async' },
|
|
146
|
+
channelName: 'requestInfo',
|
|
147
|
+
},
|
|
148
|
+
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const name = '@typesafe-ai/sdk'
|
|
4
|
+
const versionRange = '>=0.6.0'
|
|
5
|
+
const files = ['dist/index.cjs', 'dist/index.mjs']
|
|
6
|
+
|
|
7
|
+
const targets = [
|
|
8
|
+
{
|
|
9
|
+
// Sync, although it returns a promise: the SDK's `APIPromise` subclass must reach the caller unchanged
|
|
10
|
+
functionQuery: { className: 'TypeSafeClient', methodName: 'systemOne', kind: 'Sync' },
|
|
11
|
+
channelName: 'TypeSafeClient_systemOne',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
functionQuery: { className: 'APIPromise', methodName: 'constructor', kind: 'Sync' },
|
|
15
|
+
channelName: 'APIPromise_constructor',
|
|
16
|
+
},
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
module.exports = files.flatMap(filePath => targets.map(({ functionQuery, channelName }) => ({
|
|
20
|
+
module: { name, versionRange, filePath },
|
|
21
|
+
functionQuery,
|
|
22
|
+
channelName,
|
|
23
|
+
})))
|
package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js
CHANGED
|
@@ -452,6 +452,18 @@ module.exports = [
|
|
|
452
452
|
channelName: 'newWindow',
|
|
453
453
|
transform: 'waitForAsyncEnd',
|
|
454
454
|
},
|
|
455
|
+
{
|
|
456
|
+
module: {
|
|
457
|
+
name: '@wdio/utils',
|
|
458
|
+
versionRange: '>=9.0.0',
|
|
459
|
+
filePath: 'build/index.js',
|
|
460
|
+
},
|
|
461
|
+
functionQuery: {
|
|
462
|
+
expressionName: 'runSpec',
|
|
463
|
+
kind: 'Sync',
|
|
464
|
+
},
|
|
465
|
+
channelName: 'runSpec',
|
|
466
|
+
},
|
|
455
467
|
{
|
|
456
468
|
module: {
|
|
457
469
|
name: '@wdio/utils',
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "react-router",
|
|
4
|
+
"source": "^dist\\/(?:development|production)\\/chunk-[A-Z0-9]+\\.mjs$",
|
|
5
|
+
"flags": "",
|
|
6
|
+
"sourceMatch": "function derive("
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "@trpc/server",
|
|
10
|
+
"source": "^dist\\/initTRPC-[A-Za-z0-9_-]+\\.cjs$",
|
|
11
|
+
"flags": ""
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "@trpc/server",
|
|
15
|
+
"source": "^dist\\/initTRPC-[A-Za-z0-9_-]+\\.mjs$",
|
|
16
|
+
"flags": ""
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "@trpc/server",
|
|
20
|
+
"source": "^dist\\/nodeHTTPRequestHandler-[A-Za-z0-9_-]+\\.js$",
|
|
21
|
+
"flags": ""
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "@trpc/server",
|
|
25
|
+
"source": "^dist\\/nodeHTTPRequestHandler-[A-Za-z0-9_-]+\\.mjs$",
|
|
26
|
+
"flags": ""
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "@trpc/server",
|
|
30
|
+
"source": "^dist\\/node-http-[A-Za-z0-9_-]+\\.cjs$",
|
|
31
|
+
"flags": ""
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "@trpc/server",
|
|
35
|
+
"source": "^dist\\/node-http-[A-Za-z0-9_-]+\\.mjs$",
|
|
36
|
+
"flags": ""
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "@trpc/server",
|
|
40
|
+
"source": "^dist\\/resolveHTTPResponse-[A-Za-z0-9_-]+\\.js$",
|
|
41
|
+
"flags": ""
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "@trpc/server",
|
|
45
|
+
"source": "^dist\\/resolveHTTPResponse-[A-Za-z0-9_-]+\\.mjs$",
|
|
46
|
+
"flags": ""
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "@trpc/server",
|
|
50
|
+
"source": "^dist\\/resolveResponse-[A-Za-z0-9_-]+\\.cjs$",
|
|
51
|
+
"flags": ""
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "@trpc/server",
|
|
55
|
+
"source": "^dist\\/resolveResponse-[A-Za-z0-9_-]+\\.mjs$",
|
|
56
|
+
"flags": ""
|
|
57
|
+
}
|
|
58
|
+
]
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
// targets.json is generated by scripts/generate-rewriter-targets.js from ./instrumentation-registry.
|
|
4
4
|
const targets = require('./targets.json')
|
|
5
|
+
const targetPatterns = require('./target-patterns.json').map(({ name, source, flags, sourceMatch }) => ({
|
|
6
|
+
name,
|
|
7
|
+
prefix: `${name}/`,
|
|
8
|
+
pattern: new RegExp(source, flags),
|
|
9
|
+
sourceMatch,
|
|
10
|
+
}))
|
|
5
11
|
const rewriteTargetNames = new Set(Object.values(targets))
|
|
12
|
+
for (const { name } of targetPatterns) rewriteTargetNames.add(name)
|
|
6
13
|
|
|
7
14
|
const NODE_MODULES = '/node_modules/'
|
|
8
15
|
|
|
@@ -11,6 +18,7 @@ const NODE_MODULES = '/node_modules/'
|
|
|
11
18
|
* @property {string} moduleName
|
|
12
19
|
* @property {string} filePath
|
|
13
20
|
* @property {boolean} [activate]
|
|
21
|
+
* @property {string} [sourceMatch]
|
|
14
22
|
*/
|
|
15
23
|
|
|
16
24
|
/**
|
|
@@ -22,8 +30,16 @@ function getRewriteTarget (filename) {
|
|
|
22
30
|
if (nodeModulesIndex === -1) return
|
|
23
31
|
|
|
24
32
|
const modulePath = filename.slice(nodeModulesIndex + NODE_MODULES.length)
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
let moduleName = targets[modulePath]
|
|
34
|
+
let sourceMatch
|
|
35
|
+
if (!moduleName) {
|
|
36
|
+
for (const { name, prefix, pattern, sourceMatch: expectedSource } of targetPatterns) {
|
|
37
|
+
if (!modulePath.startsWith(prefix) || !pattern.test(modulePath.slice(prefix.length))) continue
|
|
38
|
+
moduleName = name
|
|
39
|
+
sourceMatch = expectedSource
|
|
40
|
+
break
|
|
41
|
+
}
|
|
42
|
+
}
|
|
27
43
|
if (typeof moduleName !== 'string') return
|
|
28
44
|
const activate = isRewriteActivationEnabled(moduleName)
|
|
29
45
|
|
|
@@ -32,6 +48,7 @@ function getRewriteTarget (filename) {
|
|
|
32
48
|
filePath: modulePath.slice(moduleName.length + 1),
|
|
33
49
|
}
|
|
34
50
|
if (activate) rewriteTarget.activate = true
|
|
51
|
+
if (sourceMatch) rewriteTarget.sourceMatch = sourceMatch
|
|
35
52
|
return rewriteTarget
|
|
36
53
|
}
|
|
37
54
|
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
"@azure/cosmos/dist/commonjs/plugins/Plugin.js": "@azure/cosmos",
|
|
7
7
|
"@azure/cosmos/dist/esm/plugins/Plugin.js": "@azure/cosmos",
|
|
8
8
|
"@azure/cosmos/dist/react-native/plugins/Plugin.js": "@azure/cosmos",
|
|
9
|
+
"@elevenlabs/elevenlabs-js/api/resources/conversationalAi/conversation/ClientTools.js": "@elevenlabs/elevenlabs-js",
|
|
10
|
+
"@elevenlabs/elevenlabs-js/api/resources/conversationalAi/conversation/Conversation.js": "@elevenlabs/elevenlabs-js",
|
|
9
11
|
"@graphql-tools/executor/cjs/execution/execute.js": "@graphql-tools/executor",
|
|
10
12
|
"@graphql-tools/executor/cjs/execution/normalizedExecutor.js": "@graphql-tools/executor",
|
|
11
13
|
"@graphql-tools/executor/esm/execution/execute.js": "@graphql-tools/executor",
|
|
@@ -30,6 +32,8 @@
|
|
|
30
32
|
"@modelcontextprotocol/sdk/dist/esm/server/mcp.js": "@modelcontextprotocol/sdk",
|
|
31
33
|
"@openai/agents-openai/dist/openaiChatCompletionsModel.js": "@openai/agents-openai",
|
|
32
34
|
"@openai/agents-openai/dist/openaiChatCompletionsModel.mjs": "@openai/agents-openai",
|
|
35
|
+
"@openai/agents-realtime/dist/openaiRealtimeWebsocket.js": "@openai/agents-realtime",
|
|
36
|
+
"@openai/agents-realtime/dist/openaiRealtimeWebsocket.mjs": "@openai/agents-realtime",
|
|
33
37
|
"@playwright/test/lib/reporters/multiplexer.js": "@playwright/test",
|
|
34
38
|
"@supabase/auth-js/dist/main/GoTrueClient.js": "@supabase/auth-js",
|
|
35
39
|
"@supabase/auth-js/dist/module/GoTrueClient.js": "@supabase/auth-js",
|
|
@@ -41,6 +45,16 @@
|
|
|
41
45
|
"@supabase/realtime-js/dist/module/RealtimeChannel.js": "@supabase/realtime-js",
|
|
42
46
|
"@supabase/storage-js/dist/index.cjs": "@supabase/storage-js",
|
|
43
47
|
"@supabase/storage-js/dist/index.mjs": "@supabase/storage-js",
|
|
48
|
+
"@trpc/server/dist/adapters/node-http/nodeHTTPRequestHandler.js": "@trpc/server",
|
|
49
|
+
"@trpc/server/dist/adapters/node-http/nodeHTTPRequestHandler.mjs": "@trpc/server",
|
|
50
|
+
"@trpc/server/dist/index.js": "@trpc/server",
|
|
51
|
+
"@trpc/server/dist/index.mjs": "@trpc/server",
|
|
52
|
+
"@trpc/server/dist/unstable-core-do-not-import/http/contentType.js": "@trpc/server",
|
|
53
|
+
"@trpc/server/dist/unstable-core-do-not-import/http/contentType.mjs": "@trpc/server",
|
|
54
|
+
"@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.js": "@trpc/server",
|
|
55
|
+
"@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs": "@trpc/server",
|
|
56
|
+
"@typesafe-ai/sdk/dist/index.cjs": "@typesafe-ai/sdk",
|
|
57
|
+
"@typesafe-ai/sdk/dist/index.mjs": "@typesafe-ai/sdk",
|
|
44
58
|
"@vitest/runner/dist/chunk-hooks.js": "@vitest/runner",
|
|
45
59
|
"@vitest/runner/dist/index.js": "@vitest/runner",
|
|
46
60
|
"@wdio/cli/build/index.js": "@wdio/cli",
|
|
@@ -52,6 +66,9 @@
|
|
|
52
66
|
"@wdio/utils/build/index.js": "@wdio/utils",
|
|
53
67
|
"ai/dist/index.js": "ai",
|
|
54
68
|
"ai/dist/index.mjs": "ai",
|
|
69
|
+
"async-mutex/es6/Semaphore.js": "async-mutex",
|
|
70
|
+
"async-mutex/index.mjs": "async-mutex",
|
|
71
|
+
"async-mutex/lib/Semaphore.js": "async-mutex",
|
|
55
72
|
"bullmq/dist/cjs/classes/flow-producer.js": "bullmq",
|
|
56
73
|
"bullmq/dist/cjs/classes/queue.js": "bullmq",
|
|
57
74
|
"bullmq/dist/cjs/classes/worker.js": "bullmq",
|
|
@@ -70,11 +87,8 @@
|
|
|
70
87
|
"graphql/language/parser.js": "graphql",
|
|
71
88
|
"graphql/language/parser.mjs": "graphql",
|
|
72
89
|
"graphql/language/printer.js": "graphql",
|
|
73
|
-
"graphql/language/printer.mjs": "graphql",
|
|
74
90
|
"graphql/language/visitor.js": "graphql",
|
|
75
|
-
"graphql/language/visitor.mjs": "graphql",
|
|
76
91
|
"graphql/utilities/index.js": "graphql",
|
|
77
|
-
"graphql/utilities/index.mjs": "graphql",
|
|
78
92
|
"graphql/validation/validate.js": "graphql",
|
|
79
93
|
"graphql/validation/validate.mjs": "graphql",
|
|
80
94
|
"jasmine-core/lib/jasmine-core/jasmine.js": "jasmine-core",
|
|
@@ -82,6 +96,8 @@
|
|
|
82
96
|
"jest-runner/build/runTest.js": "jest-runner",
|
|
83
97
|
"jest-runner/build/testWorker.js": "jest-runner",
|
|
84
98
|
"mercurius/index.js": "mercurius",
|
|
99
|
+
"next/dist/next-server/server/next-server.js": "next",
|
|
100
|
+
"next/dist/server/next-server.js": "next",
|
|
85
101
|
"playwright-core/lib/coreBundle.js": "playwright-core",
|
|
86
102
|
"playwright/lib/common/config.js": "playwright",
|
|
87
103
|
"playwright/lib/common/index.js": "playwright",
|
|
@@ -95,6 +111,12 @@
|
|
|
95
111
|
"postgres/src/connection.js": "postgres",
|
|
96
112
|
"postgres/src/index.js": "postgres",
|
|
97
113
|
"postgres/src/query.js": "postgres",
|
|
114
|
+
"react-router/dist/development/index.js": "react-router",
|
|
115
|
+
"react-router/dist/development/lib/server-runtime/routeMatching.js": "react-router",
|
|
116
|
+
"react-router/dist/development/lib/server-runtime/server.js": "react-router",
|
|
117
|
+
"react-router/dist/production/index.js": "react-router",
|
|
118
|
+
"react-router/dist/production/lib/server-runtime/routeMatching.js": "react-router",
|
|
119
|
+
"react-router/dist/production/lib/server-runtime/server.js": "react-router",
|
|
98
120
|
"webdriver/build/index.js": "webdriver",
|
|
99
121
|
"webdriver/build/node.js": "webdriver",
|
|
100
122
|
"webdriverio/build/index.js": "webdriverio",
|
|
@@ -27,9 +27,44 @@ module.exports = {
|
|
|
27
27
|
configureGraphqlFastPath,
|
|
28
28
|
configureMercuriusRequest,
|
|
29
29
|
publishDurableOrchestrationFailure,
|
|
30
|
+
publishTrpcRequestInfo,
|
|
30
31
|
waitForAsyncEnd,
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
/**
|
|
35
|
+
* @param {{ channelName: string, transforms: { tracingChannelDeclaration: Function } }} state
|
|
36
|
+
* @param {import('estree').FunctionDeclaration} node
|
|
37
|
+
* @param {import('estree').Node} _parent
|
|
38
|
+
* @param {import('estree').Node[]} ancestry
|
|
39
|
+
*/
|
|
40
|
+
function publishTrpcRequestInfo (state, node, _parent, ancestry) {
|
|
41
|
+
let insertionBlock
|
|
42
|
+
let insertionIndex = -1
|
|
43
|
+
for (const block of query(node, 'TryStatement > BlockStatement')) {
|
|
44
|
+
for (let index = 0; index < block.body.length; index++) {
|
|
45
|
+
const statement = block.body[index]
|
|
46
|
+
if (statement.type !== 'ExpressionStatement' || statement.expression.type !== 'AssignmentExpression' ||
|
|
47
|
+
statement.expression.left.name !== 'paths') continue
|
|
48
|
+
|
|
49
|
+
assert.strictEqual(insertionBlock, undefined, 'publishTrpcRequestInfo: multiple paths assignments')
|
|
50
|
+
insertionBlock = block
|
|
51
|
+
insertionIndex = index
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
assert(insertionBlock, 'publishTrpcRequestInfo: paths assignment not found')
|
|
55
|
+
|
|
56
|
+
state.transforms.tracingChannelDeclaration(state, ancestry.at(-1))
|
|
57
|
+
const channelVariable = `tr_ch_apm$${state.channelName.replaceAll(/[^\w]/g, '_')}`
|
|
58
|
+
insertionBlock.body.splice(insertionIndex + 1, 0, ...parse(`
|
|
59
|
+
if (${channelVariable}.asyncEnd.hasSubscribers) {
|
|
60
|
+
${channelVariable}.asyncEnd.publish({ result: {
|
|
61
|
+
isBatchCall,
|
|
62
|
+
path: paths.length === 1 ? paths[0] : undefined
|
|
63
|
+
} })
|
|
64
|
+
}
|
|
65
|
+
`).body)
|
|
66
|
+
}
|
|
67
|
+
|
|
33
68
|
/**
|
|
34
69
|
* Publishes the error captured by Durable Functions immediately before its
|
|
35
70
|
* executor converts that error into a serialized failed orchestration state.
|
|
@@ -243,8 +278,10 @@ function createAwaitedContextCallback (state, insertionTarget, ancestry) {
|
|
|
243
278
|
/**
|
|
244
279
|
* @param {object} _state
|
|
245
280
|
* @param {import('estree').FunctionDeclaration} node
|
|
281
|
+
* @param {import('estree').Node} _parent
|
|
282
|
+
* @param {import('estree').Node[]} ancestry
|
|
246
283
|
*/
|
|
247
|
-
function configureGraphqlJitCompileObject (_state, node) {
|
|
284
|
+
function configureGraphqlJitCompileObject (_state, node, _parent, ancestry) {
|
|
248
285
|
const resolverConditions = query(node, 'IfStatement[test.name="resolver"]')
|
|
249
286
|
const compileTypeCalls = query(node, 'CallExpression[callee.name="compileType"]')
|
|
250
287
|
|
|
@@ -284,7 +321,7 @@ function configureGraphqlJitCompileObject (_state, node) {
|
|
|
284
321
|
DD_FIELD_NODES,
|
|
285
322
|
originPaths,
|
|
286
323
|
ddTraceArguments,
|
|
287
|
-
|
|
324
|
+
DD_STRINGIFY,
|
|
288
325
|
DD_COMPILED
|
|
289
326
|
)
|
|
290
327
|
: undefined
|
|
@@ -293,6 +330,26 @@ function configureGraphqlJitCompileObject (_state, node) {
|
|
|
293
330
|
replaceIdentifier(inlineField, 'DD_FIELD_NODES', clone(compileTypeCall.arguments[3]))
|
|
294
331
|
replaceIdentifier(inlineField, 'DD_COMPILED', inlineCompileCall)
|
|
295
332
|
|
|
333
|
+
const program = ancestry.find(ancestor => ancestor.type === 'Program')
|
|
334
|
+
let stringify = parse('objectStringify').body[0].expression
|
|
335
|
+
if (query(program, 'FunctionDeclaration[id.name="objectStringify"]').length === 0) {
|
|
336
|
+
const values = queryOne(
|
|
337
|
+
program,
|
|
338
|
+
'FunctionDeclaration[id.name="compileArguments"][params.1.name="args"]' +
|
|
339
|
+
':has(VariableDeclarator[id.name="bind"]) VariableDeclarator[id.name="valuesExpression"]'
|
|
340
|
+
)
|
|
341
|
+
assert(values?.init, 'configureGraphqlJitCompileObject: argument serializer not found')
|
|
342
|
+
stringify = parse(`
|
|
343
|
+
(values, hoist) => {
|
|
344
|
+
const args = { values, types: ddTraceArguments.types }
|
|
345
|
+
const bind = value => '__context.literals.' + hoist(value)
|
|
346
|
+
return DD_VALUES
|
|
347
|
+
}
|
|
348
|
+
`).body[0].expression
|
|
349
|
+
replaceIdentifier(stringify, 'DD_VALUES', values.init)
|
|
350
|
+
}
|
|
351
|
+
replaceIdentifier(inlineField, 'DD_STRINGIFY', stringify)
|
|
352
|
+
|
|
296
353
|
assert(
|
|
297
354
|
insertBeforeStatement(node.body, resolverCondition, [...defaultSetup, inlineField]),
|
|
298
355
|
'configureGraphqlJitCompileObject: could not insert default field setup'
|