dd-trace 6.16.0 → 6.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ci/diagnose.js +0 -23
- package/ci/test-optimization-validation/approval-artifacts.js +0 -3
- package/ci/test-optimization-validation/approval.js +0 -6
- package/ci/test-optimization-validation/artifact-id.js +0 -1
- package/ci/test-optimization-validation/bounded-json.js +0 -1
- package/ci/test-optimization-validation/cli.js +0 -12
- package/ci/test-optimization-validation/command-output-policy.js +0 -1
- package/ci/test-optimization-validation/command-runner.js +0 -3
- package/ci/test-optimization-validation/environment.js +0 -4
- package/ci/test-optimization-validation/executable-approval.js +0 -1
- package/ci/test-optimization-validation/executable.js +0 -5
- package/ci/test-optimization-validation/framework-adapters/cucumber.js +0 -6
- package/ci/test-optimization-validation/framework-adapters/cypress.js +0 -3
- package/ci/test-optimization-validation/framework-adapters/playwright.js +0 -6
- package/ci/test-optimization-validation/framework-adapters/vitest.js +0 -4
- package/ci/test-optimization-validation/generated-test-contract.js +0 -5
- package/ci/test-optimization-validation/generated-verifier.js +0 -1
- package/ci/test-optimization-validation/literal-environment.js +0 -1
- package/ci/test-optimization-validation/manifest-scaffold.js +0 -17
- package/ci/test-optimization-validation/manifest-schema.js +0 -21
- package/ci/test-optimization-validation/offline-fixtures.js +0 -4
- package/ci/test-optimization-validation/plan-writer.js +0 -11
- package/ci/test-optimization-validation/preflight-runner.js +0 -1
- package/ci/test-optimization-validation/redaction.js +0 -4
- package/ci/test-optimization-validation/report-writer.js +0 -16
- package/ci/test-optimization-validation/runner-command.js +0 -3
- package/ci/test-optimization-validation/runner-contract.js +0 -4
- package/ci/test-optimization-validation/safe-files.js +0 -1
- package/ci/test-optimization-validation/scenarios/basic-reporting.js +0 -1
- package/ci/test-optimization-validation/scenarios/ci-wiring.js +0 -1
- package/ci/test-optimization-validation/source-text.js +0 -3
- package/ci/vitest-no-worker-init-setup.mjs +41 -16
- package/index.d.ts +165 -0
- package/package.json +17 -16
- package/packages/datadog-esbuild/src/utils.js +0 -2
- package/packages/datadog-instrumentations/src/aerospike.js +28 -6
- package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js.js +0 -2
- package/packages/datadog-instrumentations/src/aws-sdk.js +0 -2
- package/packages/datadog-instrumentations/src/claude-agent-sdk.js +0 -2
- package/packages/datadog-instrumentations/src/console.js +97 -0
- package/packages/datadog-instrumentations/src/cucumber.js +72 -12
- package/packages/datadog-instrumentations/src/cypress-config.js +0 -23
- package/packages/datadog-instrumentations/src/helpers/channel.js +0 -2
- package/packages/datadog-instrumentations/src/helpers/graphql-jit-runtime.js +0 -5
- package/packages/datadog-instrumentations/src/helpers/hooks.js +8 -0
- package/packages/datadog-instrumentations/src/helpers/instrumentation-utils.js +0 -3
- package/packages/datadog-instrumentations/src/helpers/pool-acquire.js +0 -6
- package/packages/datadog-instrumentations/src/helpers/register.js +4 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +72 -24
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentation-registry.js +39 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +3 -17
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/playwright.js +12 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/postgres.js +36 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/supabase.js +128 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +16 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms/postgres.js +388 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +0 -5
- package/packages/datadog-instrumentations/src/helpers/router-helper.js +0 -1
- package/packages/datadog-instrumentations/src/jest.js +141 -51
- package/packages/datadog-instrumentations/src/knex.js +0 -1
- package/packages/datadog-instrumentations/src/mariadb-bundle.js +0 -24
- package/packages/datadog-instrumentations/src/mariadb.js +0 -2
- package/packages/datadog-instrumentations/src/mocha/common.js +0 -1
- package/packages/datadog-instrumentations/src/mocha/main.js +22 -25
- package/packages/datadog-instrumentations/src/mocha/utils.js +119 -49
- package/packages/datadog-instrumentations/src/mocha/webdriverio-protocol.js +0 -6
- package/packages/datadog-instrumentations/src/mocha/worker.js +14 -17
- package/packages/datadog-instrumentations/src/mysql2.js +0 -2
- package/packages/datadog-instrumentations/src/openai-realtime/audio-accumulator.js +241 -0
- package/packages/datadog-instrumentations/src/openai-realtime/events.js +76 -0
- package/packages/datadog-instrumentations/src/openai-realtime/index.js +301 -0
- package/packages/datadog-instrumentations/src/openai-realtime/session.js +998 -0
- package/packages/datadog-instrumentations/src/openai-realtime/turns.js +211 -0
- package/packages/datadog-instrumentations/src/openai.js +51 -12
- package/packages/datadog-instrumentations/src/oracledb.js +9 -3
- package/packages/datadog-instrumentations/src/playwright-reporter.js +3 -16
- package/packages/datadog-instrumentations/src/playwright.js +238 -55
- package/packages/datadog-instrumentations/src/postgres.js +7 -0
- package/packages/datadog-instrumentations/src/router.js +0 -2
- package/packages/datadog-instrumentations/src/rum-browser-scripts.js +0 -2
- package/packages/datadog-instrumentations/src/sequelize.js +0 -1
- package/packages/datadog-instrumentations/src/supabase.js +15 -0
- package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +18 -18
- package/packages/datadog-instrumentations/src/vitest-main.js +37 -17
- package/packages/datadog-instrumentations/src/vitest-util.js +7 -1
- package/packages/datadog-instrumentations/src/vitest-worker.js +49 -13
- package/packages/datadog-instrumentations/src/webdriverio.js +23 -42
- package/packages/datadog-instrumentations/src/ws.js +0 -1
- package/packages/datadog-plugin-ai/src/utils.js +0 -2
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/trace-checkpoint.js +0 -1
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/util.js +0 -2
- package/packages/datadog-plugin-aws-sdk/src/base.js +0 -1
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +0 -1
- package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +0 -1
- package/packages/datadog-plugin-aws-sdk/src/util.js +0 -1
- package/packages/datadog-plugin-azure-durable-functions/src/index.js +0 -1
- package/packages/datadog-plugin-cucumber/src/index.js +10 -0
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +171 -75
- package/packages/datadog-plugin-cypress/src/finalization.js +0 -3
- package/packages/datadog-plugin-cypress/src/source-map-utils.js +0 -4
- package/packages/datadog-plugin-cypress/src/support.js +52 -7
- package/packages/datadog-plugin-graphql/src/resolve-error.js +1 -2
- package/packages/datadog-plugin-graphql/src/utils.js +0 -5
- package/packages/datadog-plugin-jest/src/index.js +13 -0
- package/packages/datadog-plugin-kafkajs/src/producer.js +0 -1
- package/packages/datadog-plugin-mocha/src/index.js +39 -11
- package/packages/datadog-plugin-mongodb-core/src/query.js +0 -1
- package/packages/datadog-plugin-openai/src/index.js +16 -1
- package/packages/datadog-plugin-openai/src/realtime.js +144 -0
- package/packages/datadog-plugin-openai-agents/src/integration.js +0 -4
- package/packages/datadog-plugin-openai-agents/src/util.js +0 -1
- package/packages/datadog-plugin-playwright/src/index.js +76 -9
- package/packages/datadog-plugin-postgres/src/index.js +167 -0
- package/packages/datadog-plugin-prisma/src/datadog-tracing-helper.js +0 -1
- package/packages/datadog-plugin-redis/src/index.js +15 -1
- package/packages/datadog-plugin-supabase/src/error.js +18 -0
- package/packages/datadog-plugin-supabase/src/index.js +21 -0
- package/packages/datadog-plugin-supabase/src/supabase-auth-js-gotrueclient-getuser.js +69 -0
- package/packages/datadog-plugin-supabase/src/supabase-functions-js-functionsclient-invoke.js +70 -0
- package/packages/datadog-plugin-supabase/src/supabase-postgrest-js-postgrestbuilder-then.js +122 -0
- package/packages/datadog-plugin-supabase/src/supabase-realtime-js-realtimechannel-send.js +66 -0
- package/packages/datadog-plugin-supabase/src/supabase-storage-js-handle-request.js +93 -0
- package/packages/datadog-plugin-supabase/src/url.js +17 -0
- package/packages/datadog-plugin-vitest/src/index.js +10 -0
- package/packages/datadog-plugin-ws/src/util.js +0 -4
- package/packages/datadog-turbopack/index.js +0 -6
- package/packages/datadog-turbopack/src/loader.js +0 -16
- package/packages/datadog-webpack/src/loader.js +0 -1
- package/packages/dd-trace/src/aiguard/client.js +2 -3
- package/packages/dd-trace/src/aiguard/evaluation.js +6 -12
- package/packages/dd-trace/src/aiguard/index.js +2 -2
- package/packages/dd-trace/src/aiguard/integrations/index.js +1 -1
- package/packages/dd-trace/src/aiguard/integrations/openai.js +81 -7
- package/packages/dd-trace/src/aiguard/messages/anthropic.js +0 -2
- package/packages/dd-trace/src/aiguard/messages/openai.js +64 -1
- package/packages/dd-trace/src/aiguard/messages/utils.js +0 -1
- package/packages/dd-trace/src/aiguard/redaction.js +0 -1
- package/packages/dd-trace/src/aiguard/sdk.js +1 -1
- package/packages/dd-trace/src/appsec/activation.js +1 -1
- package/packages/dd-trace/src/appsec/api_security/normalized-route.js +0 -5
- package/packages/dd-trace/src/appsec/api_security/sampler.js +0 -4
- package/packages/dd-trace/src/appsec/blocking/index.js +3 -3
- package/packages/dd-trace/src/appsec/downstream_requests.js +1 -4
- package/packages/dd-trace/src/appsec/iast/index.js +1 -1
- package/packages/dd-trace/src/appsec/iast/overhead-controller.js +5 -5
- package/packages/dd-trace/src/appsec/iast/taint-tracking/index.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +3 -3
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/sql-sensitive-analyzer.js +8 -10
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +2 -2
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +4 -1
- package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +7 -7
- package/packages/dd-trace/src/appsec/index.js +2 -2
- package/packages/dd-trace/src/appsec/lambda.js +71 -2
- package/packages/dd-trace/src/appsec/rasp/utils.js +5 -1
- package/packages/dd-trace/src/appsec/remote_config.js +8 -6
- package/packages/dd-trace/src/appsec/reporter.js +10 -6
- package/packages/dd-trace/src/appsec/rule_manager.js +3 -3
- package/packages/dd-trace/src/appsec/sdk/track_event.js +0 -2
- package/packages/dd-trace/src/appsec/waf/index.js +2 -2
- package/packages/dd-trace/src/appsec/waf/waf_manager.js +8 -5
- package/packages/dd-trace/src/carrier.js +0 -5
- package/packages/dd-trace/src/ci-visibility/dynamic-atr-retries.js +104 -0
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +0 -2
- package/packages/dd-trace/src/ci-visibility/efd-retry-policy.js +34 -3
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/index.js +0 -4
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/msgpack-to-json.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/sink.js +0 -2
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +37 -15
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +0 -3
- package/packages/dd-trace/src/ci-visibility/exporters/request.js +0 -11
- package/packages/dd-trace/src/ci-visibility/exporters/settings-cache-key.js +0 -1
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +0 -1
- package/packages/dd-trace/src/ci-visibility/requests/fs-cache.js +0 -6
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +2 -2
- package/packages/dd-trace/src/ci-visibility/requests/rate-limit.js +0 -1
- package/packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js +0 -5
- package/packages/dd-trace/src/ci-visibility/requests/video-request.js +0 -1
- package/packages/dd-trace/src/ci-visibility/telemetry.js +13 -0
- package/packages/dd-trace/src/ci-visibility/test-optimization-cache.js +0 -1
- package/packages/dd-trace/src/ci-visibility/test-screenshot.js +0 -2
- package/packages/dd-trace/src/ci-visibility/test-video.js +0 -1
- package/packages/dd-trace/src/config/defaults.js +3 -2
- package/packages/dd-trace/src/config/generated-config-types.d.ts +73 -67
- package/packages/dd-trace/src/config/helper.js +0 -1
- package/packages/dd-trace/src/config/index.js +24 -24
- package/packages/dd-trace/src/config/parsers.js +34 -6
- package/packages/dd-trace/src/config/remote_config.js +25 -109
- package/packages/dd-trace/src/config/supported-configurations.json +139 -10
- package/packages/dd-trace/src/datastreams/encoding.js +0 -1
- package/packages/dd-trace/src/datastreams/pathway.js +0 -1
- package/packages/dd-trace/src/debugger/constants.js +10 -0
- package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +62 -10
- package/packages/dd-trace/src/debugger/devtools_client/config.js +2 -0
- package/packages/dd-trace/src/debugger/devtools_client/guardrail-metrics.js +15 -0
- package/packages/dd-trace/src/debugger/devtools_client/index.js +103 -27
- package/packages/dd-trace/src/debugger/devtools_client/json-buffer.js +50 -7
- package/packages/dd-trace/src/debugger/devtools_client/log.js +3 -1
- package/packages/dd-trace/src/debugger/devtools_client/probe_sampler.js +21 -8
- package/packages/dd-trace/src/debugger/devtools_client/send.js +40 -14
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +53 -13
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +118 -71
- package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +0 -3
- package/packages/dd-trace/src/debugger/devtools_client/status.js +20 -6
- package/packages/dd-trace/src/debugger/guardrail-metrics.js +167 -0
- package/packages/dd-trace/src/debugger/index.js +50 -2
- package/packages/dd-trace/src/debugger/inspect-segment.js +0 -3
- package/packages/dd-trace/src/debugger/probe_sampler.js +133 -9
- package/packages/dd-trace/src/debugger/probe_sampler_constants.js +31 -1
- package/packages/dd-trace/src/dogstatsd.js +0 -23
- package/packages/dd-trace/src/encode/0.4-cross-payload.js +0 -3
- package/packages/dd-trace/src/encode/0.4.js +0 -7
- package/packages/dd-trace/src/encode/0.5.js +0 -2
- package/packages/dd-trace/src/encode/tags-processors.js +0 -1
- package/packages/dd-trace/src/evp_proxy/discovery.js +0 -1
- package/packages/dd-trace/src/evp_proxy/path.js +0 -2
- package/packages/dd-trace/src/exporters/agent/writer.js +0 -1
- package/packages/dd-trace/src/exporters/agentless/index.js +0 -1
- package/packages/dd-trace/src/exporters/agentless/intake.js +0 -1
- package/packages/dd-trace/src/exporters/agentless/writer.js +0 -3
- package/packages/dd-trace/src/exporters/common/final-flush-request-tracker.js +0 -6
- package/packages/dd-trace/src/exporters/common/request.js +1 -0
- package/packages/dd-trace/src/exporters/common/url.js +0 -2
- package/packages/dd-trace/src/exporters/common/writer.js +0 -2
- package/packages/dd-trace/src/id.js +0 -11
- package/packages/dd-trace/src/llmobs/audio-codec.js +192 -0
- package/packages/dd-trace/src/llmobs/audio-utils.js +121 -0
- package/packages/dd-trace/src/llmobs/constants/audio.js +35 -0
- package/packages/dd-trace/src/llmobs/constants/prompts.js +14 -0
- package/packages/dd-trace/src/llmobs/constants/tags.js +17 -0
- package/packages/dd-trace/src/llmobs/eval-metric.js +0 -6
- package/packages/dd-trace/src/llmobs/experiments/dataset.js +0 -4
- package/packages/dd-trace/src/llmobs/experiments/experiment.js +0 -3
- package/packages/dd-trace/src/llmobs/experiments/index.js +7 -6
- package/packages/dd-trace/src/llmobs/experiments/util.js +1 -11
- package/packages/dd-trace/src/llmobs/index.js +1 -3
- package/packages/dd-trace/src/llmobs/noop.js +10 -0
- package/packages/dd-trace/src/llmobs/plugins/ai/util.js +0 -4
- package/packages/dd-trace/src/llmobs/plugins/anthropic/util.js +0 -1
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +0 -4
- package/packages/dd-trace/src/llmobs/plugins/modelcontextprotocol-sdk/utils.js +0 -2
- package/packages/dd-trace/src/llmobs/plugins/openai/constants.js +0 -2
- package/packages/dd-trace/src/llmobs/plugins/openai/index.js +4 -6
- package/packages/dd-trace/src/llmobs/plugins/openai/realtime.js +285 -0
- package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +16 -3
- package/packages/dd-trace/src/llmobs/prompts/cache.js +272 -0
- package/packages/dd-trace/src/llmobs/prompts/manager.js +639 -0
- package/packages/dd-trace/src/llmobs/prompts/noop.js +29 -0
- package/packages/dd-trace/src/llmobs/prompts/prompt.js +92 -0
- package/packages/dd-trace/src/llmobs/sdk.js +21 -6
- package/packages/dd-trace/src/llmobs/span_processor.js +81 -2
- package/packages/dd-trace/src/llmobs/tagger.js +30 -7
- package/packages/dd-trace/src/llmobs/telemetry.js +36 -4
- package/packages/dd-trace/src/llmobs/util.js +0 -34
- package/packages/dd-trace/src/llmobs/writers/base.js +0 -1
- package/packages/dd-trace/src/llmobs/writers/util.js +1 -2
- package/packages/dd-trace/src/log/channels.js +3 -0
- package/packages/dd-trace/src/log/index.js +23 -5
- package/packages/dd-trace/src/log-submission/log-submission-plugin.js +74 -6
- package/packages/dd-trace/src/msgpack/chunk.js +0 -1
- package/packages/dd-trace/src/openfeature/agentless_configuration_source.js +0 -12
- package/packages/dd-trace/src/openfeature/encoding.js +0 -2
- package/packages/dd-trace/src/openfeature/eval-metrics-hook.js +0 -1
- package/packages/dd-trace/src/openfeature/index.js +0 -4
- package/packages/dd-trace/src/openfeature/span-enrichment-hook.js +0 -1
- package/packages/dd-trace/src/openfeature/span-enrichment.js +0 -4
- package/packages/dd-trace/src/openfeature/writers/base.js +0 -6
- package/packages/dd-trace/src/openfeature/writers/exposures.js +0 -5
- package/packages/dd-trace/src/openfeature/writers/util.js +0 -4
- package/packages/dd-trace/src/opentelemetry/logs/logger.js +0 -1
- package/packages/dd-trace/src/opentelemetry/logs/logger_provider.js +0 -1
- package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +0 -1
- package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +0 -2
- package/packages/dd-trace/src/opentelemetry/metrics/meter_provider.js +0 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_transformer.js +0 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +0 -1
- package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +1 -14
- package/packages/dd-trace/src/opentelemetry/metrics/time.js +0 -1
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +30 -13
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +0 -1
- package/packages/dd-trace/src/opentelemetry/span-helpers.js +0 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +0 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +0 -3
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +0 -6
- package/packages/dd-trace/src/opentracing/span_context.js +0 -1
- package/packages/dd-trace/src/otel-thread-ctx.js +38 -11
- package/packages/dd-trace/src/payload-tagging/tagging.js +15 -3
- package/packages/dd-trace/src/plugins/ci_plugin.js +0 -1
- package/packages/dd-trace/src/plugins/database.js +2 -6
- package/packages/dd-trace/src/plugins/index.js +7 -0
- package/packages/dd-trace/src/plugins/plugin.js +0 -4
- package/packages/dd-trace/src/plugins/tracing.js +1 -1
- package/packages/dd-trace/src/plugins/util/git.js +1 -3
- package/packages/dd-trace/src/plugins/util/http-otel-semantics.js +0 -1
- package/packages/dd-trace/src/plugins/util/llm.js +0 -2
- package/packages/dd-trace/src/plugins/util/status-validator.js +0 -1
- package/packages/dd-trace/src/plugins/util/test.js +21 -20
- package/packages/dd-trace/src/plugins/util/url.js +0 -5
- package/packages/dd-trace/src/priority_sampler.js +0 -6
- package/packages/dd-trace/src/process-tags/index.js +0 -1
- package/packages/dd-trace/src/profiler.js +132 -35
- package/packages/dd-trace/src/profiling/exporters/event_serializer.js +0 -1
- package/packages/dd-trace/src/profiling/profiler.js +101 -41
- package/packages/dd-trace/src/profiling/ssi-heuristics.js +29 -15
- package/packages/dd-trace/src/propagation-hash/index.js +0 -1
- package/packages/dd-trace/src/proxy.js +21 -45
- package/packages/dd-trace/src/random_sampler.js +0 -4
- package/packages/dd-trace/src/rate_limiter.js +0 -4
- package/packages/dd-trace/src/remote_config/capabilities.js +1 -9
- package/packages/dd-trace/src/remote_config/index.js +0 -1
- package/packages/dd-trace/src/runtime_metrics/otlp_runtime_metrics.js +0 -3
- package/packages/dd-trace/src/sampler.js +0 -4
- package/packages/dd-trace/src/sampling_rule.js +0 -7
- package/packages/dd-trace/src/serverless/vercel.js +0 -1
- package/packages/dd-trace/src/serverless.js +0 -1
- package/packages/dd-trace/src/service-naming/index.js +0 -1
- package/packages/dd-trace/src/service-naming/schemas/util.js +0 -1
- package/packages/dd-trace/src/service-naming/schemas/v0/storage.js +7 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/storage.js +5 -0
- package/packages/dd-trace/src/span_processor.js +2 -2
- package/packages/dd-trace/src/span_sampler.js +0 -1
- package/packages/dd-trace/src/standalone/product.js +2 -2
- package/packages/dd-trace/src/standalone/tracesource.js +0 -1
- package/packages/dd-trace/src/startup-log.js +1 -1
- package/packages/dd-trace/src/telemetry/endpoints.js +0 -8
- package/packages/dd-trace/src/telemetry/logs/index.js +16 -5
- package/packages/dd-trace/src/telemetry/logs/log-collector.js +16 -6
- package/packages/dd-trace/src/telemetry/metrics.js +0 -2
- package/packages/dd-trace/src/telemetry/telemetry.js +4 -1
- package/packages/dd-trace/src/util.js +13 -1
- package/vendor/dist/@datadog/openfeature-node-server/index.js +1 -1
|
@@ -42,15 +42,9 @@ class OtlpHttpExporterBase {
|
|
|
42
42
|
|
|
43
43
|
const isJson = protocol === 'http/json'
|
|
44
44
|
|
|
45
|
-
const parsedUrl = new URL(url)
|
|
46
|
-
this.#transport = parsedUrl.protocol === 'http:' ? http : https
|
|
47
45
|
this.options = {
|
|
48
46
|
method: 'POST',
|
|
49
47
|
timeout,
|
|
50
|
-
hostname: parsedUrl.hostname,
|
|
51
|
-
port: parsedUrl.port,
|
|
52
|
-
path: parsedUrl.pathname + parsedUrl.search,
|
|
53
|
-
agent: parsedUrl.protocol === 'https:' ? getHttpsProxyAgent(parsedUrl) : undefined,
|
|
54
48
|
headers: {
|
|
55
49
|
'Content-Type': isJson ? 'application/json' : 'application/x-protobuf',
|
|
56
50
|
'User-Agent': `dd-trace-js/${tracerVersion}`,
|
|
@@ -59,9 +53,10 @@ class OtlpHttpExporterBase {
|
|
|
59
53
|
}
|
|
60
54
|
|
|
61
55
|
this.telemetryTags = [
|
|
62
|
-
|
|
56
|
+
'',
|
|
63
57
|
`encoding:${isJson ? 'json' : 'protobuf'}`,
|
|
64
58
|
]
|
|
59
|
+
this.#applyUrl(url)
|
|
65
60
|
}
|
|
66
61
|
|
|
67
62
|
/**
|
|
@@ -164,22 +159,44 @@ class OtlpHttpExporterBase {
|
|
|
164
159
|
}
|
|
165
160
|
|
|
166
161
|
/**
|
|
167
|
-
* Re-targets the exporter to a different URL, updating transport, hostname, port, and path.
|
|
168
162
|
* @param {string} url
|
|
169
163
|
*/
|
|
170
|
-
|
|
164
|
+
#applyUrl (url) {
|
|
171
165
|
const parsedUrl = new URL(url)
|
|
172
|
-
|
|
166
|
+
if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {
|
|
167
|
+
throw new TypeError(`Unsupported OTLP endpoint protocol: ${parsedUrl.protocol}`)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const transport = parsedUrl.protocol === 'http:' ? http : https
|
|
171
|
+
const agent = transport === https ? getHttpsProxyAgent(parsedUrl) : undefined
|
|
172
|
+
|
|
173
|
+
this.#transport = transport
|
|
173
174
|
this.options.hostname = parsedUrl.hostname
|
|
174
175
|
this.options.port = parsedUrl.port
|
|
175
176
|
this.options.path = parsedUrl.pathname + parsedUrl.search
|
|
176
|
-
this.options.agent =
|
|
177
|
-
this.telemetryTags[0] = `protocol:${
|
|
177
|
+
this.options.agent = agent
|
|
178
|
+
this.telemetryTags[0] = `protocol:${transport === https ? 'https' : 'http'}`
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Re-targets the exporter to a different URL, updating transport, hostname, port, and path.
|
|
183
|
+
* @param {string} url
|
|
184
|
+
*/
|
|
185
|
+
setUrl (url) {
|
|
186
|
+
try {
|
|
187
|
+
this.#applyUrl(url)
|
|
188
|
+
} catch (error) {
|
|
189
|
+
log.error(
|
|
190
|
+
'Invalid OTLP %s URL: %s. Using previous URL. Error: %s',
|
|
191
|
+
this.signalType,
|
|
192
|
+
url,
|
|
193
|
+
error.message
|
|
194
|
+
)
|
|
195
|
+
}
|
|
178
196
|
}
|
|
179
197
|
|
|
180
198
|
/**
|
|
181
199
|
* @param {() => void} [done]
|
|
182
|
-
* @returns {void}
|
|
183
200
|
*/
|
|
184
201
|
shutdown (done) {
|
|
185
202
|
done?.()
|
|
@@ -171,7 +171,6 @@ class OtlpTransformerBase {
|
|
|
171
171
|
* Supports string keys with primitive values or arrays of primitives.
|
|
172
172
|
*
|
|
173
173
|
* @param {Attributes} attributes - Attributes object to stringify
|
|
174
|
-
* @returns {string} Stable string representation
|
|
175
174
|
*/
|
|
176
175
|
function stableStringify (attributes) {
|
|
177
176
|
if (attributes == null) {
|
|
@@ -261,7 +261,6 @@ function recordException (ddSpan, exception, timeInput, otelTraceSemanticsEnable
|
|
|
261
261
|
* @param {number} currentCode 0 = UNSET, 1 = OK, 2 = ERROR.
|
|
262
262
|
* @param {{ code?: number, message?: string }} [status]
|
|
263
263
|
* @param {boolean} [otelTraceSemanticsEnabled]
|
|
264
|
-
* @returns {number} The new status code to track on the caller.
|
|
265
264
|
*/
|
|
266
265
|
function applyOtelStatus (ddSpan, currentCode, status, otelTraceSemanticsEnabled) {
|
|
267
266
|
if (!isWritable(ddSpan)) return currentCode
|
|
@@ -57,7 +57,6 @@ class OtlpHttpTraceExporter extends OtlpHttpExporterBase {
|
|
|
57
57
|
* Exports DD-formatted spans via OTLP over HTTP.
|
|
58
58
|
*
|
|
59
59
|
* @param {import('./otlp_transformer').DDFormattedSpan[]} spans - Array of DD-formatted spans to export
|
|
60
|
-
* @returns {void}
|
|
61
60
|
*/
|
|
62
61
|
export (spans) {
|
|
63
62
|
if (spans.length === 0) {
|
|
@@ -248,7 +248,6 @@ class OtlpTraceTransformer extends OtlpTransformerBase {
|
|
|
248
248
|
* Maps a DD span.kind string to an OTLP SpanKind enum value.
|
|
249
249
|
*
|
|
250
250
|
* @param {string | undefined} kind - DD span kind string
|
|
251
|
-
* @returns {number} OTLP SpanKind enum value
|
|
252
251
|
*/
|
|
253
252
|
#mapSpanKind (kind) {
|
|
254
253
|
if (!kind) return SPAN_KIND_UNSPECIFIED
|
|
@@ -340,7 +339,6 @@ class OtlpTraceTransformer extends OtlpTransformerBase {
|
|
|
340
339
|
*
|
|
341
340
|
* @param {Identifier} identifier - DD Identifier
|
|
342
341
|
* @param {number} targetLength - Target byte length (16 for trace ID, 8 for span ID)
|
|
343
|
-
* @returns {string} Hex-encoded string of the specified length
|
|
344
342
|
*/
|
|
345
343
|
#idToBytes (identifier, targetLength) {
|
|
346
344
|
const buffer = identifier.toBuffer()
|
|
@@ -363,7 +361,6 @@ class OtlpTraceTransformer extends OtlpTransformerBase {
|
|
|
363
361
|
*
|
|
364
362
|
* @param {string | undefined} hexString - Hex string to normalize
|
|
365
363
|
* @param {number} targetLength - Target byte length
|
|
366
|
-
* @returns {string} Hex-encoded string of the specified length
|
|
367
364
|
*/
|
|
368
365
|
#hexToBytes (hexString, targetLength) {
|
|
369
366
|
if (!hexString) return '0'.repeat(targetLength * 2)
|
|
@@ -88,7 +88,6 @@ const percentByte = /%([0-9A-Fa-f]{2})/g
|
|
|
88
88
|
/**
|
|
89
89
|
* @param {Array<string | undefined>} traceTagReplacements
|
|
90
90
|
* @param {string} key
|
|
91
|
-
* @returns {boolean}
|
|
92
91
|
*/
|
|
93
92
|
function hasTraceTagReplacement (traceTagReplacements, key) {
|
|
94
93
|
for (let index = 0; index < traceTagReplacements.length; index += 2) {
|
|
@@ -117,7 +116,6 @@ function extractGenericContext (traceId, spanId, radix) {
|
|
|
117
116
|
/**
|
|
118
117
|
* @param {string} traceId
|
|
119
118
|
* @param {DatadogSpanContext} spanContext
|
|
120
|
-
* @returns {void}
|
|
121
119
|
*/
|
|
122
120
|
function extract128BitTraceId (traceId, spanContext) {
|
|
123
121
|
const buffer = spanContext._traceId.toBuffer()
|
|
@@ -485,7 +483,6 @@ class TextMapPropagator {
|
|
|
485
483
|
* @param {Record<string, string>} traceTags
|
|
486
484
|
* @param {Array<string | undefined>} [traceTagReplacements]
|
|
487
485
|
* @param {number} optionalTraceTagCount
|
|
488
|
-
* @returns {void}
|
|
489
486
|
*/
|
|
490
487
|
#injectTags (carrier, traceTags, traceTagReplacements, optionalTraceTagCount) {
|
|
491
488
|
if (this.#config.DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH === 0) {
|
|
@@ -688,7 +685,6 @@ class TextMapPropagator {
|
|
|
688
685
|
/**
|
|
689
686
|
* @param {'inject' | 'extract'} mode
|
|
690
687
|
* @param {string} name
|
|
691
|
-
* @returns {boolean}
|
|
692
688
|
*/
|
|
693
689
|
#hasPropagationStyle (mode, name) {
|
|
694
690
|
return this.#config.tracePropagationStyle[mode].includes(name)
|
|
@@ -974,7 +970,6 @@ class TextMapPropagator {
|
|
|
974
970
|
/**
|
|
975
971
|
* @param {Record<string, unknown>} carrier
|
|
976
972
|
* @param {DatadogSpanContext} spanContext
|
|
977
|
-
* @returns {void}
|
|
978
973
|
*/
|
|
979
974
|
#extractLegacyBaggageItems (carrier, spanContext) {
|
|
980
975
|
if (!this.#config.legacyBaggageEnabled) return
|
|
@@ -985,7 +980,6 @@ class TextMapPropagator {
|
|
|
985
980
|
* @param {Record<string, unknown> | undefined} carrier
|
|
986
981
|
* @param {DatadogSpanContext | undefined} spanContext
|
|
987
982
|
* @param {boolean} extractBaggage
|
|
988
|
-
* @returns {void}
|
|
989
983
|
*/
|
|
990
984
|
#extractBaggageItems (carrier, spanContext, extractBaggage) {
|
|
991
985
|
removeAllBaggageItems()
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
const { isMainThread, threadId } = require('worker_threads')
|
|
27
27
|
|
|
28
|
+
const { AUTO_KEEP } = require('../../../ext/priority')
|
|
28
29
|
const { isACFActive } = require('../../datadog-core/src/storage')
|
|
29
30
|
const log = require('./log')
|
|
30
31
|
const {
|
|
@@ -94,6 +95,20 @@ const ATTRIBUTE_KEYS = [
|
|
|
94
95
|
const THREAD_NAME = (isMainThread ? 'Main' : `Worker #${threadId}`) + ' Event Loop'
|
|
95
96
|
const THREAD_ID = String(threadId)
|
|
96
97
|
|
|
98
|
+
// W3C trace-flags byte for a record, derived the same way DatadogSpanContext
|
|
99
|
+
// #toTraceparent derives the flags it puts on the wire — sampled iff the
|
|
100
|
+
// priority is AUTO_KEEP or above.
|
|
101
|
+
//
|
|
102
|
+
// Unlike toTraceparent, this does NOT materialize a not-yet-taken decision
|
|
103
|
+
// (_ensureSamplingPriority): that would move every trace's sampling decision
|
|
104
|
+
// forward to the first activation of its first span, on the tracer's hot path,
|
|
105
|
+
// as a side effect of profiling being enabled. An undefined priority therefore
|
|
106
|
+
// reads as not sampled, which is also what OTEP-4947 prescribes when the flags
|
|
107
|
+
// are not known yet. See the note on setTraceFlags in getOrBuildContext.
|
|
108
|
+
function traceFlagsOf (spanContext) {
|
|
109
|
+
return spanContext._sampling?.priority >= AUTO_KEEP ? 1 : 0
|
|
110
|
+
}
|
|
111
|
+
|
|
97
112
|
// Cache slot on span objects. One ThreadContext is built per span on first
|
|
98
113
|
// activation and re-installed across every async-context frame that
|
|
99
114
|
// re-enters the span — V8's AsyncContextFrame inherits the JS
|
|
@@ -140,7 +155,13 @@ function getOrBuildContext (span) {
|
|
|
140
155
|
cached = {}
|
|
141
156
|
span[CachedSym] = cached
|
|
142
157
|
}
|
|
143
|
-
|
|
158
|
+
// The flags are the one part of the record that can still change after
|
|
159
|
+
// publication: a decision taken later, or overridden, is pushed into the live
|
|
160
|
+
// record with setTraceFlags rather than by rebuilding the context, which would
|
|
161
|
+
// strand every async-context frame already holding this one. Nothing calls it
|
|
162
|
+
// yet — the tracer publishes no event for a sampling decision — so a record
|
|
163
|
+
// built before the decision keeps reading as not sampled.
|
|
164
|
+
cached.context = new ThreadContext(traceId, spanId, traceFlagsOf(spanContext), attrs)
|
|
144
165
|
cached.webTags = webTags
|
|
145
166
|
if (endpoint === undefined) awaitEndpoint(webTags, cached)
|
|
146
167
|
return cached.context
|
|
@@ -279,7 +300,7 @@ function missingApiMember (ns) {
|
|
|
279
300
|
for (const name of ['ThreadContext', 'getContext', 'clearContext', 'getProcessContextAttributes']) {
|
|
280
301
|
if (typeof ns[name] !== 'function') return name
|
|
281
302
|
}
|
|
282
|
-
for (const name of ['appendAttributes', 'enter', 'invalidate']) {
|
|
303
|
+
for (const name of ['appendAttributes', 'enter', 'invalidate', 'setTraceFlags']) {
|
|
283
304
|
if (typeof ns.ThreadContext.prototype[name] !== 'function') return `ThreadContext.prototype.${name}`
|
|
284
305
|
}
|
|
285
306
|
}
|
|
@@ -287,15 +308,21 @@ function missingApiMember (ns) {
|
|
|
287
308
|
// Install and detach one throwaway context, to establish that this process can
|
|
288
309
|
// actually do it before any span depends on it.
|
|
289
310
|
//
|
|
290
|
-
// @datadog/pprof
|
|
291
|
-
//
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
//
|
|
295
|
-
//
|
|
296
|
-
//
|
|
297
|
-
//
|
|
298
|
-
//
|
|
311
|
+
// @datadog/pprof throws from enter() when it concludes AsyncContextFrame is not
|
|
312
|
+
// active. It reaches that conclusion by its own feature detection, asking the
|
|
313
|
+
// addon what is in the CPED slot during a `run()` — direct evidence about the
|
|
314
|
+
// exact slot the out-of-process reader walks. `isACFActive` above tests the same
|
|
315
|
+
// property through a weaker proxy: whether `run()` delegates to `enterWith()`,
|
|
316
|
+
// which holds today but relies on unspecified dispatch that anything patching
|
|
317
|
+
// `AsyncLocalStorage` can break. So the two can disagree, and pprof's answer is
|
|
318
|
+
// the one that governs whether a record ever gets written. Its enter() can also
|
|
319
|
+
// fail for reasons `isACFActive` says nothing about, such as an addon that
|
|
320
|
+
// loaded but whose TLS block is unusable.
|
|
321
|
+
//
|
|
322
|
+
// Since our subscribers run inline with `storage.enterWith`, letting enter()
|
|
323
|
+
// throw would put the exception in application code on the first span
|
|
324
|
+
// activation, so find out here instead, where declining to start is still an
|
|
325
|
+
// option.
|
|
299
326
|
function canInstallContext (ns) {
|
|
300
327
|
try {
|
|
301
328
|
// Zero-filled ids: the record is only readable while it is installed, which
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const { PAYLOAD_TAGGING_MAX_TAGS } = require('../constants')
|
|
4
|
+
const { truncateString } = require('../util')
|
|
4
5
|
|
|
5
6
|
const redactedKeys = new Set([
|
|
6
7
|
'authorization', 'x-authorization', 'password', 'token',
|
|
7
8
|
])
|
|
8
9
|
const truncated = 'truncated'
|
|
9
10
|
const redacted = 'redacted'
|
|
11
|
+
const maxValueLength = 5000
|
|
12
|
+
const maxRetainedValueLength = maxValueLength * 2
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {string} value
|
|
16
|
+
*/
|
|
17
|
+
function truncateValue (value) {
|
|
18
|
+
return value.length > maxRetainedValueLength
|
|
19
|
+
? truncateString(value, maxValueLength)
|
|
20
|
+
: value.slice(0, maxValueLength)
|
|
21
|
+
}
|
|
10
22
|
|
|
11
23
|
/**
|
|
12
24
|
* Escapes dots in keys to preserve hierarchy in flattened tag names.
|
|
13
25
|
*
|
|
14
26
|
* @param {string} key
|
|
15
|
-
* @returns {string}
|
|
16
27
|
*/
|
|
17
28
|
function escapeKey (key) {
|
|
18
29
|
return key.replaceAll('.', String.raw`\.`)
|
|
@@ -67,13 +78,14 @@ function tagsFromObject (object, opts) {
|
|
|
67
78
|
|
|
68
79
|
if (['number', 'boolean'].includes(typeof object) || Buffer.isBuffer(object)) {
|
|
69
80
|
tagCount += 1
|
|
70
|
-
|
|
81
|
+
const value = object.toString()
|
|
82
|
+
result[prefix] = value.length > maxValueLength ? truncateValue(value) : value
|
|
71
83
|
return
|
|
72
84
|
}
|
|
73
85
|
|
|
74
86
|
if (typeof object === 'string') {
|
|
75
87
|
tagCount += 1
|
|
76
|
-
result[prefix] = object.
|
|
88
|
+
result[prefix] = object.length > maxValueLength ? truncateValue(object) : object
|
|
77
89
|
}
|
|
78
90
|
|
|
79
91
|
if (typeof object === 'object') {
|
|
@@ -593,7 +593,6 @@ module.exports = class CiPlugin extends Plugin {
|
|
|
593
593
|
* @param {string|undefined} repositoryRoot - Repository root discovered by the coordinator process.
|
|
594
594
|
* @param {Array<{ pattern: string, owners: string[] }>|null|undefined} codeOwnersEntries
|
|
595
595
|
* Parsed CODEOWNERS entries discovered by the coordinator process.
|
|
596
|
-
* @returns {void}
|
|
597
596
|
*/
|
|
598
597
|
_setRepositoryRoot (repositoryRoot, codeOwnersEntries) {
|
|
599
598
|
if (codeOwnersEntries !== undefined) {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const { LRUCache } = require('../../../../vendor/dist/lru-cache')
|
|
4
4
|
const { PEER_SERVICE_KEY, PEER_SERVICE_SOURCE_KEY } = require('../constants')
|
|
5
5
|
const propagationHash = require('../propagation-hash')
|
|
6
|
+
const { truncateString } = require('../util')
|
|
6
7
|
const StoragePlugin = require('./storage')
|
|
7
8
|
|
|
8
9
|
// Unreserved RFC 3986 set that `encodeURIComponent` leaves untouched (a conservative subset:
|
|
@@ -46,7 +47,6 @@ class DatabasePlugin extends StoragePlugin {
|
|
|
46
47
|
* @param {string} serviceName
|
|
47
48
|
* @param {import('../../../..').Span} span
|
|
48
49
|
* @param {object} peerData
|
|
49
|
-
* @returns {string}
|
|
50
50
|
*/
|
|
51
51
|
#createDBMPropagationCommentService (serviceName, span, peerData) {
|
|
52
52
|
const spanTags = span.context().getTags()
|
|
@@ -70,7 +70,6 @@ class DatabasePlugin extends StoragePlugin {
|
|
|
70
70
|
/**
|
|
71
71
|
* @param {string} tracerService
|
|
72
72
|
* @param {object} peerData
|
|
73
|
-
* @returns {string}
|
|
74
73
|
*/
|
|
75
74
|
#getDbmServiceName (tracerService, peerData) {
|
|
76
75
|
if (this._tracerConfig.spanComputePeerService) {
|
|
@@ -123,7 +122,6 @@ class DatabasePlugin extends StoragePlugin {
|
|
|
123
122
|
* @param {string} query
|
|
124
123
|
* @param {string} serviceName
|
|
125
124
|
* @param {boolean} disableFullMode
|
|
126
|
-
* @returns {string}
|
|
127
125
|
*/
|
|
128
126
|
injectDbmQuery (span, query, serviceName, disableFullMode = false) {
|
|
129
127
|
const dbmTraceComment = this.createDbmComment(span, serviceName, disableFullMode)
|
|
@@ -139,7 +137,6 @@ class DatabasePlugin extends StoragePlugin {
|
|
|
139
137
|
|
|
140
138
|
/**
|
|
141
139
|
* @param {string} query
|
|
142
|
-
* @returns {string}
|
|
143
140
|
*/
|
|
144
141
|
maybeTruncate (query) {
|
|
145
142
|
const maxLength = typeof this.config.truncate === 'number'
|
|
@@ -147,7 +144,7 @@ class DatabasePlugin extends StoragePlugin {
|
|
|
147
144
|
: 5000 // same as what the agent does
|
|
148
145
|
|
|
149
146
|
if (this.config.truncate && query && query.length > maxLength) {
|
|
150
|
-
query =
|
|
147
|
+
query = truncateString(query, maxLength, '...')
|
|
151
148
|
}
|
|
152
149
|
|
|
153
150
|
return query
|
|
@@ -156,7 +153,6 @@ class DatabasePlugin extends StoragePlugin {
|
|
|
156
153
|
|
|
157
154
|
/**
|
|
158
155
|
* @param {string | number | undefined | null} value
|
|
159
|
-
* @returns {string}
|
|
160
156
|
*/
|
|
161
157
|
function encode (value) {
|
|
162
158
|
if (!value) return ''
|
|
@@ -10,6 +10,12 @@ const plugins = {
|
|
|
10
10
|
get '@azure/functions' () { return require('../../../datadog-plugin-azure-functions/src') },
|
|
11
11
|
get '@modelcontextprotocol/sdk' () { return require('../../../datadog-plugin-modelcontextprotocol-sdk/src') },
|
|
12
12
|
get '@aws/durable-execution-sdk-js' () { return require('../../../datadog-plugin-aws-durable-execution-sdk-js/src') },
|
|
13
|
+
get '@supabase/auth-js' () { return require('../../../datadog-plugin-supabase/src') },
|
|
14
|
+
get '@supabase/functions-js' () { return require('../../../datadog-plugin-supabase/src') },
|
|
15
|
+
get '@supabase/postgrest-js' () { return require('../../../datadog-plugin-supabase/src') },
|
|
16
|
+
get '@supabase/realtime-js' () { return require('../../../datadog-plugin-supabase/src') },
|
|
17
|
+
get '@supabase/storage-js' () { return require('../../../datadog-plugin-supabase/src') },
|
|
18
|
+
get '@supabase/supabase-js' () { return require('../../../datadog-plugin-supabase/src') },
|
|
13
19
|
get 'durable-functions' () { return require('../../../datadog-plugin-azure-durable-functions/src') },
|
|
14
20
|
get '@azure/service-bus' () { return require('../../../datadog-plugin-azure-service-bus/src') },
|
|
15
21
|
get '@cucumber/cucumber' () { return require('../../../datadog-plugin-cucumber/src') },
|
|
@@ -121,6 +127,7 @@ const plugins = {
|
|
|
121
127
|
get pino () { return require('../../../datadog-plugin-pino/src') },
|
|
122
128
|
get 'pino-pretty' () { return require('../../../datadog-plugin-pino/src') },
|
|
123
129
|
get playwright () { return require('../../../datadog-plugin-playwright/src') },
|
|
130
|
+
get postgres () { return require('../../../datadog-plugin-postgres/src') },
|
|
124
131
|
get protobufjs () { return require('../../../datadog-plugin-protobufjs/src') },
|
|
125
132
|
get redis () { return require('../../../datadog-plugin-redis/src') },
|
|
126
133
|
get restify () { return require('../../../datadog-plugin-restify/src') },
|
|
@@ -100,7 +100,6 @@ module.exports = class Plugin {
|
|
|
100
100
|
*
|
|
101
101
|
* @param {object} span The span to bind as current.
|
|
102
102
|
* @param {object=} store Optional existing store to extend; if omitted, uses current store.
|
|
103
|
-
* @returns {void}
|
|
104
103
|
*/
|
|
105
104
|
enter (span, store) {
|
|
106
105
|
store ||= legacyStorage.getStore()
|
|
@@ -112,7 +111,6 @@ module.exports = class Plugin {
|
|
|
112
111
|
*
|
|
113
112
|
* @param {string} channelName Diagnostic channel name.
|
|
114
113
|
* @param {(message: unknown, name: string) => unknown} handler Handler invoked on messages.
|
|
115
|
-
* @returns {void}
|
|
116
114
|
*/
|
|
117
115
|
addSub (channelName, handler) {
|
|
118
116
|
const wrappedHandler = (message, name) => {
|
|
@@ -132,7 +130,6 @@ module.exports = class Plugin {
|
|
|
132
130
|
*
|
|
133
131
|
* @param {string} channelName Diagnostic channel name.
|
|
134
132
|
* @param {(data: unknown) => object} transform Transform to compute the bound store.
|
|
135
|
-
* @returns {void}
|
|
136
133
|
*/
|
|
137
134
|
addBind (channelName, transform) {
|
|
138
135
|
this._bindings.push(new StoreBinding(channelName, transform))
|
|
@@ -142,7 +139,6 @@ module.exports = class Plugin {
|
|
|
142
139
|
* Attach an error to the current active span (if any).
|
|
143
140
|
*
|
|
144
141
|
* @param {unknown} error Error object or sentinel value.
|
|
145
|
-
* @returns {void}
|
|
146
142
|
*/
|
|
147
143
|
addError (error) {
|
|
148
144
|
const store = legacyStorage.getStore()
|
|
@@ -29,6 +29,7 @@ class TracingPlugin extends Plugin {
|
|
|
29
29
|
* @param {string} [opts.type]
|
|
30
30
|
* @param {string} [opts.id]
|
|
31
31
|
* @param {string} [opts.kind]
|
|
32
|
+
* @param {object} [opts.pluginConfig]
|
|
32
33
|
* @returns {{ name: string, source: string | undefined }}
|
|
33
34
|
*/
|
|
34
35
|
serviceName (opts = {}) {
|
|
@@ -46,7 +47,6 @@ class TracingPlugin extends Plugin {
|
|
|
46
47
|
* @param {string} [opts.type]
|
|
47
48
|
* @param {string} [opts.id]
|
|
48
49
|
* @param {string} [opts.kind]
|
|
49
|
-
* @returns {string}
|
|
50
50
|
*/
|
|
51
51
|
operationName (opts = {}) {
|
|
52
52
|
const {
|
|
@@ -95,10 +95,8 @@ function isDirectory (path) {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
function isGitAvailable () {
|
|
98
|
-
const isWindows = os.platform() === 'win32'
|
|
99
|
-
const command = isWindows ? 'where' : 'which'
|
|
100
98
|
try {
|
|
101
|
-
cachedExec(
|
|
99
|
+
cachedExec('git', ['--version'])
|
|
102
100
|
return true
|
|
103
101
|
} catch {
|
|
104
102
|
incrementCountMetric(TELEMETRY_GIT_COMMAND_ERRORS, { command: 'check_git', exitCode: 'missing' })
|
|
@@ -104,7 +104,6 @@ function toHttpScheme (scheme) {
|
|
|
104
104
|
* `REDACTED@host`. Returns the URL unchanged when no userinfo is present.
|
|
105
105
|
*
|
|
106
106
|
* @param {string} url
|
|
107
|
-
* @returns {string}
|
|
108
107
|
*/
|
|
109
108
|
function redactUrlCredentials (url) {
|
|
110
109
|
const schemeEnd = url.indexOf('://')
|
|
@@ -29,7 +29,6 @@ function normalize (text, limit = 128) {
|
|
|
29
29
|
*
|
|
30
30
|
* @param {Sampler} sampler
|
|
31
31
|
* @param {import('../../../../..').Span|import('../../../../..').SpanContext} span
|
|
32
|
-
* @returns {boolean} `true` if the prompt completion should be sampled, otherwise `false`.
|
|
33
32
|
*/
|
|
34
33
|
function isPromptCompletionSampled (sampler, span) {
|
|
35
34
|
return sampler.isSampled(span)
|
|
@@ -52,7 +51,6 @@ module.exports = function makeUtilities (integrationName, tracerConfig) {
|
|
|
52
51
|
* Determines whether a prompt completion should be sampled based on the configured sampling rate.
|
|
53
52
|
*
|
|
54
53
|
* @param {import('../../../../..').Span|import('../../../../..').SpanContext} span
|
|
55
|
-
* @returns {boolean} `true` if the prompt completion should be sampled, otherwise `false`.
|
|
56
54
|
*/
|
|
57
55
|
isPromptCompletionSampled: (span) => isPromptCompletionSampled(sampler, span),
|
|
58
56
|
}
|