dd-trace 5.81.0 → 5.82.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/index.d.ts +7 -0
- package/loader-hook.mjs +7 -2
- package/package.json +13 -18
- package/packages/datadog-core/src/utils/src/parse-tags.js +1 -1
- package/packages/datadog-esbuild/index.js +8 -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 +2 -2
- 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 +2 -2
- 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 +12 -13
- 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 +1 -1
- 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/register.js +6 -4
- 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/ioredis.js +1 -1
- package/packages/datadog-instrumentations/src/iovalkey.js +1 -1
- package/packages/datadog-instrumentations/src/jest.js +2 -2
- package/packages/datadog-instrumentations/src/kafkajs.js +3 -3
- package/packages/datadog-instrumentations/src/knex.js +1 -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/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 +1 -1
- package/packages/datadog-instrumentations/src/mysql2.js +1 -1
- package/packages/datadog-instrumentations/src/net.js +1 -1
- package/packages/datadog-instrumentations/src/next.js +1 -1
- package/packages/datadog-instrumentations/src/nyc.js +1 -1
- 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 +1 -1
- package/packages/datadog-instrumentations/src/pg.js +3 -3
- package/packages/datadog-instrumentations/src/pino.js +1 -1
- package/packages/datadog-instrumentations/src/playwright.js +1 -1
- 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 +1 -1
- 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 +4 -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/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 +19 -5
- package/packages/datadog-plugin-azure-service-bus/src/index.js +1 -1
- package/packages/datadog-plugin-azure-service-bus/src/producer.js +4 -0
- 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-cypress/src/plugin.js +1 -1
- package/packages/datadog-plugin-express/src/index.js +1 -1
- 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-kafkajs/src/index.js +1 -1
- package/packages/datadog-plugin-langchain/src/index.js +1 -1
- package/packages/datadog-plugin-moleculer/src/index.js +1 -1
- package/packages/datadog-plugin-mongodb-core/src/index.js +6 -2
- 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-rhea/src/index.js +1 -1
- 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/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 +10 -14
- 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 +1 -1
- 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 +8 -2
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +6 -0
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/index.js +2 -2
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +1 -1
- package/packages/dd-trace/src/ci-visibility/exporters/test-worker/index.js +1 -1
- package/packages/dd-trace/src/config/remote_config.js +34 -0
- package/packages/dd-trace/src/config.js +29 -28
- package/packages/dd-trace/src/config_defaults.js +2 -1
- package/packages/dd-trace/src/constants.js +5 -0
- package/packages/dd-trace/src/crashtracking/crashtracker.js +10 -1
- 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 +2 -2
- package/packages/dd-trace/src/datastreams/writer.js +2 -2
- package/packages/dd-trace/src/debugger/config.js +1 -0
- 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 +3 -3
- 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/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 +1 -1
- package/packages/dd-trace/src/dogstatsd.js +3 -2
- package/packages/dd-trace/src/encode/0.4.js +1 -1
- 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 +1 -1
- package/packages/dd-trace/src/exporters/common/agent-info-exporter.js +1 -1
- package/packages/dd-trace/src/exporters/common/request.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 +1 -1
- package/packages/dd-trace/src/guardrails/index.js +6 -3
- package/packages/dd-trace/src/id.js +1 -1
- package/packages/dd-trace/src/index.js +1 -1
- package/packages/dd-trace/src/lambda/handler.js +4 -4
- package/packages/dd-trace/src/lambda/index.js +1 -1
- package/packages/dd-trace/src/lambda/runtime/patch.js +4 -4
- package/packages/dd-trace/src/lambda/runtime/ritm.js +1 -1
- package/packages/dd-trace/src/llmobs/constants/tags.js +7 -1
- package/packages/dd-trace/src/llmobs/index.js +8 -9
- 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 +16 -1
- 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 +15 -22
- package/packages/dd-trace/src/llmobs/span_processor.js +9 -13
- package/packages/dd-trace/src/llmobs/telemetry.js +3 -4
- package/packages/dd-trace/src/llmobs/writers/base.js +2 -2
- package/packages/dd-trace/src/llmobs/writers/spans.js +1 -2
- package/packages/dd-trace/src/log/index.js +1 -1
- package/packages/dd-trace/src/noop/proxy.js +2 -2
- 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 +5 -5
- 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_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 +3 -3
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +24 -8
- package/packages/dd-trace/src/opentracing/span.js +3 -3
- 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 +1 -1
- 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 +1 -1
- 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 +24 -24
- package/packages/dd-trace/src/plugins/util/user-provided-git.js +1 -1
- 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/profiling/config.js +32 -21
- package/packages/dd-trace/src/profiling/exporter_cli.js +4 -4
- package/packages/dd-trace/src/profiling/exporters/agent.js +5 -5
- 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 +4 -5
- 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 +12 -18
- 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 +50 -27
- package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +1 -1
- package/packages/dd-trace/src/serverless.js +16 -0
- 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 +2 -2
- 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 +3 -3
- package/packages/dd-trace/src/supported-configurations.json +3 -0
- package/packages/dd-trace/src/telemetry/dependencies.js +3 -3
- package/packages/dd-trace/src/telemetry/endpoints.js +8 -8
- package/packages/dd-trace/src/telemetry/logs/index.js +1 -1
- package/packages/dd-trace/src/telemetry/telemetry.js +11 -6
- 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
|
@@ -19,7 +19,17 @@ class WafUpdateError extends Error {
|
|
|
19
19
|
|
|
20
20
|
let limiter = new Limiter(100)
|
|
21
21
|
|
|
22
|
+
/** @typedef {import('./waf_manager')} WAFManager */
|
|
23
|
+
|
|
24
|
+
/** @type {typeof import('./waf_manager') | null} */
|
|
25
|
+
let WAFManager = null
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {import('./waf_manager').WAFManagerConfig & { rateLimit: number }} WAFConfig
|
|
29
|
+
*/
|
|
30
|
+
|
|
22
31
|
const waf = {
|
|
32
|
+
/** @type {WAFManager | null} */
|
|
23
33
|
wafManager: null,
|
|
24
34
|
init,
|
|
25
35
|
destroy,
|
|
@@ -31,13 +41,17 @@ const waf = {
|
|
|
31
41
|
WafUpdateError
|
|
32
42
|
}
|
|
33
43
|
|
|
44
|
+
/**
|
|
45
|
+
* @param {object} rules
|
|
46
|
+
* @param {WAFConfig} config
|
|
47
|
+
*/
|
|
34
48
|
function init (rules, config) {
|
|
35
49
|
destroy()
|
|
36
50
|
|
|
37
51
|
limiter = new Limiter(config.rateLimit)
|
|
38
52
|
|
|
39
|
-
//
|
|
40
|
-
|
|
53
|
+
// Lazy loading improves the startup time
|
|
54
|
+
WAFManager = require('./waf_manager')
|
|
41
55
|
|
|
42
56
|
waf.wafManager = new WAFManager(rules, config)
|
|
43
57
|
|
|
@@ -70,7 +84,7 @@ function updateConfig (product, configId, configPath, config) {
|
|
|
70
84
|
|
|
71
85
|
try {
|
|
72
86
|
if (product === 'ASM_DD') {
|
|
73
|
-
waf.wafManager.removeConfig(
|
|
87
|
+
waf.wafManager.removeConfig((/** @type {NonNullable<typeof WAFManager>} */ (WAFManager)).defaultWafConfigPath)
|
|
74
88
|
}
|
|
75
89
|
|
|
76
90
|
const updateSucceeded = waf.wafManager.updateConfig(configPath, config)
|
|
@@ -6,9 +6,20 @@ const WAFContextWrapper = require('./waf_context_wrapper')
|
|
|
6
6
|
|
|
7
7
|
const contexts = new WeakMap()
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {object} WAFManagerConfig
|
|
11
|
+
* @property {number} wafTimeout - Maximum time in microseconds for WAF execution
|
|
12
|
+
* @property {string} obfuscatorKeyRegex - Regex to redact sensitive data by key
|
|
13
|
+
* @property {string} obfuscatorValueRegex - Regex to redact sensitive data by value
|
|
14
|
+
*/
|
|
15
|
+
|
|
9
16
|
class WAFManager {
|
|
10
17
|
static defaultWafConfigPath = 'datadog/00/ASM_DD/default/config'
|
|
11
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @param {object} rules
|
|
21
|
+
* @param {WAFManagerConfig} config
|
|
22
|
+
*/
|
|
12
23
|
constructor (rules, config) {
|
|
13
24
|
this.config = config
|
|
14
25
|
this.wafTimeout = config.wafTimeout
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// Modeled after https://github.com/DataDog/libdatadog/blob/f3994857a59bb5679a65967138c5a3aec418a65f/ddcommon/src/azure_app_services.rs
|
|
4
4
|
|
|
5
5
|
const os = require('os')
|
|
6
|
-
const { getIsAzureFunction } = require('./serverless')
|
|
7
6
|
const { getEnvironmentVariable, getEnvironmentVariables } = require('../../dd-trace/src/config-helper')
|
|
7
|
+
const { getIsAzureFunction, getIsFlexConsumptionAzureFunction } = require('./serverless')
|
|
8
8
|
|
|
9
9
|
function extractSubscriptionID (ownerName) {
|
|
10
10
|
if (ownerName !== undefined) {
|
|
@@ -38,6 +38,7 @@ function buildMetadata () {
|
|
|
38
38
|
const {
|
|
39
39
|
COMPUTERNAME,
|
|
40
40
|
DD_AAS_DOTNET_EXTENSION_VERSION,
|
|
41
|
+
DD_AZURE_RESOURCE_GROUP,
|
|
41
42
|
FUNCTIONS_EXTENSION_VERSION,
|
|
42
43
|
FUNCTIONS_WORKER_RUNTIME,
|
|
43
44
|
FUNCTIONS_WORKER_RUNTIME_VERSION,
|
|
@@ -56,7 +57,12 @@ function buildMetadata () {
|
|
|
56
57
|
? ['functionapp', 'function']
|
|
57
58
|
: ['app', 'app']
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
// Azure Functions on Flex Consumption plans require the `DD_AZURE_RESOURCE_GROUP` env var.
|
|
61
|
+
// If this logic ever changes, update the logic in `libdatadog`, `serverless-components/src/datadog-trace-agent`,
|
|
62
|
+
// and the serverless compat layers accordingly.
|
|
63
|
+
const resourceGroup = getIsFlexConsumptionAzureFunction()
|
|
64
|
+
? (DD_AZURE_RESOURCE_GROUP ?? WEBSITE_RESOURCE_GROUP ?? extractResourceGroup(WEBSITE_OWNER_NAME))
|
|
65
|
+
: (WEBSITE_RESOURCE_GROUP ?? extractResourceGroup(WEBSITE_OWNER_NAME))
|
|
60
66
|
|
|
61
67
|
return trimObject({
|
|
62
68
|
extensionVersion: DD_AAS_DOTNET_EXTENSION_VERSION,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const {
|
|
4
4
|
workerData: {
|
|
5
|
+
config,
|
|
5
6
|
breakpointSetChannel,
|
|
6
7
|
breakpointHitChannel,
|
|
7
8
|
breakpointRemoveChannel
|
|
@@ -21,6 +22,7 @@ const {
|
|
|
21
22
|
getStackFromCallFrames
|
|
22
23
|
} = require('../../../debugger/devtools_client/state')
|
|
23
24
|
const log = require('../../../log')
|
|
25
|
+
const processTags = require('../../../process-tags')
|
|
24
26
|
|
|
25
27
|
let sessionStarted = false
|
|
26
28
|
|
|
@@ -55,6 +57,10 @@ session.on('Debugger.paused', async ({ params: { hitBreakpoints: [hitBreakpoint]
|
|
|
55
57
|
language: 'javascript'
|
|
56
58
|
}
|
|
57
59
|
|
|
60
|
+
if (config.propagateProcessTags?.enabled) {
|
|
61
|
+
snapshot[processTags.DYNAMIC_INSTRUMENTATION_FIELD_NAME] = processTags.tagsObject
|
|
62
|
+
}
|
|
63
|
+
|
|
58
64
|
breakpointHitChannel.postMessage({ snapshot })
|
|
59
65
|
})
|
|
60
66
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const URL = require('url').URL
|
|
4
|
-
const Writer = require('./writer')
|
|
5
|
-
const CoverageWriter = require('./coverage-writer')
|
|
6
4
|
const CiVisibilityExporter = require('../ci-visibility-exporter')
|
|
7
5
|
const log = require('../../../log')
|
|
6
|
+
const Writer = require('./writer')
|
|
7
|
+
const CoverageWriter = require('./coverage-writer')
|
|
8
8
|
|
|
9
9
|
class AgentlessCiVisibilityExporter extends CiVisibilityExporter {
|
|
10
10
|
constructor (config) {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const URL = require('url').URL
|
|
4
4
|
|
|
5
|
-
const { sendGitMetadata: sendGitMetadataRequest } = require('./git/git_metadata')
|
|
6
5
|
const { getLibraryConfiguration: getLibraryConfigurationRequest } = require('../requests/get-library-configuration')
|
|
7
6
|
const { getSkippableSuites: getSkippableSuitesRequest } = require('../intelligent-test-runner/get-skippable-suites')
|
|
8
7
|
const { getKnownTests: getKnownTestsRequest } = require('../early-flake-detection/get-known-tests')
|
|
@@ -11,6 +10,7 @@ const { getTestManagementTests: getTestManagementTestsRequest } =
|
|
|
11
10
|
const log = require('../../log')
|
|
12
11
|
const AgentInfoExporter = require('../../exporters/common/agent-info-exporter')
|
|
13
12
|
const { GIT_REPOSITORY_URL, GIT_COMMIT_SHA } = require('../../plugins/util/tags')
|
|
13
|
+
const { sendGitMetadata: sendGitMetadataRequest } = require('./git/git_metadata')
|
|
14
14
|
|
|
15
15
|
function getTestConfigurationTags (tags) {
|
|
16
16
|
if (!tags) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const Writer = require('./writer')
|
|
4
3
|
const {
|
|
5
4
|
JEST_WORKER_COVERAGE_PAYLOAD_CODE,
|
|
6
5
|
JEST_WORKER_TRACE_PAYLOAD_CODE,
|
|
@@ -12,6 +11,7 @@ const {
|
|
|
12
11
|
VITEST_WORKER_LOGS_PAYLOAD_CODE
|
|
13
12
|
} = require('../../../plugins/util/test')
|
|
14
13
|
const { getEnvironmentVariable } = require('../../../config-helper')
|
|
14
|
+
const Writer = require('./writer')
|
|
15
15
|
|
|
16
16
|
function getInterprocessTraceCode () {
|
|
17
17
|
if (getEnvironmentVariable('JEST_WORKER_ID')) {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const RemoteConfigCapabilities = require('../remote_config/capabilities')
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Configures remote config for core APM tracing functionality
|
|
7
|
+
*
|
|
8
|
+
* @param {object} rc - RemoteConfig instance
|
|
9
|
+
* @param {object} config - Tracer config
|
|
10
|
+
* @param {Function} enableOrDisableTracing - Function to enable/disable tracing based on config
|
|
11
|
+
*/
|
|
12
|
+
function enable (rc, config, enableOrDisableTracing) {
|
|
13
|
+
// Register core APM tracing capabilities
|
|
14
|
+
rc.updateCapabilities(RemoteConfigCapabilities.APM_TRACING_CUSTOM_TAGS, true)
|
|
15
|
+
rc.updateCapabilities(RemoteConfigCapabilities.APM_TRACING_HTTP_HEADER_TAGS, true)
|
|
16
|
+
rc.updateCapabilities(RemoteConfigCapabilities.APM_TRACING_LOGS_INJECTION, true)
|
|
17
|
+
rc.updateCapabilities(RemoteConfigCapabilities.APM_TRACING_SAMPLE_RATE, true)
|
|
18
|
+
rc.updateCapabilities(RemoteConfigCapabilities.APM_TRACING_ENABLED, true)
|
|
19
|
+
rc.updateCapabilities(RemoteConfigCapabilities.APM_TRACING_SAMPLE_RULES, true)
|
|
20
|
+
|
|
21
|
+
// APM_TRACING product handler - manages tracer configuration
|
|
22
|
+
rc.setProductHandler('APM_TRACING', (action, conf) => {
|
|
23
|
+
if (action === 'unapply') {
|
|
24
|
+
config.configure({}, true)
|
|
25
|
+
} else {
|
|
26
|
+
config.configure(conf.lib_config, true)
|
|
27
|
+
}
|
|
28
|
+
enableOrDisableTracing(config, rc)
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
enable
|
|
34
|
+
}
|
|
@@ -2,25 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('fs')
|
|
4
4
|
const os = require('os')
|
|
5
|
-
const uuid = require('../../../vendor/dist/crypto-randomuuid') // we need to keep the old uuid dep because of cypress
|
|
6
5
|
const { URL } = require('url')
|
|
6
|
+
const path = require('path')
|
|
7
|
+
const uuid = require('../../../vendor/dist/crypto-randomuuid') // we need to keep the old uuid dep because of cypress
|
|
7
8
|
|
|
9
|
+
const set = require('../../datadog-core/src/utils/src/set')
|
|
10
|
+
const { DD_MAJOR } = require('../../../version')
|
|
8
11
|
const log = require('./log')
|
|
9
12
|
const tagger = require('./tagger')
|
|
10
|
-
const set = require('../../datadog-core/src/utils/src/set')
|
|
11
13
|
const { isTrue, isFalse, normalizeProfilingEnabledValue } = require('./util')
|
|
12
14
|
const { GIT_REPOSITORY_URL, GIT_COMMIT_SHA } = require('./plugins/util/tags')
|
|
13
15
|
const { getGitMetadataFromGitProperties, removeUserSensitiveInfo, getRemoteOriginURL, resolveGitHeadSHA } =
|
|
14
16
|
require('./git_properties')
|
|
15
17
|
const { updateConfig } = require('./telemetry')
|
|
16
18
|
const telemetryMetrics = require('./telemetry/metrics')
|
|
17
|
-
const {
|
|
19
|
+
const {
|
|
20
|
+
isInServerlessEnvironment,
|
|
21
|
+
getIsGCPFunction,
|
|
22
|
+
getIsAzureFunction,
|
|
23
|
+
enableGCPPubSubPushSubscription
|
|
24
|
+
} = require('./serverless')
|
|
18
25
|
const { ORIGIN_KEY } = require('./constants')
|
|
19
26
|
const { appendRules } = require('./payload-tagging/config')
|
|
20
27
|
const { getEnvironmentVariable: getEnv, getEnvironmentVariables } = require('./config-helper')
|
|
21
28
|
const defaults = require('./config_defaults')
|
|
22
|
-
const path = require('path')
|
|
23
|
-
const { DD_MAJOR } = require('../../../version')
|
|
24
29
|
|
|
25
30
|
const tracerMetrics = telemetryMetrics.manager.namespace('tracers')
|
|
26
31
|
|
|
@@ -182,7 +187,7 @@ function validateNamingVersion (versionString) {
|
|
|
182
187
|
* @param {string | string[]} input
|
|
183
188
|
*/
|
|
184
189
|
function splitJSONPathRules (input) {
|
|
185
|
-
if (!input) return
|
|
190
|
+
if (!input || input === '$') return
|
|
186
191
|
if (Array.isArray(input)) return input
|
|
187
192
|
if (input === 'all') return []
|
|
188
193
|
return input.split(',')
|
|
@@ -276,8 +281,6 @@ class Config {
|
|
|
276
281
|
this.stableConfig = new StableConfig()
|
|
277
282
|
}
|
|
278
283
|
|
|
279
|
-
const envs = getEnvironmentVariables()
|
|
280
|
-
|
|
281
284
|
options = {
|
|
282
285
|
...options,
|
|
283
286
|
appsec: options.appsec == null ? options.experimental?.appsec : options.appsec,
|
|
@@ -321,7 +324,7 @@ class Config {
|
|
|
321
324
|
this.#defaults = defaults
|
|
322
325
|
this.#applyDefaults()
|
|
323
326
|
this.#applyStableConfig(this.stableConfig?.localEntries ?? {}, this.#localStableConfig)
|
|
324
|
-
this.#applyEnvironment(
|
|
327
|
+
this.#applyEnvironment()
|
|
325
328
|
this.#applyStableConfig(this.stableConfig?.fleetEntries ?? {}, this.#fleetStableConfig)
|
|
326
329
|
this.#applyOptions(options)
|
|
327
330
|
this.#applyCalculated()
|
|
@@ -342,7 +345,7 @@ class Config {
|
|
|
342
345
|
}
|
|
343
346
|
|
|
344
347
|
if (this.gitMetadataEnabled) {
|
|
345
|
-
this.#loadGitMetadata(
|
|
348
|
+
this.#loadGitMetadata()
|
|
346
349
|
}
|
|
347
350
|
}
|
|
348
351
|
|
|
@@ -801,6 +804,7 @@ class Config {
|
|
|
801
804
|
this.#setBoolean(target, 'injectForce', DD_INJECT_FORCE)
|
|
802
805
|
this.#setBoolean(target, 'isAzureFunction', getIsAzureFunction())
|
|
803
806
|
this.#setBoolean(target, 'isGCPFunction', getIsGCPFunction())
|
|
807
|
+
this.#setBoolean(target, 'gcpPubSubPushSubscriptionEnabled', enableGCPPubSubPushSubscription())
|
|
804
808
|
target['langchain.spanCharLimit'] = maybeInt(DD_LANGCHAIN_SPAN_CHAR_LIMIT)
|
|
805
809
|
target['langchain.spanPromptCompletionSampleRate'] = maybeFloat(DD_LANGCHAIN_SPAN_PROMPT_COMPLETION_SAMPLE_RATE)
|
|
806
810
|
this.#setBoolean(target, 'legacyBaggageEnabled', DD_TRACE_LEGACY_BAGGAGE_ENABLED)
|
|
@@ -1152,9 +1156,8 @@ class Config {
|
|
|
1152
1156
|
// This is reliant on environment config being set before options.
|
|
1153
1157
|
// This is to make sure the origins of each value are tracked appropriately for telemetry.
|
|
1154
1158
|
// We'll only set `llmobs.enabled` on the opts when it's not set on the environment, and options.llmobs is provided.
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
this.#setBoolean(opts, 'llmobs.enabled', !!options.llmobs)
|
|
1159
|
+
if (this.#env['llmobs.enabled'] == null && options.llmobs) {
|
|
1160
|
+
this.#setBoolean(opts, 'llmobs.enabled', true)
|
|
1158
1161
|
}
|
|
1159
1162
|
}
|
|
1160
1163
|
|
|
@@ -1473,26 +1476,24 @@ class Config {
|
|
|
1473
1476
|
}
|
|
1474
1477
|
}
|
|
1475
1478
|
|
|
1476
|
-
#loadGitMetadata (
|
|
1479
|
+
#loadGitMetadata () {
|
|
1477
1480
|
// try to read Git metadata from the environment variables
|
|
1478
1481
|
this.repositoryUrl = removeUserSensitiveInfo(
|
|
1479
|
-
|
|
1480
|
-
this.tags[GIT_REPOSITORY_URL]
|
|
1482
|
+
getEnv('DD_GIT_REPOSITORY_URL') ?? this.tags[GIT_REPOSITORY_URL]
|
|
1481
1483
|
)
|
|
1482
|
-
this.commitSHA =
|
|
1483
|
-
this.tags[GIT_COMMIT_SHA]
|
|
1484
|
+
this.commitSHA = getEnv('DD_GIT_COMMIT_SHA') ?? this.tags[GIT_COMMIT_SHA]
|
|
1484
1485
|
|
|
1485
1486
|
// otherwise, try to read Git metadata from the git.properties file
|
|
1486
1487
|
if (!this.repositoryUrl || !this.commitSHA) {
|
|
1487
|
-
const DD_GIT_PROPERTIES_FILE =
|
|
1488
|
-
|
|
1488
|
+
const DD_GIT_PROPERTIES_FILE = getEnv('DD_GIT_PROPERTIES_FILE')
|
|
1489
|
+
const gitPropertiesFile = DD_GIT_PROPERTIES_FILE ?? `${process.cwd()}/git.properties`
|
|
1489
1490
|
let gitPropertiesString
|
|
1490
1491
|
try {
|
|
1491
|
-
gitPropertiesString = fs.readFileSync(
|
|
1492
|
+
gitPropertiesString = fs.readFileSync(gitPropertiesFile, 'utf8')
|
|
1492
1493
|
} catch (e) {
|
|
1493
1494
|
// Only log error if the user has set a git.properties path
|
|
1494
|
-
if (
|
|
1495
|
-
log.error('Error reading DD_GIT_PROPERTIES_FILE: %s',
|
|
1495
|
+
if (DD_GIT_PROPERTIES_FILE) {
|
|
1496
|
+
log.error('Error reading DD_GIT_PROPERTIES_FILE: %s', gitPropertiesFile, e)
|
|
1496
1497
|
}
|
|
1497
1498
|
}
|
|
1498
1499
|
if (gitPropertiesString) {
|
|
@@ -1503,11 +1504,11 @@ class Config {
|
|
|
1503
1504
|
}
|
|
1504
1505
|
// otherwise, try to read Git metadata from the .git/ folder
|
|
1505
1506
|
if (!this.repositoryUrl || !this.commitSHA) {
|
|
1506
|
-
const DD_GIT_FOLDER_PATH =
|
|
1507
|
-
|
|
1507
|
+
const DD_GIT_FOLDER_PATH = getEnv('DD_GIT_FOLDER_PATH')
|
|
1508
|
+
const gitFolderPath = DD_GIT_FOLDER_PATH ?? path.join(process.cwd(), '.git')
|
|
1508
1509
|
if (!this.repositoryUrl) {
|
|
1509
1510
|
// try to read git config (repository URL)
|
|
1510
|
-
const gitConfigPath = path.join(
|
|
1511
|
+
const gitConfigPath = path.join(gitFolderPath, 'config')
|
|
1511
1512
|
try {
|
|
1512
1513
|
const gitConfigContent = fs.readFileSync(gitConfigPath, 'utf8')
|
|
1513
1514
|
if (gitConfigContent) {
|
|
@@ -1515,14 +1516,14 @@ class Config {
|
|
|
1515
1516
|
}
|
|
1516
1517
|
} catch (e) {
|
|
1517
1518
|
// Only log error if the user has set a .git/ path
|
|
1518
|
-
if (
|
|
1519
|
+
if (DD_GIT_FOLDER_PATH) {
|
|
1519
1520
|
log.error('Error reading git config: %s', gitConfigPath, e)
|
|
1520
1521
|
}
|
|
1521
1522
|
}
|
|
1522
1523
|
}
|
|
1523
1524
|
if (!this.commitSHA) {
|
|
1524
1525
|
// try to read git HEAD (commit SHA)
|
|
1525
|
-
const gitHeadSha = resolveGitHeadSHA(
|
|
1526
|
+
const gitHeadSha = resolveGitHeadSHA(gitFolderPath)
|
|
1526
1527
|
if (gitHeadSha) {
|
|
1527
1528
|
this.commitSHA = gitHeadSha
|
|
1528
1529
|
}
|
|
@@ -114,6 +114,7 @@ module.exports = {
|
|
|
114
114
|
isFlakyTestRetriesEnabled: false,
|
|
115
115
|
flakyTestRetriesCount: 5,
|
|
116
116
|
isGCPFunction: false,
|
|
117
|
+
isGCPPubSubPushSubscriptionEnabled: true,
|
|
117
118
|
isGitUploadEnabled: false,
|
|
118
119
|
isIntelligentTestRunnerEnabled: false,
|
|
119
120
|
isManualApiEnabled: false,
|
|
@@ -205,7 +206,7 @@ module.exports = {
|
|
|
205
206
|
'tracePropagationStyle.inject': ['datadog', 'tracecontext', 'baggage'],
|
|
206
207
|
'tracePropagationStyle.extract': ['datadog', 'tracecontext', 'baggage'],
|
|
207
208
|
'tracePropagationStyle.otelPropagators': false,
|
|
208
|
-
traceWebsocketMessagesEnabled:
|
|
209
|
+
traceWebsocketMessagesEnabled: true,
|
|
209
210
|
traceWebsocketMessagesInheritSampling: true,
|
|
210
211
|
traceWebsocketMessagesSeparateTraces: true,
|
|
211
212
|
tracing: true,
|
|
@@ -50,8 +50,13 @@ module.exports = {
|
|
|
50
50
|
GRPC_SERVER_ERROR_STATUSES: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
|
|
51
51
|
DYNAMODB_PTR_KIND: 'aws.dynamodb.item',
|
|
52
52
|
S3_PTR_KIND: 'aws.s3.object',
|
|
53
|
+
WEBSOCKET_PTR_KIND: 'websocket',
|
|
53
54
|
SPAN_POINTER_DIRECTION: Object.freeze({
|
|
54
55
|
UPSTREAM: 'u',
|
|
55
56
|
DOWNSTREAM: 'd'
|
|
57
|
+
}),
|
|
58
|
+
SPAN_POINTER_DIRECTION_NAME: Object.freeze({
|
|
59
|
+
UPSTREAM: 'span-pointer-up',
|
|
60
|
+
DOWNSTREAM: 'span-pointer-down'
|
|
56
61
|
})
|
|
57
62
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { URL } = require('url')
|
|
4
|
+
|
|
3
5
|
// Load binding first to not import other modules if it throws
|
|
4
6
|
const libdatadog = require('@datadog/libdatadog')
|
|
5
7
|
const binding = libdatadog.load('crashtracker')
|
|
6
8
|
|
|
7
9
|
const log = require('../log')
|
|
8
10
|
const defaults = require('../config_defaults')
|
|
9
|
-
const { URL } = require('url')
|
|
10
11
|
const pkg = require('../../../../package.json')
|
|
12
|
+
const processTags = require('../process-tags')
|
|
11
13
|
|
|
12
14
|
class Crashtracker {
|
|
13
15
|
#started = false
|
|
@@ -77,6 +79,13 @@ class Crashtracker {
|
|
|
77
79
|
#getMetadata (config) {
|
|
78
80
|
const tags = Object.keys(config.tags).map(key => `${key}:${config.tags[key]}`)
|
|
79
81
|
|
|
82
|
+
// Add process tags to the tags array
|
|
83
|
+
for (const [key, value] of processTags.tags) {
|
|
84
|
+
if (value !== undefined) {
|
|
85
|
+
tags.push(`${key}:${value}`)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
80
89
|
return {
|
|
81
90
|
library_name: pkg.name,
|
|
82
91
|
library_version: pkg.version,
|
|
@@ -13,7 +13,7 @@ class DataStreamsCheckpointer {
|
|
|
13
13
|
* @param {string} type - The type of the checkpoint, usually the streaming technology being used.
|
|
14
14
|
* Examples include kafka, kinesis, sns etc.
|
|
15
15
|
* @param {string} target - The target of data. This can be a topic, exchange or stream name.
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {object} carrier - The carrier object to inject context into.
|
|
17
17
|
*/
|
|
18
18
|
setProduceCheckpoint (type, target, carrier) {
|
|
19
19
|
if (!this.config.dsmEnabled) return
|
|
@@ -33,7 +33,7 @@ class DataStreamsCheckpointer {
|
|
|
33
33
|
* @param {string} type - The type of the checkpoint, usually the streaming technology being used.
|
|
34
34
|
* Examples include kafka, kinesis, sns etc.
|
|
35
35
|
* @param {string} source - The source of data. This can be a topic, exchange or stream name.
|
|
36
|
-
* @param {
|
|
36
|
+
* @param {object} carrier - The carrier object to extract context from.
|
|
37
37
|
* @param {boolean} [manualCheckpoint=true] - Whether this checkpoint was manually set. Keep true if manually
|
|
38
38
|
* instrumenting. Manual instrumentation always overrides automatic
|
|
39
39
|
* instrumentation in the case a call is both manually and automatically
|
|
@@ -13,7 +13,7 @@ const {
|
|
|
13
13
|
//
|
|
14
14
|
// TODO: Remove this when DSM has been moved to dedicated plugins.
|
|
15
15
|
/**
|
|
16
|
-
* @template T extends new (...args:
|
|
16
|
+
* @template T extends new (...args: unknown[]) => unknown
|
|
17
17
|
* @param {() => T} classGetter
|
|
18
18
|
* @param {string[]} methods
|
|
19
19
|
* @param {string[]} staticMethods
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
// other languages use FNV1
|
|
5
5
|
// this inconsistency is ok because hashes do not need to be consistent across services
|
|
6
6
|
const crypto = require('crypto')
|
|
7
|
-
const { encodeVarint, decodeVarint } = require('./encoding')
|
|
8
7
|
const { LRUCache } = require('../../../../vendor/dist/lru-cache')
|
|
9
8
|
const log = require('../log')
|
|
10
9
|
const pick = require('../../../datadog-core/src/utils/src/pick')
|
|
10
|
+
const { encodeVarint, decodeVarint } = require('./encoding')
|
|
11
11
|
|
|
12
12
|
const cache = new LRUCache({ max: 500 })
|
|
13
13
|
|
|
@@ -44,7 +44,7 @@ function computeHash (service, env, edgeTags, parentHash) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* @param {
|
|
47
|
+
* @param {object} dataStreamsContext
|
|
48
48
|
* @param {Buffer} dataStreamsContext.hash
|
|
49
49
|
* @param {number} dataStreamsContext.pathwayStartNs
|
|
50
50
|
* @param {number} dataStreamsContext.edgeStartNs
|
|
@@ -59,7 +59,7 @@ function encodePathwayContext (dataStreamsContext) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
* @param {
|
|
62
|
+
* @param {object} dataStreamsContext
|
|
63
63
|
* @param {Buffer} dataStreamsContext.hash
|
|
64
64
|
* @param {number} dataStreamsContext.pathwayStartNs
|
|
65
65
|
* @param {number} dataStreamsContext.edgeStartNs
|
|
@@ -72,7 +72,7 @@ function encodePathwayContextBase64 (dataStreamsContext) {
|
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* @param {Buffer} pathwayContext
|
|
75
|
-
* @returns {
|
|
75
|
+
* @returns {object}
|
|
76
76
|
*/
|
|
77
77
|
function decodePathwayContext (pathwayContext) {
|
|
78
78
|
if (pathwayContext == null || pathwayContext.length < 8) {
|
|
@@ -111,11 +111,11 @@ const DsmPathwayCodec = {
|
|
|
111
111
|
// we use a class for encoding / decoding in case we update our encoding/decoding. A class will make updates easier
|
|
112
112
|
// instead of using individual functions.
|
|
113
113
|
/**
|
|
114
|
-
* @param {
|
|
114
|
+
* @param {object} dataStreamsContext
|
|
115
115
|
* @param {Buffer} dataStreamsContext.hash
|
|
116
116
|
* @param {number} dataStreamsContext.pathwayStartNs
|
|
117
117
|
* @param {number} dataStreamsContext.edgeStartNs
|
|
118
|
-
* @param {
|
|
118
|
+
* @param {object} carrier
|
|
119
119
|
*/
|
|
120
120
|
encode (dataStreamsContext, carrier) {
|
|
121
121
|
if (!dataStreamsContext || !dataStreamsContext.hash) {
|
|
@@ -127,7 +127,7 @@ const DsmPathwayCodec = {
|
|
|
127
127
|
},
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
-
* @param {
|
|
130
|
+
* @param {object} carrier
|
|
131
131
|
* @returns {ReturnType<typeof decodePathwayContext>|undefined}
|
|
132
132
|
*/
|
|
133
133
|
decode (carrier) {
|
|
@@ -4,14 +4,14 @@ const os = require('os')
|
|
|
4
4
|
const pkg = require('../../../../package.json')
|
|
5
5
|
|
|
6
6
|
const { LogCollapsingLowestDenseDDSketch } = require('../../../../vendor/dist/@datadog/sketches-js')
|
|
7
|
+
const { PATHWAY_HASH } = require('../../../../ext/tags')
|
|
8
|
+
const log = require('../log')
|
|
7
9
|
const { DsmPathwayCodec } = require('./pathway')
|
|
8
10
|
const { DataStreamsWriter } = require('./writer')
|
|
9
11
|
const { computePathwayHash } = require('./pathway')
|
|
10
12
|
const { getAmqpMessageSize, getHeadersSize, getMessageSize, getSizeOrZero } = require('./size')
|
|
11
|
-
const { PATHWAY_HASH } = require('../../../../ext/tags')
|
|
12
13
|
const { SchemaBuilder } = require('./schemas/schema_builder')
|
|
13
14
|
const { SchemaSampler } = require('./schemas/schema_sampler')
|
|
14
|
-
const log = require('../log')
|
|
15
15
|
|
|
16
16
|
const ENTRY_PARENT_HASH = Buffer.from('0000000000000000', 'hex')
|
|
17
17
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { URL, format } = require('url')
|
|
4
|
+
const zlib = require('zlib')
|
|
3
5
|
const pkg = require('../../../../package.json')
|
|
4
6
|
const log = require('../log')
|
|
5
7
|
const request = require('../exporters/common/request')
|
|
6
|
-
const { URL, format } = require('url')
|
|
7
8
|
const { MsgpackEncoder } = require('../msgpack')
|
|
8
9
|
const defaults = require('../config_defaults')
|
|
9
|
-
const zlib = require('zlib')
|
|
10
10
|
|
|
11
11
|
const msgpack = new MsgpackEncoder()
|
|
12
12
|
|
|
@@ -8,6 +8,7 @@ module.exports = function getDebuggerConfig (config) {
|
|
|
8
8
|
hostname: config.hostname,
|
|
9
9
|
logLevel: config.logLevel,
|
|
10
10
|
port: config.port,
|
|
11
|
+
propagateProcessTags: config.propagateProcessTags,
|
|
11
12
|
repositoryUrl: config.repositoryUrl,
|
|
12
13
|
runtimeId: config.tags['runtime-id'],
|
|
13
14
|
service: config.service,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const { workerData: { config: parentConfig, parentThreadId, configPort } } = require('node:worker_threads')
|
|
4
4
|
const { format } = require('node:url')
|
|
5
|
-
const log = require('./log')
|
|
6
5
|
const defaults = require('../../config_defaults')
|
|
6
|
+
const log = require('./log')
|
|
7
7
|
|
|
8
8
|
const config = module.exports = {
|
|
9
9
|
...parentConfig,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const { randomUUID } = require('crypto')
|
|
4
|
+
const { version } = require('../../../../../package.json')
|
|
5
|
+
const { NODE_MAJOR } = require('../../../../../version')
|
|
6
|
+
const processTags = require('../../process-tags')
|
|
4
7
|
const { breakpointToProbes } = require('./state')
|
|
5
8
|
const session = require('./session')
|
|
6
9
|
const { getLocalStateForCallFrame } = require('./snapshot')
|
|
@@ -10,8 +13,6 @@ const { ackEmitting } = require('./status')
|
|
|
10
13
|
const config = require('./config')
|
|
11
14
|
const { MAX_SNAPSHOTS_PER_SECOND_GLOBALLY } = require('./defaults')
|
|
12
15
|
const log = require('./log')
|
|
13
|
-
const { version } = require('../../../../../package.json')
|
|
14
|
-
const { NODE_MAJOR } = require('../../../../../version')
|
|
15
16
|
|
|
16
17
|
require('./remote_config')
|
|
17
18
|
|
|
@@ -215,6 +216,10 @@ session.on('Debugger.paused', async ({ params }) => {
|
|
|
215
216
|
language: 'javascript'
|
|
216
217
|
}
|
|
217
218
|
|
|
219
|
+
if (config.propagateProcessTags.enabled) {
|
|
220
|
+
snapshot[processTags.DYNAMIC_INSTRUMENTATION_FIELD_NAME] = processTags.tagsObject
|
|
221
|
+
}
|
|
222
|
+
|
|
218
223
|
if (probe.captureSnapshot) {
|
|
219
224
|
if (captureErrors?.length > 0) {
|
|
220
225
|
// There was an error collecting the snapshot for this probe, let's not try again
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
const { hostname: getHostname } = require('os')
|
|
4
4
|
const { stringify } = require('querystring')
|
|
5
5
|
|
|
6
|
-
const config = require('./config')
|
|
7
|
-
const JSONBuffer = require('./json-buffer')
|
|
8
6
|
const request = require('../../exporters/common/request')
|
|
9
7
|
const { GIT_COMMIT_SHA, GIT_REPOSITORY_URL } = require('../../plugins/util/tags')
|
|
10
|
-
const log = require('./log')
|
|
11
8
|
const { version } = require('../../../../../package.json')
|
|
12
9
|
const { getEnvironmentVariable } = require('../../config-helper')
|
|
10
|
+
const log = require('./log')
|
|
11
|
+
const JSONBuffer = require('./json-buffer')
|
|
12
|
+
const config = require('./config')
|
|
13
13
|
const { pruneSnapshot } = require('./snapshot-pruner')
|
|
14
14
|
|
|
15
15
|
module.exports = send
|
|
@@ -7,7 +7,7 @@ const inspector = require('./inspector_promises_polyfill')
|
|
|
7
7
|
* connect: () => void,
|
|
8
8
|
* connectToMainThread: () => void
|
|
9
9
|
* disconnect: () => void,
|
|
10
|
-
* post: (method: string, params?: object) => Promise<
|
|
10
|
+
* post: (method: string, params?: object) => Promise<unknown>,
|
|
11
11
|
* }} CDPSession
|
|
12
12
|
*/
|
|
13
13
|
const session = /** @type {CDPSession} */ (new inspector.Session())
|