dd-trace 5.81.0 → 5.83.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 +78 -79
- package/ci/init.js +6 -6
- package/index.d.ts +159 -3
- package/loader-hook.mjs +8 -3
- package/package.json +64 -66
- package/packages/datadog-core/src/storage.js +7 -7
- package/packages/datadog-core/src/utils/src/parse-tags.js +1 -1
- package/packages/datadog-esbuild/index.js +14 -7
- package/packages/datadog-esbuild/src/utils.js +14 -2
- package/packages/datadog-instrumentations/src/aerospike.js +3 -2
- package/packages/datadog-instrumentations/src/ai.js +9 -5
- package/packages/datadog-instrumentations/src/amqp10.js +1 -1
- package/packages/datadog-instrumentations/src/amqplib.js +4 -4
- package/packages/datadog-instrumentations/src/anthropic.js +2 -2
- package/packages/datadog-instrumentations/src/apollo-server-core.js +2 -2
- package/packages/datadog-instrumentations/src/apollo-server.js +1 -1
- package/packages/datadog-instrumentations/src/apollo.js +3 -2
- package/packages/datadog-instrumentations/src/avsc.js +1 -1
- package/packages/datadog-instrumentations/src/aws-sdk.js +1 -1
- package/packages/datadog-instrumentations/src/azure-event-hubs.js +4 -3
- package/packages/datadog-instrumentations/src/azure-functions.js +2 -2
- package/packages/datadog-instrumentations/src/azure-service-bus.js +3 -4
- package/packages/datadog-instrumentations/src/bluebird.js +1 -1
- package/packages/datadog-instrumentations/src/bullmq.js +11 -0
- package/packages/datadog-instrumentations/src/bunyan.js +1 -1
- package/packages/datadog-instrumentations/src/cassandra-driver.js +1 -1
- package/packages/datadog-instrumentations/src/child_process.js +3 -3
- package/packages/datadog-instrumentations/src/confluentinc-kafka-javascript.js +3 -3
- package/packages/datadog-instrumentations/src/couchbase.js +1 -1
- package/packages/datadog-instrumentations/src/crypto.js +1 -1
- package/packages/datadog-instrumentations/src/cucumber.js +13 -14
- package/packages/datadog-instrumentations/src/cypress.js +1 -1
- package/packages/datadog-instrumentations/src/dns.js +1 -1
- package/packages/datadog-instrumentations/src/elasticsearch.js +1 -1
- package/packages/datadog-instrumentations/src/express-mongo-sanitize.js +1 -1
- package/packages/datadog-instrumentations/src/express.js +1 -1
- package/packages/datadog-instrumentations/src/fs.js +1 -1
- package/packages/datadog-instrumentations/src/generic-pool.js +1 -1
- package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +137 -15
- package/packages/datadog-instrumentations/src/google-cloud-vertexai.js +2 -3
- package/packages/datadog-instrumentations/src/google-genai.js +3 -3
- package/packages/datadog-instrumentations/src/graphql.js +2 -2
- package/packages/datadog-instrumentations/src/grpc/client.js +1 -1
- package/packages/datadog-instrumentations/src/grpc/server.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/bundler-register.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/hook.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/hooks.js +4 -1
- package/packages/datadog-instrumentations/src/helpers/instrument.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/instrumentations.js +4 -3
- package/packages/datadog-instrumentations/src/helpers/register.js +9 -11
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +2 -2
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/bullmq.json +106 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +2 -1
- package/packages/datadog-instrumentations/src/helpers/router-helper.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/shared-utils.js +9 -0
- package/packages/datadog-instrumentations/src/hono.js +55 -10
- package/packages/datadog-instrumentations/src/http/client.js +2 -2
- package/packages/datadog-instrumentations/src/ioredis.js +1 -1
- package/packages/datadog-instrumentations/src/iovalkey.js +1 -1
- package/packages/datadog-instrumentations/src/jest.js +37 -16
- package/packages/datadog-instrumentations/src/kafkajs.js +3 -3
- package/packages/datadog-instrumentations/src/knex.js +1 -1
- package/packages/datadog-instrumentations/src/koa.js +2 -1
- package/packages/datadog-instrumentations/src/ldapjs.js +1 -1
- package/packages/datadog-instrumentations/src/light-my-request.js +93 -0
- package/packages/datadog-instrumentations/src/limitd-client.js +1 -1
- package/packages/datadog-instrumentations/src/lodash.js +1 -2
- package/packages/datadog-instrumentations/src/mariadb.js +1 -2
- package/packages/datadog-instrumentations/src/memcached.js +1 -1
- package/packages/datadog-instrumentations/src/mocha/main.js +2 -2
- package/packages/datadog-instrumentations/src/mocha/worker.js +1 -1
- package/packages/datadog-instrumentations/src/mocha.js +1 -1
- package/packages/datadog-instrumentations/src/mongodb-core.js +1 -1
- package/packages/datadog-instrumentations/src/mongodb.js +1 -1
- package/packages/datadog-instrumentations/src/mongoose.js +1 -1
- package/packages/datadog-instrumentations/src/mquery.js +1 -1
- package/packages/datadog-instrumentations/src/mysql.js +2 -2
- package/packages/datadog-instrumentations/src/mysql2.js +3 -3
- package/packages/datadog-instrumentations/src/net.js +14 -6
- package/packages/datadog-instrumentations/src/next.js +1 -1
- package/packages/datadog-instrumentations/src/nyc.js +2 -2
- package/packages/datadog-instrumentations/src/openai.js +2 -2
- package/packages/datadog-instrumentations/src/opensearch.js +1 -1
- package/packages/datadog-instrumentations/src/oracledb.js +1 -1
- package/packages/datadog-instrumentations/src/otel-sdk-trace.js +5 -5
- package/packages/datadog-instrumentations/src/pg.js +7 -5
- package/packages/datadog-instrumentations/src/pino.js +1 -1
- package/packages/datadog-instrumentations/src/playwright.js +4 -4
- package/packages/datadog-instrumentations/src/prisma.js +52 -37
- package/packages/datadog-instrumentations/src/process.js +1 -1
- package/packages/datadog-instrumentations/src/promise-js.js +1 -1
- package/packages/datadog-instrumentations/src/promise.js +1 -1
- package/packages/datadog-instrumentations/src/protobufjs.js +1 -1
- package/packages/datadog-instrumentations/src/q.js +1 -1
- package/packages/datadog-instrumentations/src/redis.js +1 -1
- package/packages/datadog-instrumentations/src/rhea.js +1 -1
- package/packages/datadog-instrumentations/src/selenium.js +3 -3
- package/packages/datadog-instrumentations/src/sequelize.js +1 -2
- package/packages/datadog-instrumentations/src/sharedb.js +1 -1
- package/packages/datadog-instrumentations/src/tedious.js +1 -1
- package/packages/datadog-instrumentations/src/undici.js +15 -4
- package/packages/datadog-instrumentations/src/url.js +1 -1
- package/packages/datadog-instrumentations/src/vitest.js +1 -1
- package/packages/datadog-instrumentations/src/vm.js +1 -1
- package/packages/datadog-instrumentations/src/when.js +1 -1
- package/packages/datadog-instrumentations/src/winston.js +1 -1
- package/packages/datadog-instrumentations/src/ws.js +3 -2
- package/packages/datadog-plugin-amqp10/src/index.js +1 -1
- package/packages/datadog-plugin-amqplib/src/index.js +1 -1
- package/packages/datadog-plugin-anthropic/src/index.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/base.js +4 -4
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/index.js +1 -1
- package/packages/datadog-plugin-aws-sdk/src/services/dynamodb.js +4 -4
- package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +2 -2
- package/packages/datadog-plugin-aws-sdk/src/util.js +3 -3
- package/packages/datadog-plugin-azure-event-hubs/src/index.js +1 -1
- package/packages/datadog-plugin-azure-event-hubs/src/producer.js +21 -7
- package/packages/datadog-plugin-azure-service-bus/src/index.js +1 -1
- package/packages/datadog-plugin-azure-service-bus/src/producer.js +6 -2
- package/packages/datadog-plugin-bullmq/src/consumer.js +60 -0
- package/packages/datadog-plugin-bullmq/src/index.js +18 -0
- package/packages/datadog-plugin-bullmq/src/producer.js +178 -0
- package/packages/datadog-plugin-confluentinc-kafka-javascript/src/index.js +1 -1
- package/packages/datadog-plugin-cucumber/src/index.js +2 -2
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +2 -2
- package/packages/datadog-plugin-cypress/src/plugin.js +1 -1
- package/packages/datadog-plugin-dd-trace-api/src/index.js +2 -2
- package/packages/datadog-plugin-express/src/code_origin.js +21 -15
- package/packages/datadog-plugin-express/src/index.js +1 -1
- package/packages/datadog-plugin-fastify/src/code_origin.js +17 -4
- package/packages/datadog-plugin-fastify/src/index.js +1 -1
- package/packages/datadog-plugin-google-cloud-pubsub/src/client.js +13 -3
- package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +171 -12
- package/packages/datadog-plugin-google-cloud-pubsub/src/index.js +1 -2
- package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +160 -13
- package/packages/datadog-plugin-google-cloud-pubsub/src/pubsub-push-subscription.js +217 -0
- package/packages/datadog-plugin-google-cloud-vertexai/src/index.js +1 -1
- package/packages/datadog-plugin-google-genai/src/index.js +1 -1
- package/packages/datadog-plugin-graphql/src/resolve.js +1 -1
- package/packages/datadog-plugin-grpc/src/index.js +1 -1
- package/packages/datadog-plugin-http/src/client.js +2 -1
- package/packages/datadog-plugin-http/src/index.js +25 -5
- package/packages/datadog-plugin-http2/src/client.js +2 -2
- package/packages/datadog-plugin-http2/src/index.js +1 -1
- package/packages/datadog-plugin-jest/src/index.js +2 -2
- package/packages/datadog-plugin-kafkajs/src/index.js +1 -1
- package/packages/datadog-plugin-langchain/src/index.js +1 -1
- package/packages/datadog-plugin-mocha/src/index.js +2 -2
- package/packages/datadog-plugin-moleculer/src/index.js +1 -1
- package/packages/datadog-plugin-mongodb-core/src/index.js +8 -4
- package/packages/datadog-plugin-openai/src/index.js +1 -1
- package/packages/datadog-plugin-openai/src/stream-helpers.js +30 -10
- package/packages/datadog-plugin-openai/src/tracing.js +2 -2
- package/packages/datadog-plugin-playwright/src/index.js +3 -3
- package/packages/datadog-plugin-rhea/src/index.js +1 -1
- package/packages/datadog-plugin-undici/src/index.js +305 -2
- package/packages/datadog-plugin-vitest/src/index.js +5 -5
- package/packages/datadog-plugin-ws/src/close.js +56 -3
- package/packages/datadog-plugin-ws/src/index.js +4 -0
- package/packages/datadog-plugin-ws/src/producer.js +39 -4
- package/packages/datadog-plugin-ws/src/receiver.js +39 -3
- package/packages/datadog-plugin-ws/src/server.js +13 -1
- package/packages/datadog-plugin-ws/src/util.js +107 -0
- package/packages/datadog-shimmer/src/shimmer.js +2 -2
- package/packages/dd-trace/index.js +19 -0
- package/packages/dd-trace/src/aiguard/sdk.js +3 -3
- package/packages/dd-trace/src/appsec/graphql.js +2 -2
- package/packages/dd-trace/src/appsec/iast/analyzers/code-injection-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/command-injection-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/cookie-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-base-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/injection-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/ldap-injection-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/nosql-injection-mongodb-analyzer.js +3 -3
- package/packages/dd-trace/src/appsec/iast/analyzers/path-traversal-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/ssrf-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/untrusted-deserialization-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/unvalidated-redirect-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/weak-cipher-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/analyzers/weak-hash-analyzer.js +3 -2
- package/packages/dd-trace/src/appsec/iast/analyzers/weak-randomness-analyzer.js +1 -1
- package/packages/dd-trace/src/appsec/iast/iast-plugin.js +3 -3
- package/packages/dd-trace/src/appsec/iast/index.js +5 -5
- package/packages/dd-trace/src/appsec/iast/security-controls/index.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/index.js +1 -2
- package/packages/dd-trace/src/appsec/iast/taint-tracking/operations-taint-object.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 +11 -15
- package/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js +1 -1
- package/packages/dd-trace/src/appsec/iast/telemetry/namespaces.js +1 -1
- package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +3 -3
- package/packages/dd-trace/src/appsec/index.js +8 -8
- package/packages/dd-trace/src/appsec/rasp/command_injection.js +1 -1
- package/packages/dd-trace/src/appsec/rasp/index.js +3 -5
- package/packages/dd-trace/src/appsec/rasp/lfi.js +1 -1
- package/packages/dd-trace/src/appsec/rc-products.js +10 -0
- package/packages/dd-trace/src/appsec/recommended.json +230 -3
- package/packages/dd-trace/src/appsec/remote_config.js +177 -0
- package/packages/dd-trace/src/appsec/reporter.js +3 -3
- package/packages/dd-trace/src/appsec/rule_manager.js +37 -20
- package/packages/dd-trace/src/appsec/sdk/index.js +1 -1
- package/packages/dd-trace/src/appsec/sdk/set_user.js +1 -1
- package/packages/dd-trace/src/appsec/sdk/track_event.js +2 -2
- package/packages/dd-trace/src/appsec/sdk/user_blocking.js +2 -2
- package/packages/dd-trace/src/appsec/user_tracking.js +2 -2
- package/packages/dd-trace/src/appsec/waf/index.js +17 -3
- package/packages/dd-trace/src/appsec/waf/waf_manager.js +11 -0
- package/packages/dd-trace/src/azure_metadata.js +15 -4
- package/packages/dd-trace/src/baggage.js +36 -11
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/index.js +5 -1
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +6 -0
- package/packages/dd-trace/src/ci-visibility/early-flake-detection/get-known-tests.js +2 -2
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +2 -2
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +2 -2
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/index.js +2 -2
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +2 -2
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +4 -3
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +3 -3
- package/packages/dd-trace/src/ci-visibility/exporters/test-worker/index.js +5 -5
- package/packages/dd-trace/src/ci-visibility/exporters/test-worker/writer.js +1 -1
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +2 -2
- package/packages/dd-trace/src/ci-visibility/log-submission/log-submission-plugin.js +4 -4
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +4 -4
- package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +2 -2
- package/packages/dd-trace/src/{config_defaults.js → config/defaults.js} +5 -4
- package/packages/dd-trace/src/{config-helper.js → config/helper.js} +88 -15
- package/packages/dd-trace/src/{config.js → config/index.js} +115 -67
- package/packages/dd-trace/src/config/remote_config.js +202 -0
- package/packages/dd-trace/src/{config_stable.js → config/stable.js} +20 -32
- package/packages/dd-trace/src/{supported-configurations.json → config/supported-configurations.json} +5 -0
- package/packages/dd-trace/src/constants.js +5 -0
- package/packages/dd-trace/src/crashtracking/crashtracker.js +11 -2
- package/packages/dd-trace/src/datastreams/checkpointer.js +2 -2
- package/packages/dd-trace/src/datastreams/index.js +1 -1
- package/packages/dd-trace/src/datastreams/pathway.js +7 -7
- package/packages/dd-trace/src/datastreams/processor.js +3 -3
- package/packages/dd-trace/src/datastreams/writer.js +3 -3
- package/packages/dd-trace/src/debugger/config.js +1 -0
- package/packages/dd-trace/src/debugger/devtools_client/condition.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/config.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/index.js +7 -2
- package/packages/dd-trace/src/debugger/devtools_client/send.js +6 -6
- package/packages/dd-trace/src/debugger/devtools_client/session.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/collector.js +5 -5
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/constants.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +2 -2
- package/packages/dd-trace/src/debugger/devtools_client/state.js +1 -1
- package/packages/dd-trace/src/debugger/devtools_client/status.js +2 -2
- package/packages/dd-trace/src/debugger/index.js +84 -16
- package/packages/dd-trace/src/dogstatsd.js +5 -4
- package/packages/dd-trace/src/encode/0.4.js +3 -3
- package/packages/dd-trace/src/encode/agentless-ci-visibility.js +2 -2
- package/packages/dd-trace/src/encode/coverage-ci-visibility.js +1 -1
- package/packages/dd-trace/src/encode/span-stats.js +6 -1
- package/packages/dd-trace/src/exporter.js +2 -2
- package/packages/dd-trace/src/exporters/agent/index.js +2 -4
- package/packages/dd-trace/src/exporters/agent/writer.js +9 -14
- package/packages/dd-trace/src/exporters/common/agent-info-exporter.js +2 -2
- package/packages/dd-trace/src/exporters/common/docker.js +2 -2
- package/packages/dd-trace/src/exporters/common/request.js +3 -3
- package/packages/dd-trace/src/exporters/common/util.js +2 -2
- package/packages/dd-trace/src/exporters/common/writer.js +1 -1
- package/packages/dd-trace/src/exporters/span-stats/index.js +1 -1
- package/packages/dd-trace/src/external-logger/src/index.js +1 -2
- package/packages/dd-trace/src/flare/index.js +2 -2
- package/packages/dd-trace/src/guardrails/index.js +6 -3
- package/packages/dd-trace/src/guardrails/telemetry.js +1 -1
- package/packages/dd-trace/src/id.js +1 -1
- package/packages/dd-trace/src/index.js +4 -4
- package/packages/dd-trace/src/lambda/handler.js +5 -5
- package/packages/dd-trace/src/lambda/index.js +2 -2
- package/packages/dd-trace/src/lambda/runtime/patch.js +6 -6
- package/packages/dd-trace/src/lambda/runtime/ritm.js +3 -3
- package/packages/dd-trace/src/llmobs/constants/tags.js +14 -1
- package/packages/dd-trace/src/llmobs/index.js +10 -11
- package/packages/dd-trace/src/llmobs/noop.js +2 -0
- package/packages/dd-trace/src/llmobs/plugins/ai/index.js +38 -7
- package/packages/dd-trace/src/llmobs/plugins/ai/util.js +30 -9
- package/packages/dd-trace/src/llmobs/plugins/bedrockruntime.js +3 -3
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +2 -2
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chain.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chat_model.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/embedding.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/llm.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/vectorstore.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/openai/constants.js +16 -0
- package/packages/dd-trace/src/llmobs/plugins/openai/index.js +19 -5
- package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +22 -10
- package/packages/dd-trace/src/llmobs/plugins/vertexai.js +1 -1
- package/packages/dd-trace/src/llmobs/sdk.js +46 -26
- package/packages/dd-trace/src/llmobs/span_processor.js +26 -20
- package/packages/dd-trace/src/llmobs/tagger.js +175 -1
- package/packages/dd-trace/src/llmobs/telemetry.js +3 -4
- package/packages/dd-trace/src/llmobs/writers/base.js +117 -38
- package/packages/dd-trace/src/llmobs/writers/spans.js +5 -5
- package/packages/dd-trace/src/log/index.js +5 -5
- package/packages/dd-trace/src/noop/proxy.js +5 -5
- package/packages/dd-trace/src/noop/span.js +1 -1
- package/packages/dd-trace/src/openfeature/index.js +2 -2
- package/packages/dd-trace/src/openfeature/noop.js +14 -14
- package/packages/dd-trace/src/openfeature/remote_config.js +31 -0
- package/packages/dd-trace/src/openfeature/writers/base.js +12 -13
- package/packages/dd-trace/src/openfeature/writers/exposures.js +9 -9
- package/packages/dd-trace/src/opentelemetry/context_manager.js +2 -2
- package/packages/dd-trace/src/opentelemetry/logs/logger.js +1 -1
- package/packages/dd-trace/src/opentelemetry/logs/logger_provider.js +4 -4
- package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +9 -8
- package/packages/dd-trace/src/opentelemetry/metrics/instruments.js +3 -3
- package/packages/dd-trace/src/opentelemetry/metrics/meter.js +2 -2
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +4 -4
- package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +36 -11
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +2 -2
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +11 -10
- package/packages/dd-trace/src/opentelemetry/otlp/protobuf_loader.js +1 -1
- package/packages/dd-trace/src/opentelemetry/span.js +2 -2
- package/packages/dd-trace/src/opentelemetry/tracer.js +51 -9
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +68 -28
- package/packages/dd-trace/src/opentracing/span.js +7 -7
- package/packages/dd-trace/src/opentracing/tracer.js +5 -5
- package/packages/dd-trace/src/payload-tagging/index.js +6 -2
- package/packages/dd-trace/src/plugin_manager.js +8 -6
- package/packages/dd-trace/src/plugins/apollo.js +1 -1
- package/packages/dd-trace/src/plugins/ci_plugin.js +27 -27
- package/packages/dd-trace/src/plugins/database.js +1 -1
- package/packages/dd-trace/src/plugins/index.js +5 -1
- package/packages/dd-trace/src/plugins/log_plugin.js +1 -1
- package/packages/dd-trace/src/plugins/outbound.js +1 -1
- package/packages/dd-trace/src/plugins/tracing.js +1 -1
- package/packages/dd-trace/src/plugins/util/ci.js +5 -8
- package/packages/dd-trace/src/plugins/util/git-cache.js +3 -3
- package/packages/dd-trace/src/plugins/util/git.js +8 -8
- package/packages/dd-trace/src/plugins/util/stacktrace.js +1 -1
- package/packages/dd-trace/src/plugins/util/test.js +25 -25
- package/packages/dd-trace/src/plugins/util/user-provided-git.js +41 -43
- package/packages/dd-trace/src/plugins/util/web.js +8 -5
- package/packages/dd-trace/src/priority_sampler.js +15 -16
- package/packages/dd-trace/src/process-tags/index.js +31 -29
- package/packages/dd-trace/src/profiler.js +4 -39
- package/packages/dd-trace/src/profiling/config.js +104 -50
- package/packages/dd-trace/src/profiling/exporter_cli.js +8 -8
- package/packages/dd-trace/src/profiling/exporters/agent.js +6 -6
- package/packages/dd-trace/src/profiling/exporters/event_serializer.js +9 -2
- package/packages/dd-trace/src/profiling/index.js +1 -1
- package/packages/dd-trace/src/profiling/libuv-size.js +1 -1
- package/packages/dd-trace/src/profiling/profiler.js +61 -7
- package/packages/dd-trace/src/profiling/profilers/event_plugins/event.js +1 -1
- package/packages/dd-trace/src/profiling/profilers/events.js +2 -2
- package/packages/dd-trace/src/profiling/profilers/wall.js +4 -4
- package/packages/dd-trace/src/proxy.js +43 -20
- package/packages/dd-trace/src/remote_config/capabilities.js +3 -0
- package/packages/dd-trace/src/remote_config/index.js +541 -137
- package/packages/dd-trace/src/require-package-json.js +1 -1
- package/packages/dd-trace/src/ritm.js +58 -31
- package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +3 -3
- package/packages/dd-trace/src/serverless.js +17 -1
- package/packages/dd-trace/src/service-naming/schemas/v0/messaging.js +8 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/messaging.js +8 -0
- package/packages/dd-trace/src/span_format.js +1 -1
- package/packages/dd-trace/src/span_processor.js +4 -4
- package/packages/dd-trace/src/span_stats.js +6 -4
- package/packages/dd-trace/src/standalone/index.js +1 -1
- package/packages/dd-trace/src/startup-log.js +7 -16
- package/packages/dd-trace/src/telemetry/dependencies.js +3 -3
- package/packages/dd-trace/src/telemetry/endpoints.js +75 -13
- package/packages/dd-trace/src/telemetry/logs/index.js +1 -1
- package/packages/dd-trace/src/telemetry/send-data.js +103 -4
- package/packages/dd-trace/src/telemetry/telemetry.js +238 -114
- package/packages/dd-trace/src/tracer.js +3 -3
- package/packages/dd-trace/src/tracer_metadata.js +19 -15
- package/packages/dd-trace/src/remote_config/manager.js +0 -368
- /package/packages/dd-trace/src/{git_properties.js → config/git_properties.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dd-trace",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.83.0",
|
|
4
4
|
"description": "Datadog APM tracing client for JavaScript",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -18,61 +18,64 @@
|
|
|
18
18
|
"lint:inspect": "npx @eslint/config-inspector@latest",
|
|
19
19
|
"release:proposal": "node scripts/release/proposal",
|
|
20
20
|
"services": "node ./scripts/install_plugin_modules && node packages/dd-trace/test/setup/services",
|
|
21
|
-
"test": "
|
|
22
|
-
"test:aiguard": "mocha
|
|
21
|
+
"test": "echo '\nError: The root \"npm test\" command is intentionally disabled.\n\nInstead, run specific test suites:\n - npm run test:trace:core\n - npm run test:appsec\n - etc.\n\nOr run individual test files:\n npx mocha path/to/test.spec.js\n\nSee CONTRIBUTING.md (Testing section) for more details.\n' && exit 1",
|
|
22
|
+
"test:aiguard": "mocha packages/dd-trace/test/aiguard/**/*.spec.js",
|
|
23
23
|
"test:aiguard:ci": "nyc --no-clean --include \"packages/dd-trace/src/aiguard/**/*.js\" -- npm run test:aiguard",
|
|
24
|
-
"test:appsec": "mocha
|
|
24
|
+
"test:appsec": "mocha --exclude \"packages/dd-trace/test/appsec/**/*.plugin.spec.js\" \"packages/dd-trace/test/appsec/**/*.spec.js\"",
|
|
25
25
|
"test:appsec:ci": "nyc --no-clean --include \"packages/dd-trace/src/appsec/**/*.js\" --exclude \"packages/dd-trace/test/appsec/**/*.plugin.spec.js\" -- npm run test:appsec",
|
|
26
|
-
"test:appsec:plugins": "mocha
|
|
26
|
+
"test:appsec:plugins": "mocha \"packages/dd-trace/test/appsec/**/*.@(${PLUGINS}).plugin.spec.js\"",
|
|
27
27
|
"test:appsec:plugins:ci": "yarn services && nyc --no-clean --include \"packages/dd-trace/src/appsec/**/*.js\" -- npm run test:appsec:plugins",
|
|
28
|
-
"test:debugger": "mocha
|
|
29
|
-
"test:debugger:ci": "nyc --no-clean --include
|
|
28
|
+
"test:debugger": "mocha packages/dd-trace/test/debugger/**/*.spec.js",
|
|
29
|
+
"test:debugger:ci": "nyc --no-clean --include \"packages/dd-trace/src/debugger/**/*.js\" -- npm run test:debugger",
|
|
30
30
|
"test:eslint-rules": "node eslint-rules/*.test.mjs",
|
|
31
|
-
"test:trace:core": "
|
|
32
|
-
"test:trace:core:ci": "
|
|
33
|
-
"test:trace:guardrails": "mocha
|
|
31
|
+
"test:trace:core": "node scripts/mocha-parallel-files.js --expose-gc --timeout 30000 -- \"packages/dd-trace/test/*.spec.js\" \"packages/dd-trace/test/{ci-visibility,config,crashtracking,datastreams,encode,exporters,msgpack,opentelemetry,opentracing,payload-tagging,plugins,remote_config,service-naming,standalone,telemetry,external-logger}/**/*.spec.js\"",
|
|
32
|
+
"test:trace:core:ci": "nyc --no-clean --include \"packages/dd-trace/src/**/*.js\" -- npm run test:trace:core",
|
|
33
|
+
"test:trace:guardrails": "mocha packages/dd-trace/test/guardrails/**/*.spec.js",
|
|
34
34
|
"test:trace:guardrails:ci": "nyc --no-clean --include \"packages/dd-trace/src/guardrails/**/*.js\" -- npm run test:trace:guardrails",
|
|
35
|
-
"test:esbuild": "mocha
|
|
35
|
+
"test:esbuild": "mocha packages/datadog-esbuild/test/**/*.spec.js",
|
|
36
36
|
"test:esbuild:ci": "nyc --no-clean --include \"packages/datadog-esbuild/test/**/*.js\" -- npm run test:esbuild",
|
|
37
|
-
"test:instrumentations": "mocha
|
|
38
|
-
"test:instrumentations:ci": "yarn services && nyc --no-clean --include \"packages/datadog-instrumentations/src/@($
|
|
39
|
-
"test:instrumentations:misc": "mocha
|
|
40
|
-
"test:instrumentations:misc:ci": "nyc --no-clean --include
|
|
41
|
-
"test:core": "
|
|
42
|
-
"test:core:ci": "
|
|
43
|
-
"test:
|
|
37
|
+
"test:instrumentations": "mocha \"packages/datadog-instrumentations/test/@(${PLUGINS}).spec.js\"",
|
|
38
|
+
"test:instrumentations:ci": "yarn services && nyc --no-clean --include \"packages/datadog-instrumentations/src/@(${PLUGINS}).js\" --include \"packages/datadog-instrumentations/src/@(${PLUGINS})/**/*.js\" -- npm run test:instrumentations",
|
|
39
|
+
"test:instrumentations:misc": "mocha packages/datadog-instrumentations/test/*/**/*.spec.js",
|
|
40
|
+
"test:instrumentations:misc:ci": "nyc --no-clean --include \"packages/datadog-instrumentations/src/**/*.js\" -- npm run test:instrumentations:misc",
|
|
41
|
+
"test:core": "node scripts/mocha-parallel-files.js --expose-gc --timeout 30000 -- packages/datadog-core/test/**/*.spec.js",
|
|
42
|
+
"test:core:ci": "nyc --no-clean --include \"packages/datadog-core/src/**/*.js\" -- npm run test:core",
|
|
43
|
+
"test:code-origin": "mocha packages/datadog-code-origin/test/**/*.spec.js",
|
|
44
|
+
"test:code-origin:ci": "nyc --no-clean --include \"packages/datadog-code-origin/**/*.js\" -- npm run test:code-origin",
|
|
45
|
+
"test:lambda": "mocha packages/dd-trace/test/lambda/**/*.spec.js",
|
|
44
46
|
"test:lambda:ci": "nyc --no-clean --include \"packages/dd-trace/src/lambda/**/*.js\" -- npm run test:lambda",
|
|
45
|
-
"test:llmobs:sdk": "mocha
|
|
47
|
+
"test:llmobs:sdk": "mocha --exclude \"packages/dd-trace/test/llmobs/plugins/**/*.spec.js\" \"packages/dd-trace/test/llmobs/**/*.spec.js\"",
|
|
46
48
|
"test:llmobs:sdk:ci": "nyc --no-clean --include \"packages/dd-trace/src/llmobs/**/*.js\" -- npm run test:llmobs:sdk",
|
|
47
|
-
"test:llmobs:plugins": "mocha
|
|
49
|
+
"test:llmobs:plugins": "mocha \"packages/dd-trace/test/llmobs/plugins/@(${PLUGINS})/*.spec.js\"",
|
|
48
50
|
"test:llmobs:plugins:ci": "yarn services && nyc --no-clean --include \"packages/dd-trace/src/llmobs/**/*.js\" -- npm run test:llmobs:plugins",
|
|
49
|
-
"test:openfeature": "mocha
|
|
51
|
+
"test:openfeature": "mocha packages/dd-trace/test/openfeature/**/*.spec.js",
|
|
50
52
|
"test:openfeature:ci": "nyc --no-clean --include \"packages/dd-trace/src/openfeature/**/*.js\" -- npm run test:openfeature",
|
|
51
|
-
"test:plugins": "
|
|
52
|
-
"test:plugins:ci": "yarn services && nyc --no-clean --include \"packages/datadog-plugin-@($
|
|
53
|
-
"test:plugins:ci:flaky": "yarn services && nyc --no-clean --include \"packages/datadog-plugin-@($
|
|
53
|
+
"test:plugins": "node --expose-gc ./node_modules/mocha/bin/mocha.js \"packages/datadog-plugin-@(${PLUGINS})/test/**/${SPEC:-*}*.spec.js\"",
|
|
54
|
+
"test:plugins:ci": "yarn services && nyc --no-clean --include \"packages/datadog-plugin-@(${PLUGINS})/src/**/*.js\" -- npm run test:plugins",
|
|
55
|
+
"test:plugins:ci:flaky": "yarn services && nyc --no-clean --include \"packages/datadog-plugin-@(${PLUGINS})/src/**/*.js\" -- npm run test:plugins -- --bail --retries 2",
|
|
54
56
|
"test:plugins:upstream": "node ./packages/dd-trace/test/plugins/suite.js",
|
|
55
|
-
"test:profiler": "
|
|
56
|
-
"test:profiler:ci": "
|
|
57
|
-
"test:integration": "mocha --timeout 60000
|
|
58
|
-
"test:integration:aiguard": "mocha --timeout 60000
|
|
59
|
-
"test:integration:appsec": "mocha --timeout 60000
|
|
60
|
-
"test:integration:cucumber": "mocha --timeout 60000
|
|
61
|
-
"test:integration:cypress": "mocha --timeout 60000
|
|
62
|
-
"test:integration:debugger": "mocha --timeout 60000
|
|
63
|
-
"test:integration:esbuild": "mocha --timeout 60000
|
|
64
|
-
"test:integration:openfeature": "mocha --timeout 60000
|
|
65
|
-
"test:integration:jest": "mocha --timeout 60000
|
|
66
|
-
"test:integration:mocha": "mocha --timeout 60000
|
|
67
|
-
"test:integration:playwright": "mocha --timeout 60000
|
|
68
|
-
"test:integration:selenium": "mocha --timeout 60000
|
|
69
|
-
"test:integration:vitest": "mocha --timeout 60000
|
|
70
|
-
"test:integration:testopt": "mocha --timeout 120000
|
|
71
|
-
"test:integration:profiler": "mocha --timeout 180000
|
|
72
|
-
"test:integration:plugins": "mocha
|
|
73
|
-
"test:unit:plugins": "mocha
|
|
74
|
-
"test:shimmer": "mocha
|
|
75
|
-
"test:shimmer:ci": "nyc --no-clean --include
|
|
57
|
+
"test:profiler": "node scripts/mocha-parallel-files.js --expose-gc --timeout 30000 -- packages/dd-trace/test/profiling/**/*.spec.js",
|
|
58
|
+
"test:profiler:ci": "nyc --no-clean --include \"packages/dd-trace/src/profiling/**/*.js\" -- npm run test:profiler",
|
|
59
|
+
"test:integration": "mocha --timeout 60000 \"integration-tests/*.spec.js\"",
|
|
60
|
+
"test:integration:aiguard": "mocha --timeout 60000 \"integration-tests/aiguard/*.spec.js\"",
|
|
61
|
+
"test:integration:appsec": "mocha --timeout 60000 \"integration-tests/appsec/*.spec.js\"",
|
|
62
|
+
"test:integration:cucumber": "mocha --timeout 60000 \"integration-tests/cucumber/*.spec.js\"",
|
|
63
|
+
"test:integration:cypress": "mocha --timeout 60000 \"integration-tests/cypress/*.spec.js\"",
|
|
64
|
+
"test:integration:debugger": "mocha --timeout 60000 \"integration-tests/debugger/*.spec.js\"",
|
|
65
|
+
"test:integration:esbuild": "mocha --timeout 60000 \"integration-tests/esbuild/*.spec.js\"",
|
|
66
|
+
"test:integration:openfeature": "mocha --timeout 60000 \"integration-tests/openfeature/*.spec.js\"",
|
|
67
|
+
"test:integration:jest": "mocha --timeout 60000 \"integration-tests/jest/*.spec.js\"",
|
|
68
|
+
"test:integration:mocha": "mocha --timeout 60000 \"integration-tests/mocha/*.spec.js\"",
|
|
69
|
+
"test:integration:playwright": "mocha --timeout 60000 \"integration-tests/playwright/*.spec.js\"",
|
|
70
|
+
"test:integration:selenium": "mocha --timeout 60000 \"integration-tests/selenium/*.spec.js\"",
|
|
71
|
+
"test:integration:vitest": "mocha --timeout 60000 \"integration-tests/vitest/*.spec.js\"",
|
|
72
|
+
"test:integration:testopt": "mocha --timeout 120000 \"integration-tests/ci-visibility/*.spec.js\"",
|
|
73
|
+
"test:integration:profiler": "mocha --timeout 180000 \"integration-tests/profiler/*.spec.js\"",
|
|
74
|
+
"test:integration:plugins": "mocha \"packages/datadog-plugin-@($(echo $PLUGINS))/test/integration-test/**/*.spec.js\"",
|
|
75
|
+
"test:unit:plugins": "mocha \"packages/datadog-instrumentations/test/@($(echo $PLUGINS)).spec.js\" \"packages/datadog-plugin-@($(echo $PLUGINS))/test/**/*.spec.js\" --exclude \"packages/datadog-plugin-@($(echo $PLUGINS))/test/integration-test/**/*.spec.js\"",
|
|
76
|
+
"test:shimmer": "mocha \"packages/datadog-shimmer/test/**/*.spec.js\"",
|
|
77
|
+
"test:shimmer:ci": "nyc --no-clean --include \"packages/datadog-shimmer/src/**/*.js\" -- npm run test:shimmer",
|
|
78
|
+
"verify-exercised-tests": "node scripts/verify-exercised-tests.js"
|
|
76
79
|
},
|
|
77
80
|
"repository": {
|
|
78
81
|
"type": "git",
|
|
@@ -95,7 +98,7 @@
|
|
|
95
98
|
},
|
|
96
99
|
"homepage": "https://github.com/DataDog/dd-trace-js#readme",
|
|
97
100
|
"engines": {
|
|
98
|
-
"node": ">=18"
|
|
101
|
+
"node": ">=18 <26"
|
|
99
102
|
},
|
|
100
103
|
"files": [
|
|
101
104
|
"/package.json",
|
|
@@ -127,7 +130,7 @@
|
|
|
127
130
|
],
|
|
128
131
|
"dependencies": {
|
|
129
132
|
"dc-polyfill": "^0.1.10",
|
|
130
|
-
"import-in-the-middle": "
|
|
133
|
+
"import-in-the-middle": "2.0.3"
|
|
131
134
|
},
|
|
132
135
|
"optionalDependencies": {
|
|
133
136
|
"@datadog/libdatadog": "0.7.0",
|
|
@@ -135,40 +138,37 @@
|
|
|
135
138
|
"@datadog/native-iast-taint-tracking": "4.1.0",
|
|
136
139
|
"@datadog/native-metrics": "3.1.1",
|
|
137
140
|
"@datadog/openfeature-node-server": "^0.2.0",
|
|
138
|
-
"@datadog/pprof": "5.
|
|
141
|
+
"@datadog/pprof": "5.13.2",
|
|
139
142
|
"@datadog/wasm-js-rewriter": "5.0.1",
|
|
140
143
|
"@opentelemetry/api": ">=1.0.0 <1.10.0",
|
|
141
144
|
"@opentelemetry/api-logs": "<1.0.0"
|
|
142
145
|
},
|
|
143
146
|
"devDependencies": {
|
|
144
|
-
"@babel/helpers": "^7.28.
|
|
147
|
+
"@babel/helpers": "^7.28.6",
|
|
145
148
|
"@eslint/eslintrc": "^3.3.1",
|
|
146
|
-
"@eslint/js": "^9.39.
|
|
147
|
-
"@msgpack/msgpack": "^3.1.
|
|
149
|
+
"@eslint/js": "^9.39.2",
|
|
150
|
+
"@msgpack/msgpack": "^3.1.3",
|
|
148
151
|
"@openfeature/core": "^1.8.1",
|
|
149
152
|
"@openfeature/server-sdk": "~1.20.0",
|
|
150
|
-
"@stylistic/eslint-plugin": "^5.
|
|
151
|
-
"@types/chai": "^4.3.16",
|
|
153
|
+
"@stylistic/eslint-plugin": "^5.7.0",
|
|
152
154
|
"@types/mocha": "^10.0.10",
|
|
153
155
|
"@types/node": "^18.19.106",
|
|
154
156
|
"@types/sinon": "^21.0.0",
|
|
155
|
-
"@types/tap": "^15.0.12",
|
|
156
157
|
"axios": "^1.12.2",
|
|
157
158
|
"benchmark": "^2.1.4",
|
|
158
|
-
"body-parser": "^2.2.
|
|
159
|
-
"bun": "1.3.
|
|
160
|
-
"
|
|
161
|
-
"eslint": "^
|
|
162
|
-
"eslint-plugin-cypress": "^5.2.0",
|
|
159
|
+
"body-parser": "^2.2.2",
|
|
160
|
+
"bun": "1.3.6",
|
|
161
|
+
"eslint": "^9.39.2",
|
|
162
|
+
"eslint-plugin-cypress": "^5.2.1",
|
|
163
163
|
"eslint-plugin-import": "^2.32.0",
|
|
164
|
-
"eslint-plugin-jsdoc": "^
|
|
164
|
+
"eslint-plugin-jsdoc": "^62.0.0",
|
|
165
165
|
"eslint-plugin-mocha": "^11.2.0",
|
|
166
|
-
"eslint-plugin-n": "^17.23.
|
|
166
|
+
"eslint-plugin-n": "^17.23.2",
|
|
167
167
|
"eslint-plugin-promise": "^7.2.1",
|
|
168
168
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
169
169
|
"express": "^5.1.0",
|
|
170
170
|
"glob": "^10.4.5",
|
|
171
|
-
"globals": "^
|
|
171
|
+
"globals": "^17.0.0",
|
|
172
172
|
"graphql": "*",
|
|
173
173
|
"jszip": "^3.10.1",
|
|
174
174
|
"mocha": "^11.6.0",
|
|
@@ -176,16 +176,14 @@
|
|
|
176
176
|
"mocha-multi-reporters": "^1.5.1",
|
|
177
177
|
"multer": "^2.0.2",
|
|
178
178
|
"nock": "^13.5.6",
|
|
179
|
-
"nyc": "^
|
|
179
|
+
"nyc": "^17.1.0",
|
|
180
180
|
"octokit": "^5.0.3",
|
|
181
181
|
"opentracing": ">=0.14.7",
|
|
182
182
|
"proxyquire": "^2.1.3",
|
|
183
183
|
"retry": "^0.13.1",
|
|
184
184
|
"semifies": "^1.0.0",
|
|
185
185
|
"semver": "^7.7.2",
|
|
186
|
-
"sinon": "^21.0.
|
|
187
|
-
"sinon-chai": "^3.7.0",
|
|
188
|
-
"tap": "^16.3.10",
|
|
186
|
+
"sinon": "^21.0.1",
|
|
189
187
|
"tiktoken": "^1.0.21",
|
|
190
188
|
"typescript": "^5.9.2",
|
|
191
189
|
"workerpool": "^10.0.0",
|
|
@@ -10,12 +10,12 @@ const { AsyncLocalStorage } = require('async_hooks')
|
|
|
10
10
|
* a "handle" object, which is used as a key in a WeakMap, where the values
|
|
11
11
|
* are the real store objects.
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
13
|
+
* @template T
|
|
14
|
+
* @typedef {Record<string, T>} Store
|
|
14
15
|
*/
|
|
15
16
|
class DatadogStorage extends AsyncLocalStorage {
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @param {Store} [store]
|
|
18
|
+
* @param {Store<unknown>} [store]
|
|
19
19
|
* @override
|
|
20
20
|
*/
|
|
21
21
|
enterWith (store) {
|
|
@@ -35,7 +35,7 @@ class DatadogStorage extends AsyncLocalStorage {
|
|
|
35
35
|
*
|
|
36
36
|
* TODO: Refactor the Scope class to use a span-only store and remove this.
|
|
37
37
|
*
|
|
38
|
-
* @returns {Store}
|
|
38
|
+
* @returns {Store<unknown>}
|
|
39
39
|
*/
|
|
40
40
|
getHandle () {
|
|
41
41
|
return super.getStore()
|
|
@@ -48,7 +48,7 @@ class DatadogStorage extends AsyncLocalStorage {
|
|
|
48
48
|
* key. This is useful if you've stashed a handle somewhere and want to
|
|
49
49
|
* retrieve the store with it.
|
|
50
50
|
* @param {object} [handle]
|
|
51
|
-
* @returns {Store | undefined}
|
|
51
|
+
* @returns {Store<unknown> | undefined}
|
|
52
52
|
* @override
|
|
53
53
|
*/
|
|
54
54
|
getStore (handle) {
|
|
@@ -68,7 +68,7 @@ class DatadogStorage extends AsyncLocalStorage {
|
|
|
68
68
|
* WeakMap.
|
|
69
69
|
* @template R
|
|
70
70
|
* @template TArgs = unknown[]
|
|
71
|
-
* @param {Store} store
|
|
71
|
+
* @param {Store<unknown>} store
|
|
72
72
|
* @param {() => R} fn
|
|
73
73
|
* @param {...TArgs} args
|
|
74
74
|
* @returns {R}
|
|
@@ -87,7 +87,7 @@ class DatadogStorage extends AsyncLocalStorage {
|
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
89
|
* This is the map from handles to real stores, used in the class above.
|
|
90
|
-
* @type {WeakMap<WeakKey, Store
|
|
90
|
+
* @type {WeakMap<WeakKey, Store<unknown>|undefined>}
|
|
91
91
|
*/
|
|
92
92
|
const stores = new WeakMap()
|
|
93
93
|
|
|
@@ -8,7 +8,7 @@ const digitRegex = /^\d+$/
|
|
|
8
8
|
* Also supports array-keys. For example:
|
|
9
9
|
* { 'a.0.b': 'value' } -> { a: [{ b: 'value' }] }
|
|
10
10
|
*
|
|
11
|
-
* @param {
|
|
11
|
+
* @param {object} tags - Key/value pairs of tags
|
|
12
12
|
* @returns Object - Parsed tags
|
|
13
13
|
*/
|
|
14
14
|
module.exports = function parseTags (tags) {
|
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
/* eslint-disable no-console */
|
|
4
4
|
|
|
5
|
+
const { execSync } = require('child_process')
|
|
6
|
+
const fs = require('fs')
|
|
7
|
+
const RAW_BUILTINS = require('module').builtinModules
|
|
8
|
+
const path = require('path')
|
|
9
|
+
const { pathToFileURL, fileURLToPath } = require('url')
|
|
10
|
+
|
|
5
11
|
const instrumentations = require('../datadog-instrumentations/src/helpers/instrumentations.js')
|
|
6
|
-
|
|
12
|
+
|
|
7
13
|
const extractPackageAndModulePath = require(
|
|
8
14
|
'../datadog-instrumentations/src/helpers/extract-package-and-module-path.js'
|
|
9
15
|
)
|
|
10
|
-
|
|
11
|
-
const { pathToFileURL, fileURLToPath } = require('url')
|
|
16
|
+
const hooks = require('../datadog-instrumentations/src/helpers/hooks.js')
|
|
12
17
|
const { processModule, isESMFile } = require('./src/utils.js')
|
|
13
18
|
|
|
14
19
|
const ESM_INTERCEPTED_SUFFIX = '._dd_esbuild_intercepted'
|
|
@@ -36,11 +41,7 @@ for (const instrumentation of Object.values(instrumentations)) {
|
|
|
36
41
|
}
|
|
37
42
|
}
|
|
38
43
|
|
|
39
|
-
const RAW_BUILTINS = require('module').builtinModules
|
|
40
44
|
const CHANNEL = 'dd-trace:bundler:load'
|
|
41
|
-
const path = require('path')
|
|
42
|
-
const fs = require('fs')
|
|
43
|
-
const { execSync } = require('child_process')
|
|
44
45
|
|
|
45
46
|
const builtins = new Set()
|
|
46
47
|
|
|
@@ -96,6 +97,12 @@ function getGitMetadata () {
|
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
module.exports.setup = function (build) {
|
|
100
|
+
if (build.initialOptions.minify && !build.initialOptions.keepNames) {
|
|
101
|
+
throw new Error(
|
|
102
|
+
'Using --minify without --keep-names will break some dd-trace behavior. Refusing to bundle.'
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
if (DD_IAST_ENABLED) {
|
|
100
107
|
const iastRewriter = require('../dd-trace/src/appsec/iast/taint-tracking/rewriter')
|
|
101
108
|
rewriter = iastRewriter.getRewriter()
|
|
@@ -7,8 +7,20 @@ const path = require('node:path')
|
|
|
7
7
|
const { NODE_MAJOR, NODE_MINOR } = require('../../../version.js')
|
|
8
8
|
|
|
9
9
|
const getExportsImporting = (url) => import(url).then(Object.keys)
|
|
10
|
+
let getExportsModulePromise
|
|
11
|
+
|
|
12
|
+
const loadGetExportsModule = () => {
|
|
13
|
+
if (!getExportsModulePromise) {
|
|
14
|
+
getExportsModulePromise = import('import-in-the-middle/lib/get-exports.mjs')
|
|
15
|
+
}
|
|
16
|
+
return getExportsModulePromise
|
|
17
|
+
}
|
|
18
|
+
|
|
10
19
|
const getExports = NODE_MAJOR >= 20 || (NODE_MAJOR === 18 && NODE_MINOR >= 19)
|
|
11
|
-
?
|
|
20
|
+
? async (srcUrl, context, getSource) => {
|
|
21
|
+
const mod = await loadGetExportsModule()
|
|
22
|
+
return mod.getExports(srcUrl, context, getSource)
|
|
23
|
+
}
|
|
12
24
|
: getExportsImporting
|
|
13
25
|
|
|
14
26
|
function isStarExportLine (line) {
|
|
@@ -168,7 +180,7 @@ async function processModule ({ path, internal, context, excludeDefault }) {
|
|
|
168
180
|
*
|
|
169
181
|
* @param {string} fullPathToModule File to analize
|
|
170
182
|
* @param {string} [modulePackageJsonPath] Path of the package.json
|
|
171
|
-
* @param {
|
|
183
|
+
* @param {object} [packageJson] The content of the module package.json
|
|
172
184
|
* @returns {boolean}
|
|
173
185
|
*/
|
|
174
186
|
function isESMFile (fullPathToModule, modulePackageJsonPath, packageJson = {}) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const tracingChannel = require('dc-polyfill').tracingChannel
|
|
4
|
+
|
|
5
|
+
const shimmer = require('../../datadog-shimmer')
|
|
3
6
|
const {
|
|
4
7
|
addHook
|
|
5
8
|
} = require('./helpers/instrument')
|
|
6
|
-
const shimmer = require('../../datadog-shimmer')
|
|
7
9
|
|
|
8
|
-
const tracingChannel = require('dc-polyfill').tracingChannel
|
|
9
10
|
const ch = tracingChannel('apm:aerospike:command')
|
|
10
11
|
|
|
11
12
|
function wrapCreateCommand (createCommand) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { channel, tracingChannel } = require('dc-polyfill')
|
|
4
4
|
const shimmer = require('../../datadog-shimmer')
|
|
5
|
+
const { addHook } = require('./helpers/instrument')
|
|
5
6
|
|
|
6
|
-
const { channel, tracingChannel } = require('dc-polyfill')
|
|
7
7
|
const toolCreationChannel = channel('dd-trace:vercel-ai:tool')
|
|
8
8
|
|
|
9
9
|
const TRACED_FUNCTIONS = {
|
|
@@ -41,8 +41,14 @@ const noopTracer = {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
const tracers = new WeakSet()
|
|
45
|
+
|
|
44
46
|
function wrapTracer (tracer) {
|
|
45
|
-
if (
|
|
47
|
+
if (tracers.has(tracer)) {
|
|
48
|
+
return
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
tracers.add(tracer)
|
|
46
52
|
|
|
47
53
|
shimmer.wrap(tracer, 'startActiveSpan', function (startActiveSpan) {
|
|
48
54
|
return function () {
|
|
@@ -90,8 +96,6 @@ function wrapTracer (tracer) {
|
|
|
90
96
|
})
|
|
91
97
|
}
|
|
92
98
|
})
|
|
93
|
-
|
|
94
|
-
Object.defineProperty(tracer, Symbol.for('_dd.wrapped'), { value: true })
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
function wrapWithTracer (fn) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const shimmer = require('../../datadog-shimmer')
|
|
3
4
|
const {
|
|
4
5
|
channel,
|
|
5
6
|
addHook
|
|
6
7
|
} = require('./helpers/instrument')
|
|
7
|
-
const shimmer = require('../../datadog-shimmer')
|
|
8
8
|
|
|
9
9
|
addHook({ name: 'amqp10', file: 'lib/sender_link.js', versions: ['>=3'] }, SenderLink => {
|
|
10
10
|
const startCh = channel('apm:amqp10:send:start')
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const {
|
|
4
|
-
channel,
|
|
5
|
-
addHook
|
|
6
|
-
} = require('./helpers/instrument')
|
|
7
3
|
const kebabCase = require('../../datadog-core/src/utils/src/kebabcase')
|
|
8
4
|
const shimmer = require('../../datadog-shimmer')
|
|
9
5
|
|
|
10
6
|
const { NODE_MAJOR, NODE_MINOR } = require('../../../version')
|
|
7
|
+
const {
|
|
8
|
+
channel,
|
|
9
|
+
addHook
|
|
10
|
+
} = require('./helpers/instrument')
|
|
11
11
|
const MIN_VERSION = ((NODE_MAJOR > 22) || (NODE_MAJOR === 22 && NODE_MINOR >= 2)) ? '>=0.5.3' : '>=0.5.0'
|
|
12
12
|
|
|
13
13
|
const commandStartCh = channel('apm:amqplib:command:start')
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { addHook } = require('./helpers/instrument')
|
|
4
|
-
const shimmer = require('../../datadog-shimmer')
|
|
5
3
|
const { channel, tracingChannel } = require('dc-polyfill')
|
|
4
|
+
const shimmer = require('../../datadog-shimmer')
|
|
5
|
+
const { addHook } = require('./helpers/instrument')
|
|
6
6
|
|
|
7
7
|
const anthropicTracingChannel = tracingChannel('apm:anthropic:request')
|
|
8
8
|
const onStreamedChunkCh = channel('apm:anthropic:request:chunk')
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { addHook } = require('./helpers/instrument')
|
|
4
|
-
const shimmer = require('../../datadog-shimmer')
|
|
5
3
|
const dc = require('dc-polyfill')
|
|
4
|
+
const shimmer = require('../../datadog-shimmer')
|
|
5
|
+
const { addHook } = require('./helpers/instrument')
|
|
6
6
|
|
|
7
7
|
const requestChannel = dc.tracingChannel('datadog:apollo-server-core:request')
|
|
8
8
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const dc = require('dc-polyfill')
|
|
4
4
|
|
|
5
|
-
const { addHook } = require('./helpers/instrument')
|
|
6
5
|
const shimmer = require('../../datadog-shimmer')
|
|
6
|
+
const { addHook } = require('./helpers/instrument')
|
|
7
7
|
|
|
8
8
|
const graphqlMiddlewareChannel = dc.tracingChannel('datadog:apollo:middleware')
|
|
9
9
|
const apolloHttpServerChannel = dc.tracingChannel('datadog:apollo:httpserver')
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const tracingChannel = require('dc-polyfill').tracingChannel
|
|
4
|
+
|
|
5
|
+
const shimmer = require('../../datadog-shimmer')
|
|
3
6
|
const {
|
|
4
7
|
addHook,
|
|
5
8
|
channel
|
|
6
9
|
} = require('./helpers/instrument')
|
|
7
|
-
const shimmer = require('../../datadog-shimmer')
|
|
8
|
-
const tracingChannel = require('dc-polyfill').tracingChannel
|
|
9
10
|
|
|
10
11
|
const CHANNELS = {
|
|
11
12
|
'gateway.request': tracingChannel('apm:apollo:gateway:request'),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const dc = require('dc-polyfill')
|
|
3
4
|
const shimmer = require('../../datadog-shimmer')
|
|
4
5
|
const { addHook } = require('./helpers/instrument')
|
|
5
6
|
|
|
6
|
-
const dc = require('dc-polyfill')
|
|
7
7
|
const serializeChannel = dc.channel('apm:avsc:serialize-start')
|
|
8
8
|
const deserializeChannel = dc.channel('apm:avsc:deserialize-end')
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const dc = require('dc-polyfill')
|
|
4
|
+
const shimmer = require('../../datadog-shimmer')
|
|
3
5
|
const {
|
|
4
6
|
addHook
|
|
5
7
|
} = require('./helpers/instrument')
|
|
6
|
-
const shimmer = require('../../datadog-shimmer')
|
|
7
|
-
const dc = require('dc-polyfill')
|
|
8
8
|
|
|
9
9
|
const producerCh = dc.tracingChannel('apm:azure-event-hubs:send')
|
|
10
10
|
|
|
@@ -13,6 +13,7 @@ addHook({
|
|
|
13
13
|
versions: ['>=6.0.0']
|
|
14
14
|
}, obj => {
|
|
15
15
|
const EventHubProducerClient = obj.EventHubProducerClient
|
|
16
|
+
|
|
16
17
|
shimmer.wrap(EventHubProducerClient.prototype, 'createBatch',
|
|
17
18
|
createBatch => async function () {
|
|
18
19
|
const batch = await createBatch.apply(this, arguments)
|
|
@@ -20,7 +21,7 @@ addHook({
|
|
|
20
21
|
tryAdd => function (eventData) {
|
|
21
22
|
const config = this._context.config
|
|
22
23
|
const functionName = tryAdd.name
|
|
23
|
-
return producerCh.
|
|
24
|
+
return producerCh.traceSync(
|
|
24
25
|
tryAdd,
|
|
25
26
|
{ functionName, eventData, batch: this, config },
|
|
26
27
|
this, ...arguments)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const dc = require('dc-polyfill')
|
|
4
|
+
const shimmer = require('../../datadog-shimmer')
|
|
3
5
|
const {
|
|
4
6
|
addHook
|
|
5
7
|
} = require('./helpers/instrument')
|
|
6
|
-
const shimmer = require('../../datadog-shimmer')
|
|
7
|
-
const dc = require('dc-polyfill')
|
|
8
8
|
|
|
9
9
|
const azureFunctionsChannel = dc.tracingChannel('datadog:azure:functions:invoke')
|
|
10
10
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const dc = require('dc-polyfill')
|
|
4
|
+
const shimmer = require('../../datadog-shimmer')
|
|
3
5
|
const {
|
|
4
6
|
addHook
|
|
5
7
|
} = require('./helpers/instrument')
|
|
6
8
|
|
|
7
|
-
const shimmer = require('../../datadog-shimmer')
|
|
8
|
-
const dc = require('dc-polyfill')
|
|
9
|
-
|
|
10
9
|
const producerCh = dc.tracingChannel('apm:azure-service-bus:send')
|
|
11
10
|
const isItDefault = new WeakSet()
|
|
12
11
|
|
|
@@ -38,7 +37,7 @@ addHook({ name: '@azure/service-bus', versions: ['>=7.9.2'] }, (obj) => {
|
|
|
38
37
|
shimmer.wrap(batch, 'tryAddMessage', tryAddMessage => function (msg) {
|
|
39
38
|
const functionName = tryAddMessage.name
|
|
40
39
|
const config = this._context.config
|
|
41
|
-
return producerCh.
|
|
40
|
+
return producerCh.traceSync(
|
|
42
41
|
tryAddMessage, { config, functionName, batch, msg }, this, ...arguments)
|
|
43
42
|
})
|
|
44
43
|
return batch
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const shimmer = require('../../datadog-shimmer')
|
|
3
4
|
const { addHook } = require('./helpers/instrument')
|
|
4
5
|
const { wrapThen } = require('./helpers/promise')
|
|
5
|
-
const shimmer = require('../../datadog-shimmer')
|
|
6
6
|
|
|
7
7
|
function createGetNewLibraryCopyWrap (originalLib) {
|
|
8
8
|
return function wrapGetNewLibraryCopy (getNewLibraryCopy) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// AUTO-GENERATED by dd-compile
|
|
2
|
+
// Orchestrion rewriter handles the actual instrumentation via JSON config.
|
|
3
|
+
// This file registers the module hooks for the rewriter to process.
|
|
4
|
+
|
|
5
|
+
'use strict'
|
|
6
|
+
|
|
7
|
+
const { addHook, getHooks } = require('./helpers/instrument')
|
|
8
|
+
|
|
9
|
+
for (const hook of getHooks('bullmq')) {
|
|
10
|
+
addHook(hook, exports => exports)
|
|
11
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const shimmer = require('../../datadog-shimmer')
|
|
3
4
|
const {
|
|
4
5
|
channel,
|
|
5
6
|
addHook
|
|
6
7
|
} = require('./helpers/instrument')
|
|
7
|
-
const shimmer = require('../../datadog-shimmer')
|
|
8
8
|
|
|
9
9
|
addHook({ name: 'bunyan', versions: ['>=1'] }, Logger => {
|
|
10
10
|
const logCh = channel('apm:bunyan:log')
|