dd-trace 5.98.0 → 5.99.1

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.
Files changed (139) hide show
  1. package/LICENSE-3rdparty.csv +0 -1
  2. package/ext/tags.js +1 -0
  3. package/index.d.ts +9 -1
  4. package/package.json +68 -47
  5. package/packages/datadog-instrumentations/src/crypto.js +45 -0
  6. package/packages/datadog-instrumentations/src/cypress-config.js +122 -16
  7. package/packages/datadog-instrumentations/src/dns.js +24 -56
  8. package/packages/datadog-instrumentations/src/graphql.js +1 -1
  9. package/packages/datadog-instrumentations/src/helpers/callback-instrumentor.js +74 -0
  10. package/packages/datadog-instrumentations/src/helpers/check-require-cache.js +4 -1
  11. package/packages/datadog-instrumentations/src/helpers/hooks.js +2 -0
  12. package/packages/datadog-instrumentations/src/helpers/rewriter/compiler.js +10 -3
  13. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +1 -0
  14. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/modelcontextprotocol-sdk.js +59 -0
  15. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +11 -2
  16. package/packages/datadog-instrumentations/src/jest.js +5 -5
  17. package/packages/datadog-instrumentations/src/modelcontextprotocol-sdk.js +7 -0
  18. package/packages/datadog-instrumentations/src/pino.js +4 -28
  19. package/packages/datadog-instrumentations/src/playwright-browser-scripts.js +27 -0
  20. package/packages/datadog-instrumentations/src/playwright.js +5 -17
  21. package/packages/datadog-instrumentations/src/stripe.js +38 -24
  22. package/packages/datadog-instrumentations/src/vitest.js +32 -4
  23. package/packages/datadog-instrumentations/src/zlib.js +29 -0
  24. package/packages/datadog-plugin-aws-sdk/src/base.js +1 -2
  25. package/packages/datadog-plugin-azure-event-hubs/src/producer.js +8 -15
  26. package/packages/datadog-plugin-azure-service-bus/src/producer.js +4 -9
  27. package/packages/datadog-plugin-cucumber/src/index.js +2 -2
  28. package/packages/datadog-plugin-cypress/src/cypress-plugin.js +5 -5
  29. package/packages/datadog-plugin-cypress/src/source-map-utils.js +48 -1
  30. package/packages/datadog-plugin-dd-trace-api/src/index.js +1 -1
  31. package/packages/datadog-plugin-graphql/src/utils.js +2 -2
  32. package/packages/datadog-plugin-http/src/server.js +11 -11
  33. package/packages/datadog-plugin-jest/src/index.js +2 -2
  34. package/packages/datadog-plugin-memcached/src/index.js +1 -1
  35. package/packages/datadog-plugin-mocha/src/index.js +1 -2
  36. package/packages/datadog-plugin-modelcontextprotocol-sdk/src/index.js +24 -0
  37. package/packages/datadog-plugin-modelcontextprotocol-sdk/src/tracing.js +55 -0
  38. package/packages/datadog-plugin-mongodb-core/src/index.js +1 -6
  39. package/packages/datadog-plugin-playwright/src/index.js +2 -3
  40. package/packages/datadog-plugin-vitest/src/index.js +14 -6
  41. package/packages/datadog-plugin-ws/src/close.js +2 -0
  42. package/packages/datadog-plugin-ws/src/producer.js +2 -0
  43. package/packages/datadog-plugin-ws/src/receiver.js +1 -0
  44. package/packages/dd-trace/src/aiguard/channels.js +8 -0
  45. package/packages/dd-trace/src/aiguard/index.js +7 -3
  46. package/packages/dd-trace/src/aiguard/sdk.js +44 -0
  47. package/packages/dd-trace/src/aiguard/tags.js +1 -0
  48. package/packages/dd-trace/src/appsec/blocking.js +18 -6
  49. package/packages/dd-trace/src/appsec/graphql.js +7 -7
  50. package/packages/dd-trace/src/appsec/index.js +9 -11
  51. package/packages/dd-trace/src/appsec/rasp/command_injection.js +4 -5
  52. package/packages/dd-trace/src/appsec/rasp/lfi.js +8 -4
  53. package/packages/dd-trace/src/appsec/rasp/sql_injection.js +5 -10
  54. package/packages/dd-trace/src/appsec/rasp/ssrf.js +5 -6
  55. package/packages/dd-trace/src/appsec/recommended.json +2438 -13
  56. package/packages/dd-trace/src/appsec/reporter.js +6 -5
  57. package/packages/dd-trace/src/appsec/sdk/user_blocking.js +4 -8
  58. package/packages/dd-trace/src/appsec/store.js +50 -0
  59. package/packages/dd-trace/src/appsec/waf/index.js +3 -5
  60. package/packages/dd-trace/src/baggage.js +16 -13
  61. package/packages/dd-trace/src/ci-visibility/early-flake-detection/get-known-tests.js +2 -2
  62. package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +2 -2
  63. package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +2 -2
  64. package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +2 -2
  65. package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +1 -1
  66. package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +3 -4
  67. package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +2 -2
  68. package/packages/dd-trace/src/ci-visibility/log-submission/log-submission-plugin.js +4 -5
  69. package/packages/dd-trace/src/ci-visibility/requests/fs-cache.js +3 -4
  70. package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +6 -6
  71. package/packages/dd-trace/src/ci-visibility/requests/upload-coverage-report.js +2 -2
  72. package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +2 -2
  73. package/packages/dd-trace/src/config/config-types.d.ts +0 -4
  74. package/packages/dd-trace/src/config/defaults.js +10 -10
  75. package/packages/dd-trace/src/config/generated-config-types.d.ts +39 -38
  76. package/packages/dd-trace/src/config/index.js +29 -39
  77. package/packages/dd-trace/src/config/parsers.js +26 -9
  78. package/packages/dd-trace/src/config/supported-configurations.json +46 -78
  79. package/packages/dd-trace/src/debugger/config.js +2 -0
  80. package/packages/dd-trace/src/debugger/devtools_client/send.js +25 -5
  81. package/packages/dd-trace/src/dogstatsd.js +5 -8
  82. package/packages/dd-trace/src/encode/0.4.js +4 -5
  83. package/packages/dd-trace/src/exporter.js +1 -1
  84. package/packages/dd-trace/src/exporters/agent/index.js +0 -1
  85. package/packages/dd-trace/src/exporters/agent/writer.js +1 -2
  86. package/packages/dd-trace/src/exporters/agentless/writer.js +3 -3
  87. package/packages/dd-trace/src/exporters/common/util.js +2 -2
  88. package/packages/dd-trace/src/git_metadata_tagger.js +1 -1
  89. package/packages/dd-trace/src/id.js +2 -0
  90. package/packages/dd-trace/src/index.js +2 -5
  91. package/packages/dd-trace/src/lambda/handler.js +1 -3
  92. package/packages/dd-trace/src/llmobs/constants/tags.js +3 -0
  93. package/packages/dd-trace/src/llmobs/plugins/{anthropic.js → anthropic/index.js} +5 -63
  94. package/packages/dd-trace/src/llmobs/plugins/anthropic/util.js +106 -0
  95. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chain.js +3 -2
  96. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chat_model.js +3 -2
  97. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/embedding.js +2 -1
  98. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/index.js +0 -49
  99. package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/vectorstore.js +2 -1
  100. package/packages/dd-trace/src/llmobs/plugins/langchain/messages.js +76 -0
  101. package/packages/dd-trace/src/llmobs/plugins/langgraph/index.js +1 -26
  102. package/packages/dd-trace/src/llmobs/plugins/modelcontextprotocol-sdk/index.js +68 -0
  103. package/packages/dd-trace/src/llmobs/plugins/modelcontextprotocol-sdk/utils.js +57 -0
  104. package/packages/dd-trace/src/llmobs/sdk.js +23 -3
  105. package/packages/dd-trace/src/llmobs/span_processor.js +14 -1
  106. package/packages/dd-trace/src/llmobs/writers/base.js +7 -1
  107. package/packages/dd-trace/src/llmobs/writers/spans.js +1 -1
  108. package/packages/dd-trace/src/openfeature/eval-metrics-hook.js +103 -0
  109. package/packages/dd-trace/src/openfeature/flagging_provider.js +3 -0
  110. package/packages/dd-trace/src/opentelemetry/logs/index.js +6 -6
  111. package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +3 -2
  112. package/packages/dd-trace/src/opentelemetry/metrics/index.js +7 -7
  113. package/packages/dd-trace/src/opentelemetry/metrics/otlp_http_metric_exporter.js +3 -2
  114. package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +19 -66
  115. package/packages/dd-trace/src/opentelemetry/trace/index.js +11 -16
  116. package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +11 -3
  117. package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +51 -41
  118. package/packages/dd-trace/src/opentelemetry/tracer.js +9 -11
  119. package/packages/dd-trace/src/opentracing/propagation/text_map.js +30 -23
  120. package/packages/dd-trace/src/opentracing/span.js +2 -2
  121. package/packages/dd-trace/src/opentracing/tracer.js +12 -5
  122. package/packages/dd-trace/src/plugin_manager.js +6 -6
  123. package/packages/dd-trace/src/plugins/index.js +1 -0
  124. package/packages/dd-trace/src/plugins/log_plugin.js +1 -1
  125. package/packages/dd-trace/src/plugins/util/test.js +128 -7
  126. package/packages/dd-trace/src/plugins/util/url.js +2 -1
  127. package/packages/dd-trace/src/profiling/profilers/event_plugins/crypto.js +32 -0
  128. package/packages/dd-trace/src/profiling/profilers/event_plugins/zlib.js +19 -0
  129. package/packages/dd-trace/src/profiling/profilers/events.js +35 -0
  130. package/packages/dd-trace/src/proxy.js +8 -14
  131. package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +2 -2
  132. package/packages/dd-trace/src/service-naming/schemas/v0/web.js +4 -0
  133. package/packages/dd-trace/src/service-naming/schemas/v1/web.js +4 -0
  134. package/packages/dd-trace/src/span_processor.js +1 -2
  135. package/packages/dd-trace/src/tagger.js +2 -2
  136. package/packages/dd-trace/src/telemetry/send-data.js +5 -7
  137. package/packages/dd-trace/src/tracer.js +2 -2
  138. package/vendor/dist/ignore/LICENSE +0 -21
  139. package/vendor/dist/ignore/index.js +0 -1
@@ -12,8 +12,7 @@
12
12
  {
13
13
  "implementation": "A",
14
14
  "type": "boolean",
15
- "default": "false",
16
- "internalPropertyName": "ciVisAgentlessLogSubmissionEnabled"
15
+ "default": "false"
17
16
  }
18
17
  ],
19
18
  "DD_AGENTLESS_LOG_SUBMISSION_URL": [
@@ -179,7 +178,8 @@
179
178
  {
180
179
  "implementation": "A",
181
180
  "type": "int",
182
- "default": "100"
181
+ "default": "100",
182
+ "allowed": "\\d+"
183
183
  }
184
184
  ],
185
185
  "DD_APM_TRACING_ENABLED": [
@@ -189,7 +189,10 @@
189
189
  "configurationNames": [
190
190
  "apmTracingEnabled"
191
191
  ],
192
- "default": "true"
192
+ "default": "true",
193
+ "aliases": [
194
+ "DD_TRACING_ENABLED"
195
+ ]
193
196
  }
194
197
  ],
195
198
  "DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE": [
@@ -445,9 +448,9 @@
445
448
  ],
446
449
  "DD_CIVISIBILITY_AUTO_INSTRUMENTATION_PROVIDER": [
447
450
  {
448
- "implementation": "B",
449
- "type": "boolean",
450
- "default": "false"
451
+ "implementation": "A",
452
+ "type": "string",
453
+ "default": null
451
454
  }
452
455
  ],
453
456
  "DD_CIVISIBILITY_DANGEROUSLY_FORCE_COVERAGE": [
@@ -537,8 +540,7 @@
537
540
  {
538
541
  "implementation": "A",
539
542
  "type": "boolean",
540
- "default": "true",
541
- "internalPropertyName": "isManualApiEnabled"
543
+ "default": "true"
542
544
  }
543
545
  ],
544
546
  "DD_CIVISIBILITY_RUM_FLUSH_WAIT_MILLIS": [
@@ -1101,24 +1103,21 @@
1101
1103
  {
1102
1104
  "implementation": "C",
1103
1105
  "type": "string",
1104
- "default": null,
1105
- "internalPropertyName": "injectionEnabled"
1106
+ "default": null
1106
1107
  }
1107
1108
  ],
1108
1109
  "DD_INJECT_FORCE": [
1109
1110
  {
1110
1111
  "implementation": "A",
1111
1112
  "type": "boolean",
1112
- "default": "false",
1113
- "internalPropertyName": "injectForce"
1113
+ "default": "false"
1114
1114
  }
1115
1115
  ],
1116
1116
  "DD_INSTRUMENTATION_CONFIG_ID": [
1117
1117
  {
1118
1118
  "implementation": "A",
1119
1119
  "type": "string",
1120
- "default": null,
1121
- "internalPropertyName": "instrumentation_config_id"
1120
+ "default": null
1122
1121
  }
1123
1122
  ],
1124
1123
  "DD_INSTRUMENTATION_INSTALL_ID": [
@@ -1236,8 +1235,7 @@
1236
1235
  {
1237
1236
  "implementation": "A",
1238
1237
  "type": "boolean",
1239
- "default": "false",
1240
- "internalPropertyName": "otelLogsEnabled"
1238
+ "default": "false"
1241
1239
  }
1242
1240
  ],
1243
1241
  "DD_TRACE_LOG_LEVEL": [
@@ -1786,16 +1784,14 @@
1786
1784
  {
1787
1785
  "implementation": "A",
1788
1786
  "type": "boolean",
1789
- "default": "false",
1790
- "internalPropertyName": "isKeepingCoverageConfiguration"
1787
+ "default": "false"
1791
1788
  }
1792
1789
  ],
1793
1790
  "DD_TEST_SESSION_NAME": [
1794
1791
  {
1795
1792
  "implementation": "A",
1796
1793
  "type": "string",
1797
- "default": null,
1798
- "internalPropertyName": "ciVisibilityTestSessionName"
1794
+ "default": null
1799
1795
  }
1800
1796
  ],
1801
1797
  "DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED": [
@@ -2509,10 +2505,7 @@
2509
2505
  "implementation": "A",
2510
2506
  "type": "boolean",
2511
2507
  "default": "true",
2512
- "internalPropertyName": "tracing",
2513
- "aliases": [
2514
- "DD_TRACING_ENABLED"
2515
- ]
2508
+ "internalPropertyName": "tracing"
2516
2509
  }
2517
2510
  ],
2518
2511
  "DD_TRACE_ENCODING_DEBUG": [
@@ -2643,8 +2636,7 @@
2643
2636
  {
2644
2637
  "implementation": "A",
2645
2638
  "type": "boolean",
2646
- "default": "true",
2647
- "internalPropertyName": "gitMetadataEnabled"
2639
+ "default": "true"
2648
2640
  }
2649
2641
  ],
2650
2642
  "DD_TRACE_GOOGLE_CLOUD_PUBSUB_ENABLED": [
@@ -2686,8 +2678,7 @@
2686
2678
  {
2687
2679
  "implementation": "A",
2688
2680
  "type": "array",
2689
- "default": "",
2690
- "internalPropertyName": "graphqlErrorExtensions"
2681
+ "default": ""
2691
2682
  }
2692
2683
  ],
2693
2684
  "DD_TRACE_GRAPHQL_TAG_ENABLED": [
@@ -3061,8 +3052,7 @@
3061
3052
  {
3062
3053
  "implementation": "A",
3063
3054
  "type": "boolean",
3064
- "default": "false",
3065
- "internalPropertyName": "memcachedCommandEnabled"
3055
+ "default": "false"
3066
3056
  }
3067
3057
  ],
3068
3058
  "DD_TRACE_MEMCACHED_ENABLED": [
@@ -3110,6 +3100,13 @@
3110
3100
  "default": "true"
3111
3101
  }
3112
3102
  ],
3103
+ "DD_TRACE_MODELCONTEXTPROTOCOL_SDK_ENABLED": [
3104
+ {
3105
+ "implementation": "A",
3106
+ "type": "boolean",
3107
+ "default": "true"
3108
+ }
3109
+ ],
3113
3110
  "DD_TRACE_MOLECULER_ENABLED": [
3114
3111
  {
3115
3112
  "implementation": "A",
@@ -3429,8 +3426,7 @@
3429
3426
  {
3430
3427
  "implementation": "A",
3431
3428
  "type": "boolean",
3432
- "default": "false",
3433
- "internalPropertyName": "tracePropagationExtractFirst"
3429
+ "default": "false"
3434
3430
  }
3435
3431
  ],
3436
3432
  "DD_TRACE_PROPAGATION_STYLE": [
@@ -3670,7 +3666,6 @@
3670
3666
  {
3671
3667
  "implementation": "A",
3672
3668
  "type": "int",
3673
- "internalPropertyName": "spanLeakDebug",
3674
3669
  "default": "0"
3675
3670
  }
3676
3671
  ],
@@ -3823,8 +3818,7 @@
3823
3818
  {
3824
3819
  "implementation": "A",
3825
3820
  "type": "int",
3826
- "default": "512",
3827
- "internalPropertyName": "tagsHeaderMaxLength"
3821
+ "default": "512"
3828
3822
  }
3829
3823
  ],
3830
3824
  "DD_VERSION": [
@@ -3864,7 +3858,6 @@
3864
3858
  {
3865
3859
  "implementation": "A",
3866
3860
  "type": "int",
3867
- "internalPropertyName": "otelMaxExportBatchSize",
3868
3861
  "default": "512",
3869
3862
  "allowed": "[1-9]\\d*"
3870
3863
  }
@@ -3873,7 +3866,6 @@
3873
3866
  {
3874
3867
  "implementation": "A",
3875
3868
  "type": "int",
3876
- "internalPropertyName": "otelMaxQueueSize",
3877
3869
  "default": "2048",
3878
3870
  "allowed": "[1-9]\\d*"
3879
3871
  }
@@ -3882,7 +3874,6 @@
3882
3874
  {
3883
3875
  "implementation": "A",
3884
3876
  "type": "int",
3885
- "internalPropertyName": "otelBatchTimeout",
3886
3877
  "default": "5000",
3887
3878
  "allowed": "[1-9]\\d*"
3888
3879
  }
@@ -3896,18 +3887,16 @@
3896
3887
  ],
3897
3888
  "OTEL_EXPORTER_OTLP_HEADERS": [
3898
3889
  {
3899
- "implementation": "C",
3900
- "type": "string",
3901
- "default": null,
3902
- "internalPropertyName": "otelHeaders"
3890
+ "implementation": "B",
3891
+ "type": "map",
3892
+ "default": null
3903
3893
  }
3904
3894
  ],
3905
3895
  "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": [
3906
3896
  {
3907
3897
  "implementation": "A",
3908
3898
  "type": "string",
3909
- "default": null,
3910
- "internalPropertyName": "otelTracesUrl"
3899
+ "default": null
3911
3900
  }
3912
3901
  ],
3913
3902
  "OTEL_EXPORTER_OTLP_TRACES_HEADERS": [
@@ -3915,7 +3904,6 @@
3915
3904
  "implementation": "B",
3916
3905
  "type": "map",
3917
3906
  "default": null,
3918
- "internalPropertyName": "otelTracesHeaders",
3919
3907
  "aliases": [
3920
3908
  "OTEL_EXPORTER_OTLP_HEADERS"
3921
3909
  ]
@@ -3926,7 +3914,7 @@
3926
3914
  "implementation": "B",
3927
3915
  "type": "string",
3928
3916
  "default": "http/json",
3929
- "internalPropertyName": "otelTracesProtocol",
3917
+ "allowed": "http/json",
3930
3918
  "aliases": [
3931
3919
  "OTEL_EXPORTER_OTLP_PROTOCOL"
3932
3920
  ]
@@ -3936,7 +3924,6 @@
3936
3924
  {
3937
3925
  "implementation": "B",
3938
3926
  "type": "int",
3939
- "internalPropertyName": "otelTracesTimeout",
3940
3927
  "default": "10000",
3941
3928
  "aliases": [
3942
3929
  "OTEL_EXPORTER_OTLP_TIMEOUT"
@@ -3947,19 +3934,14 @@
3947
3934
  {
3948
3935
  "implementation": "A",
3949
3936
  "type": "string",
3950
- "default": null,
3951
- "internalPropertyName": "otelLogsUrl",
3952
- "aliases": [
3953
- "OTEL_EXPORTER_OTLP_ENDPOINT"
3954
- ]
3937
+ "default": null
3955
3938
  }
3956
3939
  ],
3957
3940
  "OTEL_EXPORTER_OTLP_LOGS_HEADERS": [
3958
3941
  {
3959
- "implementation": "A",
3960
- "type": "string",
3942
+ "implementation": "B",
3943
+ "type": "map",
3961
3944
  "default": null,
3962
- "internalPropertyName": "otelLogsHeaders",
3963
3945
  "aliases": [
3964
3946
  "OTEL_EXPORTER_OTLP_HEADERS"
3965
3947
  ]
@@ -3970,7 +3952,6 @@
3970
3952
  "implementation": "D",
3971
3953
  "type": "string",
3972
3954
  "default": "http/protobuf",
3973
- "internalPropertyName": "otelLogsProtocol",
3974
3955
  "aliases": [
3975
3956
  "OTEL_EXPORTER_OTLP_PROTOCOL"
3976
3957
  ]
@@ -3980,7 +3961,6 @@
3980
3961
  {
3981
3962
  "implementation": "A",
3982
3963
  "type": "int",
3983
- "internalPropertyName": "otelLogsTimeout",
3984
3964
  "default": "10000",
3985
3965
  "allowed": "[1-9]\\d*",
3986
3966
  "aliases": [
@@ -3992,19 +3972,14 @@
3992
3972
  {
3993
3973
  "implementation": "A",
3994
3974
  "type": "string",
3995
- "default": null,
3996
- "internalPropertyName": "otelMetricsUrl",
3997
- "aliases": [
3998
- "OTEL_EXPORTER_OTLP_ENDPOINT"
3999
- ]
3975
+ "default": null
4000
3976
  }
4001
3977
  ],
4002
3978
  "OTEL_EXPORTER_OTLP_METRICS_HEADERS": [
4003
3979
  {
4004
- "implementation": "B",
4005
- "type": "string",
3980
+ "implementation": "C",
3981
+ "type": "map",
4006
3982
  "default": null,
4007
- "internalPropertyName": "otelMetricsHeaders",
4008
3983
  "aliases": [
4009
3984
  "OTEL_EXPORTER_OTLP_HEADERS"
4010
3985
  ]
@@ -4015,7 +3990,6 @@
4015
3990
  "implementation": "B",
4016
3991
  "type": "string",
4017
3992
  "default": "http/protobuf",
4018
- "internalPropertyName": "otelMetricsProtocol",
4019
3993
  "aliases": [
4020
3994
  "OTEL_EXPORTER_OTLP_PROTOCOL"
4021
3995
  ]
@@ -4027,7 +4001,6 @@
4027
4001
  "type": "string",
4028
4002
  "allowed": "Delta|Cumulative|LowMemory",
4029
4003
  "transform": "toUpperCase",
4030
- "internalPropertyName": "otelMetricsTemporalityPreference",
4031
4004
  "default": "delta"
4032
4005
  }
4033
4006
  ],
@@ -4036,7 +4009,6 @@
4036
4009
  "implementation": "B",
4037
4010
  "type": "int",
4038
4011
  "allowed": "[1-9]\\d*",
4039
- "internalPropertyName": "otelMetricsTimeout",
4040
4012
  "default": "10000",
4041
4013
  "aliases": [
4042
4014
  "OTEL_EXPORTER_OTLP_TIMEOUT"
@@ -4047,8 +4019,7 @@
4047
4019
  {
4048
4020
  "implementation": "A",
4049
4021
  "type": "string",
4050
- "default": "http/protobuf",
4051
- "internalPropertyName": "otelProtocol"
4022
+ "default": "http/protobuf"
4052
4023
  }
4053
4024
  ],
4054
4025
  "OTEL_EXPORTER_OTLP_TIMEOUT": [
@@ -4056,7 +4027,6 @@
4056
4027
  "implementation": "A",
4057
4028
  "type": "int",
4058
4029
  "allowed": "[1-9]\\d*",
4059
- "internalPropertyName": "otelTimeout",
4060
4030
  "default": "10000"
4061
4031
  }
4062
4032
  ],
@@ -4083,7 +4053,6 @@
4083
4053
  "implementation": "A",
4084
4054
  "type": "int",
4085
4055
  "allowed": "[1-9]\\d*",
4086
- "internalPropertyName": "otelMetricsExportInterval",
4087
4056
  "default": "10000"
4088
4057
  }
4089
4058
  ],
@@ -4092,14 +4061,13 @@
4092
4061
  "implementation": "A",
4093
4062
  "type": "int",
4094
4063
  "allowed": "[1-9]\\d*",
4095
- "internalPropertyName": "otelMetricsExportTimeout",
4096
4064
  "default": "7500"
4097
4065
  }
4098
4066
  ],
4099
4067
  "OTEL_RESOURCE_ATTRIBUTES": [
4100
4068
  {
4101
- "implementation": "B",
4102
- "type": "string",
4069
+ "implementation": "A",
4070
+ "type": "map",
4103
4071
  "default": "",
4104
4072
  "transform": "parseOtelTags"
4105
4073
  }
@@ -4113,9 +4081,9 @@
4113
4081
  ],
4114
4082
  "OTEL_TRACES_EXPORTER": [
4115
4083
  {
4116
- "implementation": "F",
4084
+ "implementation": "H",
4117
4085
  "type": "string",
4118
- "default": "otlp",
4086
+ "default": null,
4119
4087
  "allowed": "none|otlp",
4120
4088
  "transform": "toLowerCase"
4121
4089
  }
@@ -5,6 +5,7 @@ module.exports = function getDebuggerConfig (config, inputPath) {
5
5
  commitSHA: config.commitSHA,
6
6
  debug: config.debug,
7
7
  dynamicInstrumentation: config.dynamicInstrumentation,
8
+ env: config.env,
8
9
  hostname: config.hostname,
9
10
  logLevel: config.logLevel,
10
11
  port: config.port,
@@ -13,6 +14,7 @@ module.exports = function getDebuggerConfig (config, inputPath) {
13
14
  runtimeId: config.tags['runtime-id'],
14
15
  service: config.service,
15
16
  url: config.url?.toString(),
17
+ version: config.version,
16
18
  inputPath,
17
19
  }
18
20
  }
@@ -6,7 +6,6 @@ const { stringify } = require('querystring')
6
6
  const { version } = require('../../../../../package.json')
7
7
  const request = require('../../exporters/common/request')
8
8
  const { GIT_COMMIT_SHA, GIT_REPOSITORY_URL } = require('../../plugins/util/tags')
9
- const { getValueFromEnvSources } = require('../../config/helper')
10
9
  const { DEBUGGER_DIAGNOSTICS_V1, DEBUGGER_INPUT_V2 } = require('../constants')
11
10
  const log = require('./log')
12
11
  const JSONBuffer = require('./json-buffer')
@@ -23,14 +22,14 @@ const ddsource = 'dd_debugger'
23
22
  const hostname = getHostname()
24
23
  const service = config.service
25
24
 
26
- const ddtags = [
27
- ['env', getValueFromEnvSources('DD_ENV')],
28
- ['version', getValueFromEnvSources('DD_VERSION')],
25
+ const ddtags = buildTags([
26
+ ['env', config.env],
27
+ ['version', config.version],
29
28
  ['debugger_version', version],
30
29
  ['host_name', hostname],
31
30
  [GIT_COMMIT_SHA, config.commitSHA],
32
31
  [GIT_REPOSITORY_URL, config.repositoryUrl],
33
- ].filter(([, value]) => value !== undefined).map((pair) => pair.join(':')).join(',')
32
+ ])
34
33
 
35
34
  let path
36
35
  setInputPath(config.inputPath)
@@ -136,3 +135,24 @@ function setInputPath (newPath) {
136
135
  config.inputPath = newPath
137
136
  path = `${newPath}?${stringify({ ddtags })}`
138
137
  }
138
+
139
+ /**
140
+ * @param {Array<[string, unknown]>} tags - The tags to serialize.
141
+ * @returns {string} The serialized tags.
142
+ */
143
+ function buildTags (tags) {
144
+ const serializedTags = []
145
+
146
+ for (const [key, rawValue] of tags) {
147
+ if (rawValue === undefined) continue
148
+
149
+ if (String(rawValue).includes(',')) {
150
+ log.warn('[debugger:devtools_client] Skipping invalid tag value for %s', key)
151
+ continue
152
+ }
153
+
154
+ serializedTags.push(`${key}:${rawValue}`)
155
+ }
156
+
157
+ return serializedTags.join(',')
158
+ }
@@ -266,6 +266,8 @@ class MetricsAggregationClient {
266
266
  this._captureTree(this._gauges, (node, name, tags) => {
267
267
  this._client.gauge(name, node.value, tags)
268
268
  })
269
+
270
+ this._gauges.clear()
269
271
  }
270
272
 
271
273
  _captureCounters () {
@@ -278,12 +280,7 @@ class MetricsAggregationClient {
278
280
 
279
281
  _captureHistograms () {
280
282
  this._captureTree(this._histograms, (node, name, tags) => {
281
- let stats = node.value
282
-
283
- // Stats can contain garbage data when a value was never recorded.
284
- if (stats.count === 0) {
285
- stats = { max: 0, min: 0, sum: 0, avg: 0, median: 0, p95: 0, count: 0 }
286
- }
283
+ const stats = node.value
287
284
 
288
285
  this._client.gauge(`${name}.min`, stats.min, tags)
289
286
  this._client.gauge(`${name}.max`, stats.max, tags)
@@ -293,9 +290,9 @@ class MetricsAggregationClient {
293
290
  this._client.increment(`${name}.count`, stats.count, tags)
294
291
  this._client.gauge(`${name}.median`, stats.median, tags)
295
292
  this._client.gauge(`${name}.95percentile`, stats.p95, tags)
296
-
297
- node.value.reset()
298
293
  })
294
+
295
+ this._histograms.clear()
299
296
  }
300
297
 
301
298
  _captureTree (tree, fn) {
@@ -1,9 +1,8 @@
1
1
  'use strict'
2
2
 
3
+ const getConfig = require('../config')
3
4
  const { MsgpackChunk, MsgpackEncoder } = require('../msgpack')
4
5
  const log = require('../log')
5
- const { isTrue } = require('../util')
6
- const { getValueFromEnvSources } = require('../config/helper')
7
6
  const { truncateSpan, normalizeSpan } = require('./tags-processors')
8
7
 
9
8
  const SOFT_LIMIT = 8 * 1024 * 1024 // 8MB
@@ -12,7 +11,7 @@ function formatSpan (span, config) {
12
11
  span = normalizeSpan(truncateSpan(span, false))
13
12
  if (span.span_events) {
14
13
  // ensure span events are encoded as tags if agent doesn't support native top level span events
15
- if (config?.trace?.nativeSpanEvents) {
14
+ if (config.trace.nativeSpanEvents) {
16
15
  formatSpanEvents(span)
17
16
  } else {
18
17
  span.meta.events = JSON.stringify(span.span_events)
@@ -30,8 +29,8 @@ class AgentEncoder {
30
29
  this._stringBytes = new MsgpackChunk()
31
30
  this._writer = writer
32
31
  this._reset()
33
- this._debugEncoding = isTrue(getValueFromEnvSources('DD_TRACE_ENCODING_DEBUG'))
34
- this._config = this._writer?._config
32
+ this._config = getConfig()
33
+ this._debugEncoding = this._config.DD_TRACE_ENCODING_DEBUG
35
34
  }
36
35
 
37
36
  count () {
@@ -29,7 +29,7 @@ module.exports = function getExporter (name) {
29
29
  fs.existsSync(constants.DATADOG_LAMBDA_EXTENSION_PATH) ||
30
30
  fs.existsSync(constants.DATADOG_MINI_AGENT_PATH)
31
31
  )
32
- return require(inAWSLambda && !usingAgent ? './exporters/log' : './exporters/agent')
32
+ return inAWSLambda && !usingAgent ? require('./exporters/log') : require('./exporters/agent')
33
33
  }
34
34
  }
35
35
  }
@@ -24,7 +24,6 @@ class AgentExporter {
24
24
  lookup,
25
25
  protocolVersion,
26
26
  headers,
27
- config,
28
27
  })
29
28
 
30
29
  globalThis[Symbol.for('dd-trace')].beforeExitHandlers.add(this.flush.bind(this))
@@ -20,14 +20,13 @@ class AgentWriter extends BaseWriter {
20
20
  ...args[0],
21
21
  beforeFirstFlush: () => firstFlushChannel.publish(),
22
22
  })
23
- const { prioritySampler, lookup, protocolVersion, headers, config = {} } = args[0]
23
+ const { prioritySampler, lookup, protocolVersion, headers } = args[0]
24
24
  const AgentEncoder = getEncoder(protocolVersion)
25
25
 
26
26
  this._prioritySampler = prioritySampler
27
27
  this._lookup = lookup
28
28
  this._protocolVersion = protocolVersion
29
29
  this._headers = headers
30
- this._config = config
31
30
  this._encoder = new AgentEncoder(this)
32
31
  }
33
32
 
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const { getValueFromEnvSources } = require('../../config/helper')
3
+ const getConfig = require('../../config')
4
4
  const log = require('../../log')
5
5
  const request = require('../common/request')
6
6
  const tracerVersion = require('../../../../../package.json').version
@@ -39,7 +39,7 @@ class AgentlessWriter extends BaseWriter {
39
39
  }
40
40
  }
41
41
 
42
- if (!getValueFromEnvSources('DD_API_KEY')) {
42
+ if (!getConfig().apiKey) {
43
43
  this.#apiKeyMissing = true
44
44
  log.error('DD_API_KEY is required for agentless trace intake. Set DD_API_KEY. Traces will not be sent.')
45
45
  }
@@ -108,7 +108,7 @@ class AgentlessWriter extends BaseWriter {
108
108
  return
109
109
  }
110
110
 
111
- const apiKey = getValueFromEnvSources('DD_API_KEY')
111
+ const apiKey = getConfig().apiKey
112
112
  if (!apiKey) {
113
113
  if (!this.#apiKeyMissing) {
114
114
  this.#apiKeyMissing = true
@@ -1,12 +1,12 @@
1
1
  'use strict'
2
2
 
3
- const { getValueFromEnvSources } = require('../../config/helper')
3
+ const getConfig = require('../../config')
4
4
 
5
5
  function safeJSONStringify (value) {
6
6
  return JSON.stringify(
7
7
  value,
8
8
  (key, value) => key === 'dd-api-key' ? undefined : value,
9
- getValueFromEnvSources('DD_TRACE_BEAUTIFUL_LOGS') ? 2 : undefined
9
+ getConfig().DD_TRACE_BEAUTIFUL_LOGS ? 2 : undefined
10
10
  )
11
11
  }
12
12
 
@@ -8,7 +8,7 @@ class GitMetadataTagger {
8
8
  }
9
9
 
10
10
  tagGitMetadata (spanContext) {
11
- if (this._config.gitMetadataEnabled) {
11
+ if (this._config.DD_TRACE_GIT_METADATA_ENABLED) {
12
12
  // These tags are added only to the local root span
13
13
  spanContext._trace.tags[SCI_COMMIT_SHA] = this._config.commitSHA
14
14
  spanContext._trace.tags[SCI_REPOSITORY_URL] = this._config.repositoryUrl
@@ -245,3 +245,5 @@ function writeUInt32BE (buffer, value, offset) {
245
245
  module.exports = function createIdentifier (value, radix) {
246
246
  return new Identifier(value ?? '', radix)
247
247
  }
248
+
249
+ module.exports.Identifier = Identifier
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  const { getValueFromEnvSources } = require('./config/helper')
4
- const { isFalse, isTrue } = require('./util')
4
+ const { isFalse } = require('./util')
5
5
 
6
6
  // Global `jest` is only present in Jest workers.
7
7
  const inJestWorker = typeof jest !== 'undefined'
@@ -9,10 +9,7 @@ const inJestWorker = typeof jest !== 'undefined'
9
9
  const ddTraceDisabled = getValueFromEnvSources('DD_TRACE_ENABLED')
10
10
  ? isFalse(getValueFromEnvSources('DD_TRACE_ENABLED'))
11
11
  : String(getValueFromEnvSources('OTEL_TRACES_EXPORTER')).toLowerCase() === 'none'
12
- const shouldUseProxyWhenTracingDisabled =
13
- isTrue(getValueFromEnvSources('DD_DYNAMIC_INSTRUMENTATION_ENABLED')) ||
14
- isTrue(getValueFromEnvSources('DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED'))
15
12
 
16
- module.exports = (ddTraceDisabled && !shouldUseProxyWhenTracingDisabled) || inJestWorker
13
+ module.exports = ddTraceDisabled || inJestWorker
17
14
  ? require('./noop/proxy')
18
15
  : require('./proxy')
@@ -3,7 +3,6 @@
3
3
  const log = require('../log')
4
4
  const { channel } = require('../../../datadog-instrumentations/src/helpers/instrument')
5
5
  const { ERROR_MESSAGE, ERROR_TYPE } = require('../constants')
6
- const { getValueFromEnvSources } = require('../config/helper')
7
6
  const { ImpendingTimeout } = require('./runtime/errors')
8
7
  const { extractContext } = require('./context')
9
8
 
@@ -27,8 +26,7 @@ let __lambdaTimeout
27
26
  function checkTimeout (context) {
28
27
  const remainingTimeInMillis = context.getRemainingTimeInMillis()
29
28
 
30
- let apmFlushDeadline = Number.parseInt(getValueFromEnvSources('DD_APM_FLUSH_DEADLINE_MILLISECONDS')) || 100
31
- apmFlushDeadline = apmFlushDeadline < 0 ? 100 : apmFlushDeadline
29
+ const apmFlushDeadline = tracer._config.DD_APM_FLUSH_DEADLINE_MILLISECONDS
32
30
 
33
31
  __lambdaTimeout = setTimeout(() => {
34
32
  timeoutChannel.publish()
@@ -16,6 +16,9 @@ module.exports = {
16
16
  NAME: '_ml_obs.name',
17
17
  TRACE_ID: '_ml_obs.trace_id',
18
18
  PROPAGATED_TRACE_ID_KEY: '_dd.p.llmobs_trace_id',
19
+ LLMOBS_TRACE_ID_BRIDGE_KEY: 'llmobs_trace_id',
20
+ LLMOBS_PARENT_ID_BRIDGE_KEY: 'llmobs_parent_id',
21
+ LLMOBS_SUBMITTED_TAG_KEY: '_dd.llmobs.submitted',
19
22
  ROOT_PARENT_ID: 'undefined',
20
23
  DEFAULT_PROMPT_NAME: 'unnamed-prompt',
21
24
  INTERNAL_CONTEXT_VARIABLE_KEYS: '_dd_context_variable_keys',