@depup/dd-trace 6.16.0-depup.0 → 6.18.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/changes.json +1 -1
- package/ci/diagnose.js +0 -23
- package/ci/test-optimization-validation/approval-artifacts.js +0 -3
- package/ci/test-optimization-validation/approval.js +0 -6
- package/ci/test-optimization-validation/artifact-id.js +0 -1
- package/ci/test-optimization-validation/bounded-json.js +0 -1
- package/ci/test-optimization-validation/cli.js +0 -12
- package/ci/test-optimization-validation/command-output-policy.js +0 -1
- package/ci/test-optimization-validation/command-runner.js +0 -3
- package/ci/test-optimization-validation/environment.js +0 -4
- package/ci/test-optimization-validation/executable-approval.js +0 -1
- package/ci/test-optimization-validation/executable.js +0 -5
- package/ci/test-optimization-validation/framework-adapters/cucumber.js +0 -6
- package/ci/test-optimization-validation/framework-adapters/cypress.js +0 -3
- package/ci/test-optimization-validation/framework-adapters/playwright.js +0 -6
- package/ci/test-optimization-validation/framework-adapters/vitest.js +0 -4
- package/ci/test-optimization-validation/generated-test-contract.js +0 -5
- package/ci/test-optimization-validation/generated-verifier.js +0 -1
- package/ci/test-optimization-validation/literal-environment.js +0 -1
- package/ci/test-optimization-validation/manifest-scaffold.js +0 -17
- package/ci/test-optimization-validation/manifest-schema.js +0 -21
- package/ci/test-optimization-validation/offline-fixtures.js +0 -4
- package/ci/test-optimization-validation/plan-writer.js +0 -11
- package/ci/test-optimization-validation/preflight-runner.js +0 -1
- package/ci/test-optimization-validation/redaction.js +0 -4
- package/ci/test-optimization-validation/report-writer.js +0 -16
- package/ci/test-optimization-validation/runner-command.js +0 -3
- package/ci/test-optimization-validation/runner-contract.js +0 -4
- package/ci/test-optimization-validation/safe-files.js +0 -1
- package/ci/test-optimization-validation/scenarios/basic-reporting.js +0 -1
- package/ci/test-optimization-validation/scenarios/ci-wiring.js +0 -1
- package/ci/test-optimization-validation/source-text.js +0 -3
- package/ci/vitest-no-worker-init-setup.mjs +41 -16
- package/index.d.ts +208 -0
- package/package.json +19 -18
- package/packages/datadog-esbuild/src/utils.js +0 -2
- package/packages/datadog-instrumentations/src/aerospike.js +28 -6
- package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js.js +0 -2
- package/packages/datadog-instrumentations/src/aws-sdk.js +0 -2
- package/packages/datadog-instrumentations/src/claude-agent-sdk.js +0 -2
- package/packages/datadog-instrumentations/src/console.js +97 -0
- package/packages/datadog-instrumentations/src/cucumber.js +77 -12
- package/packages/datadog-instrumentations/src/cypress-config.js +27 -38
- package/packages/datadog-instrumentations/src/helpers/bundler-register.js +6 -0
- package/packages/datadog-instrumentations/src/helpers/channel.js +0 -2
- package/packages/datadog-instrumentations/src/helpers/check-require-cache.js +2 -1
- package/packages/datadog-instrumentations/src/helpers/graphql-jit-runtime.js +0 -5
- package/packages/datadog-instrumentations/src/helpers/hooks.js +8 -6
- package/packages/datadog-instrumentations/src/helpers/instrumentation-utils.js +0 -3
- package/packages/datadog-instrumentations/src/helpers/pool-acquire.js +0 -6
- package/packages/datadog-instrumentations/src/helpers/register.js +24 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +111 -26
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentation-registry.js +41 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +3 -17
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/playwright.js +55 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/postgres.js +36 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/supabase.js +128 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js +13 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.js +28 -3
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +20 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms/postgres.js +388 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +0 -5
- package/packages/datadog-instrumentations/src/helpers/router-helper.js +0 -1
- package/packages/datadog-instrumentations/src/jest.js +165 -51
- package/packages/datadog-instrumentations/src/knex.js +0 -1
- package/packages/datadog-instrumentations/src/mariadb-bundle.js +0 -24
- package/packages/datadog-instrumentations/src/mariadb.js +0 -2
- package/packages/datadog-instrumentations/src/mocha/common.js +0 -1
- package/packages/datadog-instrumentations/src/mocha/main.js +25 -26
- package/packages/datadog-instrumentations/src/mocha/utils.js +119 -49
- package/packages/datadog-instrumentations/src/mocha/webdriverio-protocol.js +0 -6
- package/packages/datadog-instrumentations/src/mocha/worker.js +14 -17
- package/packages/datadog-instrumentations/src/mysql2.js +0 -2
- package/packages/datadog-instrumentations/src/openai-realtime/audio-accumulator.js +241 -0
- package/packages/datadog-instrumentations/src/openai-realtime/events.js +76 -0
- package/packages/datadog-instrumentations/src/openai-realtime/index.js +301 -0
- package/packages/datadog-instrumentations/src/openai-realtime/session.js +998 -0
- package/packages/datadog-instrumentations/src/openai-realtime/turns.js +211 -0
- package/packages/datadog-instrumentations/src/openai.js +51 -12
- package/packages/datadog-instrumentations/src/oracledb.js +9 -3
- package/packages/datadog-instrumentations/src/playwright-reporter.js +6 -20
- package/packages/datadog-instrumentations/src/playwright.js +280 -56
- package/packages/datadog-instrumentations/src/{azure-cosmos.js → postgres.js} +1 -1
- package/packages/datadog-instrumentations/src/router.js +0 -2
- package/packages/datadog-instrumentations/src/rum-browser-scripts.js +0 -2
- package/packages/datadog-instrumentations/src/sequelize.js +0 -1
- package/packages/datadog-instrumentations/src/supabase.js +15 -0
- package/packages/datadog-instrumentations/src/undici.js +7 -3
- package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +18 -18
- package/packages/datadog-instrumentations/src/vitest-main.js +121 -30
- package/packages/datadog-instrumentations/src/vitest-util.js +7 -1
- package/packages/datadog-instrumentations/src/vitest-worker.js +49 -13
- package/packages/datadog-instrumentations/src/webdriverio.js +44 -47
- package/packages/datadog-instrumentations/src/ws.js +41 -2
- package/packages/datadog-plugin-ai/src/utils.js +0 -2
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/trace-checkpoint.js +0 -1
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/util.js +0 -2
- package/packages/datadog-plugin-aws-sdk/src/base.js +0 -1
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +0 -1
- package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +0 -1
- package/packages/datadog-plugin-aws-sdk/src/util.js +0 -1
- package/packages/datadog-plugin-azure-durable-functions/src/index.js +0 -1
- package/packages/datadog-plugin-cucumber/src/index.js +9 -0
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +211 -85
- package/packages/datadog-plugin-cypress/src/finalization.js +0 -3
- package/packages/datadog-plugin-cypress/src/index.js +3 -1
- package/packages/datadog-plugin-cypress/src/source-map-utils.js +0 -4
- package/packages/datadog-plugin-cypress/src/support.js +52 -7
- package/packages/datadog-plugin-graphql/src/resolve-error.js +1 -2
- package/packages/datadog-plugin-graphql/src/utils.js +0 -5
- package/packages/datadog-plugin-jest/src/index.js +12 -0
- package/packages/datadog-plugin-kafkajs/src/producer.js +0 -1
- package/packages/datadog-plugin-mocha/src/index.js +38 -11
- package/packages/datadog-plugin-mongodb-core/src/query.js +0 -1
- package/packages/datadog-plugin-openai/src/index.js +16 -1
- package/packages/datadog-plugin-openai/src/realtime.js +144 -0
- package/packages/datadog-plugin-openai-agents/src/integration.js +0 -4
- package/packages/datadog-plugin-openai-agents/src/util.js +0 -1
- package/packages/datadog-plugin-playwright/src/index.js +81 -9
- package/packages/datadog-plugin-postgres/src/index.js +167 -0
- package/packages/datadog-plugin-prisma/src/datadog-tracing-helper.js +0 -1
- package/packages/datadog-plugin-redis/src/index.js +15 -1
- package/packages/datadog-plugin-supabase/src/error.js +18 -0
- package/packages/datadog-plugin-supabase/src/index.js +21 -0
- package/packages/datadog-plugin-supabase/src/supabase-auth-js-gotrueclient-getuser.js +69 -0
- package/packages/datadog-plugin-supabase/src/supabase-functions-js-functionsclient-invoke.js +70 -0
- package/packages/datadog-plugin-supabase/src/supabase-postgrest-js-postgrestbuilder-then.js +122 -0
- package/packages/datadog-plugin-supabase/src/supabase-realtime-js-realtimechannel-send.js +66 -0
- package/packages/datadog-plugin-supabase/src/supabase-storage-js-handle-request.js +93 -0
- package/packages/datadog-plugin-supabase/src/url.js +17 -0
- package/packages/datadog-plugin-vitest/src/index.js +9 -0
- package/packages/datadog-plugin-ws/src/producer.js +1 -1
- package/packages/datadog-plugin-ws/src/util.js +0 -4
- package/packages/datadog-shimmer/src/shimmer.js +14 -10
- package/packages/datadog-turbopack/index.js +4 -7
- package/packages/datadog-turbopack/src/loader.js +6 -18
- package/packages/datadog-webpack/src/loader.js +0 -1
- package/packages/dd-trace/src/agent/info.js +5 -4
- package/packages/dd-trace/src/aiguard/client.js +2 -3
- package/packages/dd-trace/src/aiguard/evaluation.js +6 -12
- package/packages/dd-trace/src/aiguard/index.js +2 -2
- package/packages/dd-trace/src/aiguard/integrations/index.js +1 -1
- package/packages/dd-trace/src/aiguard/integrations/openai.js +81 -7
- package/packages/dd-trace/src/aiguard/messages/anthropic.js +0 -2
- package/packages/dd-trace/src/aiguard/messages/openai.js +64 -1
- package/packages/dd-trace/src/aiguard/messages/utils.js +0 -1
- package/packages/dd-trace/src/aiguard/redaction.js +0 -1
- package/packages/dd-trace/src/aiguard/sdk.js +1 -1
- package/packages/dd-trace/src/appsec/activation.js +1 -1
- package/packages/dd-trace/src/appsec/api_security/normalized-route.js +0 -5
- package/packages/dd-trace/src/appsec/api_security/sampler.js +0 -4
- package/packages/dd-trace/src/appsec/blocking/index.js +3 -3
- package/packages/dd-trace/src/appsec/downstream_requests.js +1 -4
- package/packages/dd-trace/src/appsec/iast/index.js +1 -1
- package/packages/dd-trace/src/appsec/iast/overhead-controller.js +5 -5
- package/packages/dd-trace/src/appsec/iast/taint-tracking/index.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +3 -3
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/sql-sensitive-analyzer.js +8 -10
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +2 -2
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +4 -1
- package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +7 -7
- package/packages/dd-trace/src/appsec/index.js +2 -2
- package/packages/dd-trace/src/appsec/lambda.js +71 -2
- package/packages/dd-trace/src/appsec/rasp/utils.js +5 -1
- package/packages/dd-trace/src/appsec/remote_config.js +8 -6
- package/packages/dd-trace/src/appsec/reporter.js +10 -6
- package/packages/dd-trace/src/appsec/rule_manager.js +3 -3
- package/packages/dd-trace/src/appsec/sdk/track_event.js +0 -2
- package/packages/dd-trace/src/appsec/waf/index.js +2 -2
- package/packages/dd-trace/src/appsec/waf/waf_manager.js +8 -5
- package/packages/dd-trace/src/carrier.js +0 -5
- package/packages/dd-trace/src/ci-visibility/dynamic-atr-retries.js +104 -0
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +0 -2
- package/packages/dd-trace/src/ci-visibility/efd-retry-policy.js +34 -3
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/index.js +0 -4
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/msgpack-to-json.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/sink.js +0 -2
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +37 -15
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +0 -3
- package/packages/dd-trace/src/ci-visibility/exporters/request.js +0 -11
- package/packages/dd-trace/src/ci-visibility/exporters/settings-cache-key.js +0 -1
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +0 -1
- package/packages/dd-trace/src/ci-visibility/requests/fs-cache.js +0 -6
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +2 -2
- package/packages/dd-trace/src/ci-visibility/requests/rate-limit.js +0 -1
- package/packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js +0 -5
- package/packages/dd-trace/src/ci-visibility/requests/video-request.js +0 -1
- package/packages/dd-trace/src/ci-visibility/telemetry.js +13 -0
- package/packages/dd-trace/src/ci-visibility/test-optimization-cache.js +0 -1
- package/packages/dd-trace/src/ci-visibility/test-screenshot.js +0 -2
- package/packages/dd-trace/src/ci-visibility/test-video.js +0 -1
- package/packages/dd-trace/src/config/defaults.js +3 -2
- package/packages/dd-trace/src/config/generated-config-types.d.ts +88 -82
- package/packages/dd-trace/src/config/helper.js +0 -1
- package/packages/dd-trace/src/config/index.js +31 -30
- package/packages/dd-trace/src/config/parsers.js +34 -6
- package/packages/dd-trace/src/config/remote_config.js +25 -109
- package/packages/dd-trace/src/config/supported-configurations.json +150 -10
- package/packages/dd-trace/src/datastreams/encoding.js +0 -1
- package/packages/dd-trace/src/datastreams/pathway.js +0 -1
- package/packages/dd-trace/src/debugger/constants.js +10 -0
- package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +62 -10
- package/packages/dd-trace/src/debugger/devtools_client/config.js +4 -1
- package/packages/dd-trace/src/debugger/devtools_client/guardrail-metrics.js +15 -0
- package/packages/dd-trace/src/debugger/devtools_client/index.js +103 -27
- package/packages/dd-trace/src/debugger/devtools_client/json-buffer.js +50 -7
- package/packages/dd-trace/src/debugger/devtools_client/log.js +3 -1
- package/packages/dd-trace/src/debugger/devtools_client/probe_sampler.js +21 -8
- package/packages/dd-trace/src/debugger/devtools_client/send.js +41 -15
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +53 -13
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +118 -71
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/redaction.js +5 -3
- package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +0 -3
- package/packages/dd-trace/src/debugger/devtools_client/status.js +21 -7
- package/packages/dd-trace/src/debugger/guardrail-metrics.js +167 -0
- package/packages/dd-trace/src/debugger/index.js +51 -3
- package/packages/dd-trace/src/debugger/inspect-segment.js +0 -3
- package/packages/dd-trace/src/debugger/probe_sampler.js +133 -9
- package/packages/dd-trace/src/debugger/probe_sampler_constants.js +31 -1
- package/packages/dd-trace/src/dogstatsd.js +0 -23
- package/packages/dd-trace/src/encode/0.4-cross-payload.js +0 -3
- package/packages/dd-trace/src/encode/0.4.js +0 -7
- package/packages/dd-trace/src/encode/0.5.js +0 -2
- package/packages/dd-trace/src/encode/tags-processors.js +0 -1
- package/packages/dd-trace/src/evp_proxy/constants.js +2 -0
- package/packages/dd-trace/src/evp_proxy/direct.js +17 -13
- package/packages/dd-trace/src/evp_proxy/discovery.js +14 -11
- package/packages/dd-trace/src/evp_proxy/path.js +21 -9
- package/packages/dd-trace/src/exporters/agent/writer.js +0 -1
- package/packages/dd-trace/src/exporters/agentless/index.js +0 -1
- package/packages/dd-trace/src/exporters/agentless/intake.js +0 -1
- package/packages/dd-trace/src/exporters/agentless/writer.js +0 -3
- package/packages/dd-trace/src/exporters/common/final-flush-request-tracker.js +0 -6
- package/packages/dd-trace/src/exporters/common/request.js +1 -0
- package/packages/dd-trace/src/exporters/common/url.js +33 -4
- package/packages/dd-trace/src/exporters/common/writer.js +0 -2
- package/packages/dd-trace/src/id.js +0 -11
- package/packages/dd-trace/src/llmobs/audio-codec.js +192 -0
- package/packages/dd-trace/src/llmobs/audio-utils.js +121 -0
- package/packages/dd-trace/src/llmobs/constants/audio.js +35 -0
- package/packages/dd-trace/src/llmobs/constants/prompts.js +14 -0
- package/packages/dd-trace/src/llmobs/constants/tags.js +17 -0
- package/packages/dd-trace/src/llmobs/eval-metric.js +0 -6
- package/packages/dd-trace/src/llmobs/experiments/dataset.js +0 -4
- package/packages/dd-trace/src/llmobs/experiments/experiment.js +0 -3
- package/packages/dd-trace/src/llmobs/experiments/index.js +7 -6
- package/packages/dd-trace/src/llmobs/experiments/util.js +1 -11
- package/packages/dd-trace/src/llmobs/index.js +1 -3
- package/packages/dd-trace/src/llmobs/noop.js +10 -0
- package/packages/dd-trace/src/llmobs/plugins/ai/util.js +0 -4
- package/packages/dd-trace/src/llmobs/plugins/anthropic/util.js +0 -1
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +0 -4
- package/packages/dd-trace/src/llmobs/plugins/modelcontextprotocol-sdk/utils.js +0 -2
- package/packages/dd-trace/src/llmobs/plugins/openai/constants.js +0 -2
- package/packages/dd-trace/src/llmobs/plugins/openai/index.js +4 -6
- package/packages/dd-trace/src/llmobs/plugins/openai/realtime.js +285 -0
- package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +16 -3
- package/packages/dd-trace/src/llmobs/prompts/cache.js +272 -0
- package/packages/dd-trace/src/llmobs/prompts/manager.js +647 -0
- package/packages/dd-trace/src/llmobs/prompts/noop.js +29 -0
- package/packages/dd-trace/src/llmobs/prompts/prompt.js +158 -0
- package/packages/dd-trace/src/llmobs/sdk.js +21 -6
- package/packages/dd-trace/src/llmobs/span_processor.js +81 -2
- package/packages/dd-trace/src/llmobs/tagger.js +39 -11
- package/packages/dd-trace/src/llmobs/telemetry.js +36 -4
- package/packages/dd-trace/src/llmobs/util.js +0 -34
- package/packages/dd-trace/src/llmobs/writers/base.js +0 -1
- package/packages/dd-trace/src/llmobs/writers/util.js +1 -2
- package/packages/dd-trace/src/log/channels.js +3 -0
- package/packages/dd-trace/src/log/index.js +23 -5
- package/packages/dd-trace/src/log-submission/log-submission-plugin.js +74 -6
- package/packages/dd-trace/src/msgpack/chunk.js +0 -1
- package/packages/dd-trace/src/openfeature/agentless_configuration_source.js +0 -12
- package/packages/dd-trace/src/openfeature/configuration_source.js +4 -1
- package/packages/dd-trace/src/openfeature/encoding.js +0 -2
- package/packages/dd-trace/src/openfeature/eval-metrics-hook.js +0 -1
- package/packages/dd-trace/src/openfeature/flagging_provider.js +3 -3
- package/packages/dd-trace/src/openfeature/index.js +6 -6
- package/packages/dd-trace/src/openfeature/span-enrichment-hook.js +0 -1
- package/packages/dd-trace/src/openfeature/span-enrichment.js +0 -4
- package/packages/dd-trace/src/openfeature/writers/base.js +90 -23
- package/packages/dd-trace/src/openfeature/writers/exposures.js +4 -5
- package/packages/dd-trace/src/openfeature/writers/util.js +104 -37
- package/packages/dd-trace/src/opentelemetry/logs/logger.js +0 -1
- package/packages/dd-trace/src/opentelemetry/logs/logger_provider.js +0 -1
- package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +0 -1
- package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +0 -2
- package/packages/dd-trace/src/opentelemetry/metrics/meter_provider.js +0 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_transformer.js +0 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +0 -1
- package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +1 -14
- package/packages/dd-trace/src/opentelemetry/metrics/time.js +0 -1
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +30 -13
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +0 -1
- package/packages/dd-trace/src/opentelemetry/span-helpers.js +0 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +0 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +0 -3
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +0 -6
- package/packages/dd-trace/src/opentracing/span_context.js +0 -1
- package/packages/dd-trace/src/opentracing/tracer.js +3 -3
- package/packages/dd-trace/src/otel-thread-ctx.js +38 -11
- package/packages/dd-trace/src/payload-tagging/tagging.js +15 -3
- package/packages/dd-trace/src/plugin_manager.js +27 -8
- package/packages/dd-trace/src/plugins/ci_plugin.js +1 -2
- package/packages/dd-trace/src/plugins/database.js +2 -6
- package/packages/dd-trace/src/plugins/index.js +7 -0
- package/packages/dd-trace/src/plugins/plugin.js +0 -4
- package/packages/dd-trace/src/plugins/tracing.js +1 -1
- package/packages/dd-trace/src/plugins/util/git.js +1 -3
- package/packages/dd-trace/src/plugins/util/http-otel-semantics.js +0 -1
- package/packages/dd-trace/src/plugins/util/llm.js +0 -2
- package/packages/dd-trace/src/plugins/util/status-validator.js +0 -1
- package/packages/dd-trace/src/plugins/util/test.js +26 -20
- package/packages/dd-trace/src/plugins/util/url.js +0 -5
- package/packages/dd-trace/src/priority_sampler.js +0 -6
- package/packages/dd-trace/src/process-tags/index.js +0 -1
- package/packages/dd-trace/src/profiler.js +132 -35
- package/packages/dd-trace/src/profiling/exporters/event_serializer.js +0 -1
- package/packages/dd-trace/src/profiling/profiler.js +101 -41
- package/packages/dd-trace/src/profiling/ssi-heuristics.js +29 -15
- package/packages/dd-trace/src/propagation-hash/index.js +0 -1
- package/packages/dd-trace/src/proxy.js +23 -47
- package/packages/dd-trace/src/random_sampler.js +0 -4
- package/packages/dd-trace/src/rate_limiter.js +0 -4
- package/packages/dd-trace/src/remote_config/capabilities.js +1 -9
- package/packages/dd-trace/src/remote_config/index.js +0 -1
- package/packages/dd-trace/src/runtime_metrics/otlp_runtime_metrics.js +0 -3
- package/packages/dd-trace/src/sampler.js +0 -4
- package/packages/dd-trace/src/sampling_rule.js +0 -7
- package/packages/dd-trace/src/serverless/vercel.js +0 -1
- package/packages/dd-trace/src/serverless.js +0 -1
- package/packages/dd-trace/src/service-naming/index.js +0 -1
- package/packages/dd-trace/src/service-naming/schemas/util.js +0 -1
- package/packages/dd-trace/src/service-naming/schemas/v0/storage.js +7 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/storage.js +5 -0
- package/packages/dd-trace/src/span_processor.js +2 -2
- package/packages/dd-trace/src/span_sampler.js +0 -1
- package/packages/dd-trace/src/standalone/product.js +2 -2
- package/packages/dd-trace/src/standalone/tracesource.js +0 -1
- package/packages/dd-trace/src/startup-log.js +1 -1
- package/packages/dd-trace/src/telemetry/endpoints.js +0 -8
- package/packages/dd-trace/src/telemetry/logs/index.js +16 -5
- package/packages/dd-trace/src/telemetry/logs/log-collector.js +16 -6
- package/packages/dd-trace/src/telemetry/metrics.js +0 -2
- package/packages/dd-trace/src/telemetry/send-data.js +2 -1
- package/packages/dd-trace/src/telemetry/telemetry.js +4 -1
- package/packages/dd-trace/src/tracer.js +5 -4
- package/packages/dd-trace/src/util.js +13 -1
- package/vendor/dist/@datadog/openfeature-node-server/index.js +1 -1
- package/packages/datadog-instrumentations/src/bullmq.js +0 -11
- package/packages/datadog-instrumentations/src/langchain.js +0 -7
- package/packages/datadog-instrumentations/src/langgraph.js +0 -7
- package/packages/datadog-instrumentations/src/mercurius.js +0 -11
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
const { readFileSync } = require('node:fs')
|
|
4
4
|
const { join } = require('node:path')
|
|
5
|
-
const { pathToFileURL } = require('node:url')
|
|
5
|
+
const { fileURLToPath, pathToFileURL } = require('node:url')
|
|
6
6
|
|
|
7
7
|
const log = require('../../../../dd-trace/src/log')
|
|
8
|
+
const { getDisabledInstrumentations } = require('../instrumentation-utils')
|
|
8
9
|
const instrumentations = require('./instrumentations')
|
|
9
10
|
const { getRewriteTarget } = require('./targets')
|
|
10
11
|
|
|
@@ -18,7 +19,7 @@ const { getRewriteTarget } = require('./targets')
|
|
|
18
19
|
* { code: string, map?: string|object }} transform
|
|
19
20
|
*
|
|
20
21
|
* @typedef {(content: string|Buffer|ArrayBuffer|Uint8Array, filename: string, format?: string,
|
|
21
|
-
* target?: { moduleName: string, filePath: string }, sourceMap?: string|object) =>
|
|
22
|
+
* target?: { moduleName: string, filePath: string, activate?: boolean }, sourceMap?: string|object) =>
|
|
22
23
|
* { code: string|Buffer|ArrayBuffer|Uint8Array, map?: string|object }} BundlerRewriter
|
|
23
24
|
*/
|
|
24
25
|
|
|
@@ -26,7 +27,8 @@ const { getRewriteTarget } = require('./targets')
|
|
|
26
27
|
* @type {Record<string, string>} map of module base name to version
|
|
27
28
|
*/
|
|
28
29
|
const moduleVersions = {}
|
|
29
|
-
|
|
30
|
+
// Asynchronous loader workers have their own module graph and cannot receive disable() calls made on the main thread.
|
|
31
|
+
const disabled = getDisabledInstrumentations()
|
|
30
32
|
|
|
31
33
|
// Matchers are built on the first module that actually needs rewriting. The
|
|
32
34
|
// vendored transformer is a quarter megabyte of bundle that an application
|
|
@@ -42,40 +44,76 @@ let matcherEsm
|
|
|
42
44
|
// eslint-disable-next-line unicorn/no-useless-concat -- Keep the source-map marker non-contiguous.
|
|
43
45
|
const SOURCE_MAP_PREFIX = '//# sourceMapping' + 'URL=data:application/json;base64,'
|
|
44
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Loader hooks hand `file://` URLs to the rewriter while CommonJS and bundler
|
|
49
|
+
* callers pass plain paths. `fileURLToPath` is the only correct conversion: a
|
|
50
|
+
* plain scheme strip leaves Windows paths rooted at `/C:/` and keeps
|
|
51
|
+
* percent-encoded characters undecoded, which breaks version resolution.
|
|
52
|
+
* Rewrite-target paths use forward slashes, including on Windows.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} filename
|
|
55
|
+
*/
|
|
56
|
+
function normalizeFilename (filename) {
|
|
57
|
+
const path = filename.startsWith('file://') ? fileURLToPath(filename) : filename
|
|
58
|
+
return path.replaceAll('\\', '/')
|
|
59
|
+
}
|
|
60
|
+
|
|
45
61
|
/**
|
|
46
62
|
* @param {string|Buffer|ArrayBuffer|Uint8Array} content
|
|
47
63
|
* @param {string} filename
|
|
48
64
|
* @param {string} [format]
|
|
49
|
-
* @param {{ moduleName: string, filePath: string }} [target]
|
|
65
|
+
* @param {{ moduleName: string, filePath: string, activate?: boolean }} [target]
|
|
50
66
|
* @returns {string|Buffer|ArrayBuffer|Uint8Array}
|
|
51
67
|
*/
|
|
52
68
|
function rewrite (content, filename, format, target) {
|
|
53
69
|
if (!content) return content
|
|
54
70
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
71
|
+
try {
|
|
72
|
+
filename = normalizeFilename(filename)
|
|
73
|
+
target ||= getRewriteTarget(filename)
|
|
74
|
+
if (!target) return content
|
|
59
75
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
76
|
+
const moduleType = format === 'module' ? 'esm' : 'cjs'
|
|
77
|
+
const { moduleName, filePath, activate } = target
|
|
78
|
+
if (disabled.has(moduleName)) return content
|
|
63
79
|
|
|
64
|
-
|
|
80
|
+
const version = getVersion(filename, filePath)
|
|
81
|
+
if (!version) return content
|
|
65
82
|
|
|
66
|
-
|
|
83
|
+
const transformer = getMatcher(moduleType).getTransformer(moduleName, version, filePath)
|
|
67
84
|
|
|
68
|
-
|
|
85
|
+
if (!transformer && !activate) return content
|
|
69
86
|
|
|
70
|
-
try {
|
|
71
87
|
const source = getSourceText(content)
|
|
72
88
|
|
|
89
|
+
if (!transformer) {
|
|
90
|
+
return appendOrchestrionLoad(
|
|
91
|
+
source,
|
|
92
|
+
{ moduleName, version, result: 'unsupported' },
|
|
93
|
+
moduleType
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
73
97
|
// TODO: pass existing sourcemap as input for remapping
|
|
74
|
-
|
|
98
|
+
let { code, map } = transformer.transform(source, moduleType)
|
|
99
|
+
|
|
100
|
+
if (source.startsWith('#!') && !code.startsWith('#!')) {
|
|
101
|
+
// A shebang must be the entire first line, and JavaScript recognizes
|
|
102
|
+
// exactly four line terminators: \n, \r, \u2028 (line separator), and
|
|
103
|
+
// \u2029 (paragraph separator). Any of the four can end the shebang line.
|
|
104
|
+
const shebangEnd = source.search(/[\r\n\u2028\u2029]/)
|
|
105
|
+
code = (shebangEnd === -1 ? source : source.slice(0, shebangEnd)) + '\n' + code
|
|
106
|
+
map = shiftSourceMapLine(map)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (activate) {
|
|
110
|
+
const result = code === source ? 'matched' : 'rewritten'
|
|
111
|
+
code = appendOrchestrionLoad(code, { moduleName, version, result }, moduleType)
|
|
112
|
+
}
|
|
75
113
|
|
|
76
114
|
if (!map) return code
|
|
77
115
|
|
|
78
|
-
const inlineMap = Buffer.from(map).toString('base64')
|
|
116
|
+
const inlineMap = Buffer.from(typeof map === 'string' ? map : JSON.stringify(map)).toString('base64')
|
|
79
117
|
|
|
80
118
|
return code + '\n' + SOURCE_MAP_PREFIX + inlineMap
|
|
81
119
|
} catch (e) {
|
|
@@ -95,16 +133,19 @@ function createBundlerRewriter (dcModule) {
|
|
|
95
133
|
return function rewriteBundled (content, filename, format, target, sourceMap) {
|
|
96
134
|
if (!content) return { code: content, map: sourceMap }
|
|
97
135
|
|
|
98
|
-
|
|
99
|
-
|
|
136
|
+
try {
|
|
137
|
+
filename = normalizeFilename(filename)
|
|
138
|
+
target ||= getRewriteTarget(filename)
|
|
139
|
+
if (!target) return { code: content, map: sourceMap }
|
|
100
140
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
141
|
+
const moduleType = format === 'module' ? 'esm' : 'cjs'
|
|
142
|
+
const { moduleName, filePath } = target
|
|
143
|
+
const version = getVersion(filename, filePath)
|
|
144
|
+
if (!version) return { code: content, map: sourceMap }
|
|
145
|
+
|
|
146
|
+
const transformer = matcher.getTransformer(moduleName, version, filePath)
|
|
147
|
+
if (!transformer) return { code: content, map: sourceMap }
|
|
106
148
|
|
|
107
|
-
try {
|
|
108
149
|
return transformer.transform(getSourceText(content), moduleType, sourceMap)
|
|
109
150
|
} catch (error) {
|
|
110
151
|
log.error(error)
|
|
@@ -146,6 +187,11 @@ function createMatcher (dcModule) {
|
|
|
146
187
|
publishDurableOrchestrationFailure,
|
|
147
188
|
waitForAsyncEnd,
|
|
148
189
|
} = require('./transforms')
|
|
190
|
+
const {
|
|
191
|
+
postgresQueryHandlers,
|
|
192
|
+
postgresQueryLifecycle,
|
|
193
|
+
postgresQueryPreparation,
|
|
194
|
+
} = require('./transforms/postgres')
|
|
149
195
|
|
|
150
196
|
const matcher = create(instrumentations, dcModule)
|
|
151
197
|
|
|
@@ -158,6 +204,9 @@ function createMatcher (dcModule) {
|
|
|
158
204
|
matcher.addTransform('configureGraphqlJitRuntime', configureGraphqlJitRuntime)
|
|
159
205
|
matcher.addTransform('configureMercuriusRequest', configureMercuriusRequest)
|
|
160
206
|
matcher.addTransform('publishDurableOrchestrationFailure', publishDurableOrchestrationFailure)
|
|
207
|
+
matcher.addTransform('postgresQueryHandlers', postgresQueryHandlers)
|
|
208
|
+
matcher.addTransform('postgresQueryLifecycle', postgresQueryLifecycle)
|
|
209
|
+
matcher.addTransform('postgresQueryPreparation', postgresQueryPreparation)
|
|
161
210
|
|
|
162
211
|
return matcher
|
|
163
212
|
}
|
|
@@ -191,7 +240,6 @@ function getDcPolyfillSpecifier (moduleType) {
|
|
|
191
240
|
* Convert the source representations accepted by Node.js loader hooks to text.
|
|
192
241
|
*
|
|
193
242
|
* @param {string | ArrayBuffer | BufferView} source
|
|
194
|
-
* @returns {string}
|
|
195
243
|
*/
|
|
196
244
|
function getSourceText (source) {
|
|
197
245
|
if (typeof source === 'string') return source
|
|
@@ -201,6 +249,43 @@ function getSourceText (source) {
|
|
|
201
249
|
return Buffer.from(source).toString('utf8')
|
|
202
250
|
}
|
|
203
251
|
|
|
252
|
+
/**
|
|
253
|
+
* Publish target-level compatibility on the application thread when a pure target is evaluated.
|
|
254
|
+
*
|
|
255
|
+
* @param {string} source
|
|
256
|
+
* @param {{ moduleName: string, version: string,
|
|
257
|
+
* result: 'unsupported'|'matched'|'rewritten' }} payload
|
|
258
|
+
* @param {'cjs'|'esm'} moduleType
|
|
259
|
+
*/
|
|
260
|
+
function appendOrchestrionLoad (source, payload, moduleType) {
|
|
261
|
+
const dcModule = JSON.stringify(getDcPolyfillSpecifier(moduleType) ?? 'diagnostics_channel')
|
|
262
|
+
const message = JSON.stringify(payload)
|
|
263
|
+
|
|
264
|
+
if (moduleType === 'esm') {
|
|
265
|
+
let binding = 'ddTraceOrchestrionDc'
|
|
266
|
+
let suffix = 0
|
|
267
|
+
while (source.includes(binding)) binding = `ddTraceOrchestrionDc${++suffix}`
|
|
268
|
+
|
|
269
|
+
return `${source};import ${binding} from ${dcModule};` +
|
|
270
|
+
`${binding}.channel('dd-trace:instrumentation:load:orchestrion').publish(${message});`
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return `${source};require(${dcModule}).channel('dd-trace:instrumentation:load:orchestrion').publish(${message});`
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Account for a shebang restored ahead of the generated program. The transformer already maps original positions
|
|
278
|
+
* past the input shebang, so only the generated side needs an additional empty line.
|
|
279
|
+
*
|
|
280
|
+
* @param {string|object|undefined} map
|
|
281
|
+
*/
|
|
282
|
+
function shiftSourceMapLine (map) {
|
|
283
|
+
if (!map) return map
|
|
284
|
+
const sourceMap = typeof map === 'string' ? JSON.parse(map) : map
|
|
285
|
+
const shifted = { ...sourceMap, mappings: `;${sourceMap.mappings}` }
|
|
286
|
+
return typeof map === 'string' ? JSON.stringify(shifted) : shifted
|
|
287
|
+
}
|
|
288
|
+
|
|
204
289
|
function disable (instrumentation) {
|
|
205
290
|
disabled.add(instrumentation)
|
|
206
291
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
// Activated rewrites publish their module name to the plugin manager after evaluation.
|
|
4
|
+
// Only pure Orchestrion integrations that need this activation set activate: true.
|
|
5
|
+
// Other entries use hooks or another activation path, or do not need activation from a rewrite.
|
|
6
|
+
const registry = [
|
|
7
|
+
{ instrumentations: require('./instrumentations/ai') },
|
|
8
|
+
{ activate: true, instrumentations: require('./instrumentations/azure-cosmos') },
|
|
9
|
+
{ instrumentations: require('./instrumentations/azure-durable-functions') },
|
|
10
|
+
{ activate: true, instrumentations: require('./instrumentations/bullmq') },
|
|
11
|
+
{ instrumentations: require('./instrumentations/claude-agent-sdk') },
|
|
12
|
+
{ instrumentations: require('./instrumentations/graphql') },
|
|
13
|
+
{ instrumentations: require('./instrumentations/graphql-jit') },
|
|
14
|
+
{ activate: true, instrumentations: require('./instrumentations/langchain') },
|
|
15
|
+
{ activate: true, instrumentations: require('./instrumentations/langgraph') },
|
|
16
|
+
{ activate: true, instrumentations: require('./instrumentations/mercurius') },
|
|
17
|
+
{ instrumentations: require('./instrumentations/modelcontextprotocol-sdk') },
|
|
18
|
+
{ instrumentations: require('./instrumentations/openai-agents') },
|
|
19
|
+
{ instrumentations: require('./instrumentations/playwright') },
|
|
20
|
+
{ instrumentations: require('./instrumentations/postgres') },
|
|
21
|
+
{ instrumentations: require('./instrumentations/webdriverio') },
|
|
22
|
+
{ instrumentations: require('./instrumentations/aws-durable-execution-sdk-js') },
|
|
23
|
+
{ instrumentations: require('./instrumentations/supabase') },
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
const activatedModules = new Set()
|
|
27
|
+
for (const { activate, instrumentations } of registry) {
|
|
28
|
+
if (!activate) continue
|
|
29
|
+
for (const { module } of instrumentations) activatedModules.add(module.name)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const instrumentations = registry.flatMap(entry => entry.instrumentations)
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @param {string} moduleName
|
|
36
|
+
*/
|
|
37
|
+
function isRewriteActivationEnabled (moduleName) {
|
|
38
|
+
return activatedModules.has(moduleName)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
module.exports = { isRewriteActivationEnabled, instrumentations, registry }
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
...require('./azure-durable-functions'),
|
|
7
|
-
...require('./bullmq'),
|
|
8
|
-
...require('./claude-agent-sdk'),
|
|
9
|
-
...require('./graphql'),
|
|
10
|
-
...require('./graphql-jit'),
|
|
11
|
-
...require('./langchain'),
|
|
12
|
-
...require('./langgraph'),
|
|
13
|
-
...require('./mercurius'),
|
|
14
|
-
...require('./modelcontextprotocol-sdk'),
|
|
15
|
-
...require('./openai-agents'),
|
|
16
|
-
...require('./playwright'),
|
|
17
|
-
...require('./webdriverio'),
|
|
18
|
-
...require('./aws-durable-execution-sdk-js'),
|
|
19
|
-
]
|
|
3
|
+
const { instrumentations } = require('../instrumentation-registry')
|
|
4
|
+
|
|
5
|
+
module.exports = instrumentations
|
package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/playwright.js
CHANGED
|
@@ -3,6 +3,49 @@
|
|
|
3
3
|
// Playwright keeps several hook targets in private local classes/functions.
|
|
4
4
|
// Keep these rewrites limited to bundled internals that addHook cannot wrap.
|
|
5
5
|
module.exports = [
|
|
6
|
+
{
|
|
7
|
+
module: {
|
|
8
|
+
name: '@playwright/test',
|
|
9
|
+
versionRange: '>=1.18.0 <1.38.0',
|
|
10
|
+
filePath: 'lib/reporters/multiplexer.js',
|
|
11
|
+
},
|
|
12
|
+
functionQuery: {
|
|
13
|
+
className: 'Multiplexer',
|
|
14
|
+
methodName: 'onError',
|
|
15
|
+
kind: 'Sync',
|
|
16
|
+
},
|
|
17
|
+
channelName: 'Multiplexer_onError',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
module: {
|
|
21
|
+
name: 'playwright',
|
|
22
|
+
versionRange: '>=1.44.0 <1.60.0',
|
|
23
|
+
filePath: 'lib/runner/runner.js',
|
|
24
|
+
},
|
|
25
|
+
astQuery: 'FunctionDeclaration[id.name="writeLastRunInfo"] ' +
|
|
26
|
+
'CallExpression[callee.property.name="map"] > ArrowFunctionExpression',
|
|
27
|
+
channelName: 'lastRunTestId',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
module: {
|
|
31
|
+
name: 'playwright',
|
|
32
|
+
versionRange: '>=1.44.0 <1.60.0',
|
|
33
|
+
filePath: 'lib/runner/lastRun.js',
|
|
34
|
+
},
|
|
35
|
+
astQuery: 'ClassDeclaration[id.name="LastRunReporter"] ' +
|
|
36
|
+
'CallExpression[callee.property.name="map"] > ArrowFunctionExpression',
|
|
37
|
+
channelName: 'lastRunTestId',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
module: {
|
|
41
|
+
name: 'playwright',
|
|
42
|
+
versionRange: '>=1.60.0',
|
|
43
|
+
filePath: 'lib/runner/index.js',
|
|
44
|
+
},
|
|
45
|
+
astQuery: 'VariableDeclarator[id.name="LastRunReporter"] ' +
|
|
46
|
+
'CallExpression[callee.property.name="map"] > ArrowFunctionExpression',
|
|
47
|
+
channelName: 'lastRunTestId',
|
|
48
|
+
},
|
|
6
49
|
{
|
|
7
50
|
module: {
|
|
8
51
|
name: 'playwright',
|
|
@@ -93,6 +136,18 @@ module.exports = [
|
|
|
93
136
|
},
|
|
94
137
|
channelName: 'createRootSuite',
|
|
95
138
|
},
|
|
139
|
+
{
|
|
140
|
+
module: {
|
|
141
|
+
name: 'playwright',
|
|
142
|
+
versionRange: '>=1.60.0',
|
|
143
|
+
filePath: 'lib/runner/index.js',
|
|
144
|
+
},
|
|
145
|
+
functionQuery: {
|
|
146
|
+
functionName: 'filterForShard',
|
|
147
|
+
kind: 'Sync',
|
|
148
|
+
},
|
|
149
|
+
channelName: 'filterForShard',
|
|
150
|
+
},
|
|
96
151
|
{
|
|
97
152
|
module: {
|
|
98
153
|
name: 'playwright-core',
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const handlers = ['src/index.js', 'cjs/src/index.js'].map(filePath => ({
|
|
4
|
+
module: {
|
|
5
|
+
name: 'postgres',
|
|
6
|
+
versionRange: '>=3.0.0',
|
|
7
|
+
filePath,
|
|
8
|
+
},
|
|
9
|
+
astQuery: 'Program',
|
|
10
|
+
transform: 'postgresQueryHandlers',
|
|
11
|
+
channelName: 'query',
|
|
12
|
+
}))
|
|
13
|
+
|
|
14
|
+
const preparations = ['src/connection.js', 'cjs/src/connection.js'].map(filePath => ({
|
|
15
|
+
module: {
|
|
16
|
+
name: 'postgres',
|
|
17
|
+
versionRange: '>=3.0.0',
|
|
18
|
+
filePath,
|
|
19
|
+
},
|
|
20
|
+
astQuery: 'Program',
|
|
21
|
+
transform: 'postgresQueryPreparation',
|
|
22
|
+
channelName: 'query:prepare',
|
|
23
|
+
}))
|
|
24
|
+
|
|
25
|
+
const lifecycles = ['src/query.js', 'cjs/src/query.js'].map(filePath => ({
|
|
26
|
+
module: {
|
|
27
|
+
name: 'postgres',
|
|
28
|
+
versionRange: '>=3.0.0',
|
|
29
|
+
filePath,
|
|
30
|
+
},
|
|
31
|
+
astQuery: 'Program',
|
|
32
|
+
transform: 'postgresQueryLifecycle',
|
|
33
|
+
channelName: 'query',
|
|
34
|
+
}))
|
|
35
|
+
|
|
36
|
+
module.exports = [...handlers, ...preparations, ...lifecycles]
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const versionRange = '>=2.112.2'
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
{
|
|
7
|
+
module: {
|
|
8
|
+
name: '@supabase/storage-js',
|
|
9
|
+
versionRange,
|
|
10
|
+
filePath: 'dist/index.cjs',
|
|
11
|
+
},
|
|
12
|
+
functionQuery: { functionName: '_handleRequest', kind: 'Async' },
|
|
13
|
+
channelName: 'handleRequest',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
module: {
|
|
17
|
+
name: '@supabase/storage-js',
|
|
18
|
+
versionRange,
|
|
19
|
+
filePath: 'dist/index.mjs',
|
|
20
|
+
},
|
|
21
|
+
functionQuery: { functionName: '_handleRequest', kind: 'Async' },
|
|
22
|
+
channelName: 'handleRequest',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
module: {
|
|
26
|
+
name: '@supabase/auth-js',
|
|
27
|
+
versionRange,
|
|
28
|
+
filePath: 'dist/main/GoTrueClient.js',
|
|
29
|
+
},
|
|
30
|
+
functionQuery: {
|
|
31
|
+
methodName: 'getUser',
|
|
32
|
+
className: 'GoTrueClient',
|
|
33
|
+
kind: 'Async',
|
|
34
|
+
},
|
|
35
|
+
channelName: 'GoTrueClient_getUser',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
module: {
|
|
39
|
+
name: '@supabase/auth-js',
|
|
40
|
+
versionRange,
|
|
41
|
+
filePath: 'dist/module/GoTrueClient.js',
|
|
42
|
+
},
|
|
43
|
+
functionQuery: {
|
|
44
|
+
methodName: 'getUser',
|
|
45
|
+
className: 'GoTrueClient',
|
|
46
|
+
kind: 'Async',
|
|
47
|
+
},
|
|
48
|
+
channelName: 'GoTrueClient_getUser',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
module: {
|
|
52
|
+
name: '@supabase/realtime-js',
|
|
53
|
+
versionRange,
|
|
54
|
+
filePath: 'dist/main/RealtimeChannel.js',
|
|
55
|
+
},
|
|
56
|
+
functionQuery: {
|
|
57
|
+
methodName: 'send',
|
|
58
|
+
className: 'RealtimeChannel',
|
|
59
|
+
kind: 'Async',
|
|
60
|
+
},
|
|
61
|
+
channelName: 'RealtimeChannel_send',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
module: {
|
|
65
|
+
name: '@supabase/realtime-js',
|
|
66
|
+
versionRange,
|
|
67
|
+
filePath: 'dist/module/RealtimeChannel.js',
|
|
68
|
+
},
|
|
69
|
+
functionQuery: {
|
|
70
|
+
methodName: 'send',
|
|
71
|
+
className: 'RealtimeChannel',
|
|
72
|
+
kind: 'Async',
|
|
73
|
+
},
|
|
74
|
+
channelName: 'RealtimeChannel_send',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
module: {
|
|
78
|
+
name: '@supabase/functions-js',
|
|
79
|
+
versionRange,
|
|
80
|
+
filePath: 'dist/main/FunctionsClient.js',
|
|
81
|
+
},
|
|
82
|
+
functionQuery: {
|
|
83
|
+
methodName: 'invoke',
|
|
84
|
+
className: 'FunctionsClient',
|
|
85
|
+
kind: 'Async',
|
|
86
|
+
},
|
|
87
|
+
channelName: 'FunctionsClient_invoke',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
module: {
|
|
91
|
+
name: '@supabase/functions-js',
|
|
92
|
+
versionRange,
|
|
93
|
+
filePath: 'dist/module/FunctionsClient.js',
|
|
94
|
+
},
|
|
95
|
+
functionQuery: {
|
|
96
|
+
methodName: 'invoke',
|
|
97
|
+
className: 'FunctionsClient',
|
|
98
|
+
kind: 'Async',
|
|
99
|
+
},
|
|
100
|
+
channelName: 'FunctionsClient_invoke',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
module: {
|
|
104
|
+
name: '@supabase/postgrest-js',
|
|
105
|
+
versionRange,
|
|
106
|
+
filePath: 'dist/index.cjs',
|
|
107
|
+
},
|
|
108
|
+
functionQuery: {
|
|
109
|
+
methodName: 'then',
|
|
110
|
+
className: 'PostgrestBuilder',
|
|
111
|
+
kind: 'Async',
|
|
112
|
+
},
|
|
113
|
+
channelName: 'PostgrestBuilder_then',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
module: {
|
|
117
|
+
name: '@supabase/postgrest-js',
|
|
118
|
+
versionRange,
|
|
119
|
+
filePath: 'dist/index.mjs',
|
|
120
|
+
},
|
|
121
|
+
functionQuery: {
|
|
122
|
+
methodName: 'then',
|
|
123
|
+
className: 'PostgrestBuilder',
|
|
124
|
+
kind: 'Async',
|
|
125
|
+
},
|
|
126
|
+
channelName: 'PostgrestBuilder_then',
|
|
127
|
+
},
|
|
128
|
+
]
|
package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
module.exports = [
|
|
4
|
+
{
|
|
5
|
+
module: {
|
|
6
|
+
name: '@wdio/config',
|
|
7
|
+
versionRange: '>=9.0.0',
|
|
8
|
+
filePath: 'build/node/index.js',
|
|
9
|
+
},
|
|
10
|
+
functionQuery: {
|
|
11
|
+
className: 'ConfigParser',
|
|
12
|
+
methodName: 'shard',
|
|
13
|
+
kind: 'Sync',
|
|
14
|
+
},
|
|
15
|
+
channelName: 'ConfigParser_shard',
|
|
16
|
+
},
|
|
4
17
|
{
|
|
5
18
|
module: {
|
|
6
19
|
name: '@wdio/cli',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
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 rewriteTargetNames = new Set(Object.values(targets))
|
|
5
6
|
|
|
6
7
|
const NODE_MODULES = '/node_modules/'
|
|
7
8
|
|
|
@@ -9,6 +10,7 @@ const NODE_MODULES = '/node_modules/'
|
|
|
9
10
|
* @typedef {object} RewriteTarget
|
|
10
11
|
* @property {string} moduleName
|
|
11
12
|
* @property {string} filePath
|
|
13
|
+
* @property {boolean} [activate]
|
|
12
14
|
*/
|
|
13
15
|
|
|
14
16
|
/**
|
|
@@ -20,13 +22,36 @@ function getRewriteTarget (filename) {
|
|
|
20
22
|
if (nodeModulesIndex === -1) return
|
|
21
23
|
|
|
22
24
|
const modulePath = filename.slice(nodeModulesIndex + NODE_MODULES.length)
|
|
25
|
+
if (!Object.hasOwn(targets, modulePath)) return
|
|
23
26
|
const moduleName = targets[modulePath]
|
|
24
27
|
if (typeof moduleName !== 'string') return
|
|
28
|
+
const activate = isRewriteActivationEnabled(moduleName)
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
const rewriteTarget = {
|
|
27
31
|
moduleName,
|
|
28
32
|
filePath: modulePath.slice(moduleName.length + 1),
|
|
29
33
|
}
|
|
34
|
+
if (activate) rewriteTarget.activate = true
|
|
35
|
+
return rewriteTarget
|
|
30
36
|
}
|
|
31
37
|
|
|
32
|
-
|
|
38
|
+
function getRewriteTargetNames () {
|
|
39
|
+
return rewriteTargetNames.values()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @param {string} name
|
|
44
|
+
*/
|
|
45
|
+
function isRewriteTargetName (name) {
|
|
46
|
+
return rewriteTargetNames.has(name)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @param {string} moduleName
|
|
51
|
+
*/
|
|
52
|
+
function isRewriteActivationEnabled (moduleName) {
|
|
53
|
+
// Keep target-name-only consumers from loading every instrumentation descriptor.
|
|
54
|
+
return require('./instrumentation-registry').isRewriteActivationEnabled(moduleName)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
module.exports = { getRewriteTarget, getRewriteTargetNames, isRewriteActivationEnabled, isRewriteTargetName }
|
|
@@ -30,7 +30,19 @@
|
|
|
30
30
|
"@modelcontextprotocol/sdk/dist/esm/server/mcp.js": "@modelcontextprotocol/sdk",
|
|
31
31
|
"@openai/agents-openai/dist/openaiChatCompletionsModel.js": "@openai/agents-openai",
|
|
32
32
|
"@openai/agents-openai/dist/openaiChatCompletionsModel.mjs": "@openai/agents-openai",
|
|
33
|
+
"@playwright/test/lib/reporters/multiplexer.js": "@playwright/test",
|
|
34
|
+
"@supabase/auth-js/dist/main/GoTrueClient.js": "@supabase/auth-js",
|
|
35
|
+
"@supabase/auth-js/dist/module/GoTrueClient.js": "@supabase/auth-js",
|
|
36
|
+
"@supabase/functions-js/dist/main/FunctionsClient.js": "@supabase/functions-js",
|
|
37
|
+
"@supabase/functions-js/dist/module/FunctionsClient.js": "@supabase/functions-js",
|
|
38
|
+
"@supabase/postgrest-js/dist/index.cjs": "@supabase/postgrest-js",
|
|
39
|
+
"@supabase/postgrest-js/dist/index.mjs": "@supabase/postgrest-js",
|
|
40
|
+
"@supabase/realtime-js/dist/main/RealtimeChannel.js": "@supabase/realtime-js",
|
|
41
|
+
"@supabase/realtime-js/dist/module/RealtimeChannel.js": "@supabase/realtime-js",
|
|
42
|
+
"@supabase/storage-js/dist/index.cjs": "@supabase/storage-js",
|
|
43
|
+
"@supabase/storage-js/dist/index.mjs": "@supabase/storage-js",
|
|
33
44
|
"@wdio/cli/build/index.js": "@wdio/cli",
|
|
45
|
+
"@wdio/config/build/node/index.js": "@wdio/config",
|
|
34
46
|
"@wdio/jasmine-framework/build/index.js": "@wdio/jasmine-framework",
|
|
35
47
|
"@wdio/local-runner/build/index.js": "@wdio/local-runner",
|
|
36
48
|
"@wdio/runner/build/index.js": "@wdio/runner",
|
|
@@ -67,6 +79,14 @@
|
|
|
67
79
|
"playwright-core/lib/coreBundle.js": "playwright-core",
|
|
68
80
|
"playwright/lib/index.js": "playwright",
|
|
69
81
|
"playwright/lib/runner/index.js": "playwright",
|
|
82
|
+
"playwright/lib/runner/lastRun.js": "playwright",
|
|
83
|
+
"playwright/lib/runner/runner.js": "playwright",
|
|
84
|
+
"postgres/cjs/src/connection.js": "postgres",
|
|
85
|
+
"postgres/cjs/src/index.js": "postgres",
|
|
86
|
+
"postgres/cjs/src/query.js": "postgres",
|
|
87
|
+
"postgres/src/connection.js": "postgres",
|
|
88
|
+
"postgres/src/index.js": "postgres",
|
|
89
|
+
"postgres/src/query.js": "postgres",
|
|
70
90
|
"webdriver/build/index.js": "webdriver",
|
|
71
91
|
"webdriver/build/node.js": "webdriver",
|
|
72
92
|
"webdriverio/build/index.js": "webdriverio",
|