dd-trace 5.86.0 → 5.88.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.
Files changed (105) hide show
  1. package/LICENSE-3rdparty.csv +60 -32
  2. package/ext/exporters.d.ts +1 -0
  3. package/ext/exporters.js +1 -0
  4. package/index.d.ts +243 -7
  5. package/package.json +9 -6
  6. package/packages/datadog-instrumentations/src/ai.js +54 -90
  7. package/packages/datadog-instrumentations/src/cucumber.js +14 -0
  8. package/packages/datadog-instrumentations/src/helpers/hook.js +17 -11
  9. package/packages/datadog-instrumentations/src/helpers/hooks.js +1 -0
  10. package/packages/datadog-instrumentations/src/helpers/rewriter/compiler.js +55 -14
  11. package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +15 -13
  12. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/ai.js +103 -0
  13. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/bullmq.js +108 -0
  14. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +2 -1
  15. package/packages/datadog-instrumentations/src/helpers/rewriter/transformer.js +21 -0
  16. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +138 -12
  17. package/packages/datadog-instrumentations/src/http/client.js +119 -1
  18. package/packages/datadog-instrumentations/src/jest.js +179 -15
  19. package/packages/datadog-instrumentations/src/kafkajs.js +20 -17
  20. package/packages/datadog-instrumentations/src/mocha/utils.js +6 -0
  21. package/packages/datadog-instrumentations/src/mysql2.js +131 -64
  22. package/packages/datadog-instrumentations/src/playwright.js +9 -1
  23. package/packages/datadog-instrumentations/src/stripe.js +92 -0
  24. package/packages/datadog-instrumentations/src/vitest.js +11 -0
  25. package/packages/datadog-plugin-amqplib/src/consumer.js +14 -10
  26. package/packages/datadog-plugin-amqplib/src/producer.js +23 -19
  27. package/packages/datadog-plugin-azure-functions/src/index.js +53 -37
  28. package/packages/datadog-plugin-bullmq/src/consumer.js +33 -11
  29. package/packages/datadog-plugin-bullmq/src/producer.js +60 -31
  30. package/packages/datadog-plugin-cucumber/src/index.js +9 -6
  31. package/packages/datadog-plugin-cypress/src/cypress-plugin.js +33 -0
  32. package/packages/datadog-plugin-cypress/src/support.js +48 -8
  33. package/packages/datadog-plugin-jest/src/index.js +12 -2
  34. package/packages/datadog-plugin-jest/src/util.js +2 -1
  35. package/packages/datadog-plugin-kafkajs/src/consumer.js +22 -12
  36. package/packages/datadog-plugin-kafkajs/src/producer.js +33 -22
  37. package/packages/datadog-plugin-mocha/src/index.js +9 -6
  38. package/packages/datadog-plugin-playwright/src/index.js +10 -6
  39. package/packages/datadog-plugin-vitest/src/index.js +13 -8
  40. package/packages/dd-trace/src/appsec/addresses.js +11 -0
  41. package/packages/dd-trace/src/appsec/channels.js +5 -1
  42. package/packages/dd-trace/src/appsec/downstream_requests.js +302 -0
  43. package/packages/dd-trace/src/appsec/iast/analyzers/cookie-analyzer.js +1 -1
  44. package/packages/dd-trace/src/appsec/iast/analyzers/ssrf-analyzer.js +1 -1
  45. package/packages/dd-trace/src/appsec/iast/analyzers/unvalidated-redirect-analyzer.js +1 -1
  46. package/packages/dd-trace/src/appsec/iast/analyzers/vulnerability-analyzer.js +4 -5
  47. package/packages/dd-trace/src/appsec/iast/path-line.js +36 -25
  48. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/command-sensitive-analyzer.js +1 -1
  49. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +3 -4
  50. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +3 -2
  51. package/packages/dd-trace/src/appsec/index.js +103 -0
  52. package/packages/dd-trace/src/appsec/rasp/ssrf.js +66 -4
  53. package/packages/dd-trace/src/azure_metadata.js +0 -2
  54. package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +14 -1
  55. package/packages/dd-trace/src/ci-visibility/early-flake-detection/get-known-tests.js +1 -1
  56. package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +2 -0
  57. package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +1 -1
  58. package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +4 -1
  59. package/packages/dd-trace/src/ci-visibility/requests/request.js +236 -0
  60. package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +1 -1
  61. package/packages/dd-trace/src/config/defaults.js +148 -195
  62. package/packages/dd-trace/src/config/helper.js +43 -1
  63. package/packages/dd-trace/src/config/index.js +42 -14
  64. package/packages/dd-trace/src/config/supported-configurations.json +4115 -510
  65. package/packages/dd-trace/src/constants.js +0 -2
  66. package/packages/dd-trace/src/crashtracking/crashtracker.js +10 -3
  67. package/packages/dd-trace/src/datastreams/pathway.js +22 -3
  68. package/packages/dd-trace/src/datastreams/processor.js +14 -1
  69. package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +47 -2
  70. package/packages/dd-trace/src/debugger/devtools_client/index.js +75 -23
  71. package/packages/dd-trace/src/debugger/devtools_client/remote_config.js +23 -1
  72. package/packages/dd-trace/src/debugger/devtools_client/snapshot/collector.js +3 -3
  73. package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +168 -36
  74. package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +18 -0
  75. package/packages/dd-trace/src/encode/agentless-json.js +141 -0
  76. package/packages/dd-trace/src/exporter.js +2 -0
  77. package/packages/dd-trace/src/exporters/agent/writer.js +22 -8
  78. package/packages/dd-trace/src/exporters/agentless/index.js +89 -0
  79. package/packages/dd-trace/src/exporters/agentless/writer.js +184 -0
  80. package/packages/dd-trace/src/exporters/common/agents.js +1 -1
  81. package/packages/dd-trace/src/exporters/common/request.js +4 -4
  82. package/packages/dd-trace/src/llmobs/constants/writers.js +1 -1
  83. package/packages/dd-trace/src/llmobs/plugins/ai/index.js +5 -3
  84. package/packages/dd-trace/src/llmobs/sdk.js +34 -5
  85. package/packages/dd-trace/src/opentelemetry/context_manager.js +19 -46
  86. package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +3 -4
  87. package/packages/dd-trace/src/opentracing/propagation/text_map.js +3 -5
  88. package/packages/dd-trace/src/opentracing/span.js +6 -4
  89. package/packages/dd-trace/src/plugins/ci_plugin.js +57 -5
  90. package/packages/dd-trace/src/plugins/database.js +57 -45
  91. package/packages/dd-trace/src/plugins/outbound.js +27 -2
  92. package/packages/dd-trace/src/plugins/tracing.js +39 -4
  93. package/packages/dd-trace/src/plugins/util/inferred_proxy.js +7 -0
  94. package/packages/dd-trace/src/plugins/util/test.js +48 -0
  95. package/packages/dd-trace/src/plugins/util/web.js +8 -7
  96. package/packages/dd-trace/src/profiling/exporter_cli.js +1 -0
  97. package/packages/dd-trace/src/propagation-hash/index.js +145 -0
  98. package/packages/dd-trace/src/proxy.js +4 -0
  99. package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +1 -1
  100. package/packages/dd-trace/src/startup-log.js +3 -3
  101. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/bullmq.json +0 -106
  102. package/packages/dd-trace/src/appsec/iast/analyzers/hardcoded-secrets-rules.js +0 -741
  103. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-regex.js +0 -11
  104. package/packages/dd-trace/src/plugins/util/serverless.js +0 -8
  105. package/packages/dd-trace/src/scope/noop/scope.js +0 -21
package/index.d.ts CHANGED
@@ -150,6 +150,7 @@ interface Tracer extends opentracing.Tracer {
150
150
  * Extends DatadogNodeServerProvider with Remote Config integration for dynamic flag configuration.
151
151
  * Enable with DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true.
152
152
  *
153
+ * @env DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED
153
154
  * @beta This feature is in preview and not ready for production use
154
155
  */
155
156
  openfeature: tracer.OpenFeatureProvider;
@@ -469,6 +470,8 @@ declare namespace tracer {
469
470
  /**
470
471
  * Used to disable APM Tracing when using standalone products
471
472
  * @default true
473
+ * @env DD_APM_TRACING_ENABLED
474
+ * Programmatic configuration takes precedence over the environment variables listed above.
472
475
  */
473
476
  apmTracingEnabled?: boolean
474
477
 
@@ -476,46 +479,62 @@ declare namespace tracer {
476
479
  * Whether to enable trace ID injection in log records to be able to correlate
477
480
  * traces with logs.
478
481
  * @default false
482
+ * @env DD_LOGS_INJECTION
483
+ * Programmatic configuration takes precedence over the environment variables listed above.
479
484
  */
480
485
  logInjection?: boolean,
481
486
 
482
487
  /**
483
488
  * Whether to enable startup logs.
484
- * @default true
489
+ * @default false
490
+ * @env DD_TRACE_STARTUP_LOGS
491
+ * Programmatic configuration takes precedence over the environment variables listed above.
485
492
  */
486
493
  startupLogs?: boolean,
487
494
 
488
495
  /**
489
496
  * The service name to be used for this program. If not set, the service name
490
497
  * will attempted to be inferred from package.json
498
+ * @env DD_SERVICE, OTEL_SERVICE_NAME
499
+ * Programmatic configuration takes precedence over the environment variables listed above.
491
500
  */
492
501
  service?: string;
493
502
 
494
503
  /**
495
504
  * Provide service name mappings for each plugin.
505
+ * @env DD_SERVICE_MAPPING
506
+ * Programmatic configuration takes precedence over the environment variables listed above.
496
507
  */
497
508
  serviceMapping?: { [key: string]: string };
498
509
 
499
510
  /**
500
511
  * The url of the trace agent that the tracer will submit to.
501
512
  * Takes priority over hostname and port, if set.
513
+ * @env DD_TRACE_AGENT_URL
514
+ * Programmatic configuration takes precedence over the environment variables listed above.
502
515
  */
503
516
  url?: string;
504
517
 
505
518
  /**
506
519
  * The address of the trace agent that the tracer will submit to.
507
520
  * @default '127.0.0.1'
521
+ * @env DD_AGENT_HOST
522
+ * Programmatic configuration takes precedence over the environment variables listed above.
508
523
  */
509
524
  hostname?: string;
510
525
 
511
526
  /**
512
527
  * The port of the trace agent that the tracer will submit to.
513
528
  * @default 8126
529
+ * @env DD_TRACE_AGENT_PORT
530
+ * Programmatic configuration takes precedence over the environment variables listed above.
514
531
  */
515
532
  port?: number | string;
516
533
 
517
534
  /**
518
535
  * Whether to enable profiling.
536
+ * @env DD_PROFILING_ENABLED
537
+ * Programmatic configuration takes precedence over the environment variables listed above.
519
538
  */
520
539
  profiling?: boolean
521
540
 
@@ -525,29 +544,39 @@ declare namespace tracer {
525
544
  dogstatsd?: {
526
545
  /**
527
546
  * The hostname of the Dogstatsd agent that the metrics will submitted to.
547
+ * @env DD_DOGSTATSD_HOST
548
+ * Programmatic configuration takes precedence over the environment variables listed above.
528
549
  */
529
550
  hostname?: string
530
551
 
531
552
  /**
532
553
  * The port of the Dogstatsd agent that the metrics will submitted to.
533
554
  * @default 8125
555
+ * @env DD_DOGSTATSD_PORT
556
+ * Programmatic configuration takes precedence over the environment variables listed above.
534
557
  */
535
558
  port?: number
536
559
  };
537
560
 
538
561
  /**
539
562
  * Set an application’s environment e.g. prod, pre-prod, stage.
563
+ * @env DD_ENV
564
+ * Programmatic configuration takes precedence over the environment variables listed above.
540
565
  */
541
566
  env?: string;
542
567
 
543
568
  /**
544
569
  * The version number of the application. If not set, the version
545
570
  * will attempted to be inferred from package.json.
571
+ * @env DD_VERSION
572
+ * Programmatic configuration takes precedence over the environment variables listed above.
546
573
  */
547
574
  version?: string;
548
575
 
549
576
  /**
550
577
  * Controls the ingestion sample rate (between 0 and 1) between the agent and the backend.
578
+ * @env DD_TRACE_SAMPLE_RATE, OTEL_TRACES_SAMPLER, OTEL_TRACES_SAMPLER_ARG
579
+ * Programmatic configuration takes precedence over the environment variables listed above.
551
580
  */
552
581
  sampleRate?: number;
553
582
 
@@ -555,6 +584,8 @@ declare namespace tracer {
555
584
  * Global rate limit that is applied on the global sample rate and all rules,
556
585
  * and controls the ingestion rate limit between the agent and the backend.
557
586
  * Defaults to deferring the decision to the agent.
587
+ * @env DD_TRACE_RATE_LIMIT
588
+ * Programmatic configuration takes precedence over the environment variables listed above.
558
589
  */
559
590
  rateLimit?: number,
560
591
 
@@ -564,24 +595,32 @@ declare namespace tracer {
564
595
  * a trace's `service` and `name`, and a corresponding `sampleRate`. If not
565
596
  * specified, will defer to global sampling rate for all spans.
566
597
  * @default []
598
+ * @env DD_TRACE_SAMPLING_RULES
599
+ * Programmatic configuration takes precedence over the environment variables listed above.
567
600
  */
568
601
  samplingRules?: SamplingRule[]
569
602
 
570
603
  /**
571
604
  * Span sampling rules that take effect when the enclosing trace is dropped, to ingest single spans
572
605
  * @default []
606
+ * @env DD_SPAN_SAMPLING_RULES, DD_SPAN_SAMPLING_RULES_FILE
607
+ * Programmatic configuration takes precedence over the environment variables listed above.
573
608
  */
574
609
  spanSamplingRules?: SpanSamplingRule[]
575
610
 
576
611
  /**
577
612
  * Interval in milliseconds at which the tracer will submit traces to the agent.
578
613
  * @default 2000
614
+ * @env DD_TRACE_FLUSH_INTERVAL
615
+ * Programmatic configuration takes precedence over the environment variables listed above.
579
616
  */
580
617
  flushInterval?: number;
581
618
 
582
619
  /**
583
620
  * Number of spans before partially exporting a trace. This prevents keeping all the spans in memory for very large traces.
584
621
  * @default 1000
622
+ * @env DD_TRACE_PARTIAL_FLUSH_MIN_SPANS
623
+ * Programmatic configuration takes precedence over the environment variables listed above.
585
624
  */
586
625
  flushMinSpans?: number;
587
626
 
@@ -590,14 +629,31 @@ declare namespace tracer {
590
629
  * @default false
591
630
  */
592
631
  runtimeMetrics?: boolean | {
632
+
633
+ /**
634
+ * @env DD_RUNTIME_METRICS_ENABLED
635
+ * Programmatic configuration takes precedence over the environment variables listed above.
636
+ */
593
637
  enabled?: boolean,
638
+
639
+ /**
640
+ * @env DD_RUNTIME_METRICS_GC_ENABLED
641
+ * Programmatic configuration takes precedence over the environment variables listed above.
642
+ */
594
643
  gc?: boolean,
644
+
645
+ /**
646
+ * @env DD_RUNTIME_METRICS_EVENT_LOOP_ENABLED
647
+ * Programmatic configuration takes precedence over the environment variables listed above.
648
+ */
595
649
  eventLoop?: boolean
596
650
  }
597
651
 
598
652
  /**
599
653
  * Whether to add an auto-generated `runtime-id` tag to metrics.
600
654
  * @default false
655
+ * @env DD_RUNTIME_METRICS_RUNTIME_ID_ENABLED
656
+ * Programmatic configuration takes precedence over the environment variables listed above.
601
657
  */
602
658
  runtimeMetricsRuntimeId?: boolean
603
659
 
@@ -610,6 +666,8 @@ declare namespace tracer {
610
666
  /**
611
667
  * Protocol version to use for requests to the agent. The version configured must be supported by the agent version installed or all traces will be dropped.
612
668
  * @default 0.4
669
+ * @env DD_TRACE_AGENT_PROTOCOL_VERSION
670
+ * Programmatic configuration takes precedence over the environment variables listed above.
613
671
  */
614
672
  protocolVersion?: string
615
673
 
@@ -622,11 +680,15 @@ declare namespace tracer {
622
680
  ingestion?: {
623
681
  /**
624
682
  * Controls the ingestion sample rate (between 0 and 1) between the agent and the backend.
683
+ * @env DD_TRACE_SAMPLE_RATE, OTEL_TRACES_SAMPLER, OTEL_TRACES_SAMPLER_ARG
684
+ * Programmatic configuration takes precedence over the environment variables listed above.
625
685
  */
626
686
  sampleRate?: number
627
687
 
628
688
  /**
629
689
  * Controls the ingestion rate limit between the agent and the backend. Defaults to deferring the decision to the agent.
690
+ * @env DD_TRACE_RATE_LIMIT
691
+ * Programmatic configuration takes precedence over the environment variables listed above.
630
692
  */
631
693
  rateLimit?: number
632
694
  };
@@ -636,17 +698,26 @@ declare namespace tracer {
636
698
  * @default {}
637
699
  */
638
700
  experimental?: {
701
+
702
+ /**
703
+ * @default false
704
+ * @env DD_TRACE_EXPERIMENTAL_B3_ENABLED
705
+ * Programmatic configuration takes precedence over the environment variables listed above.
706
+ */
639
707
  b3?: boolean
640
708
 
641
709
  /**
642
710
  * Whether to write traces to log output or agentless, rather than send to an agent
643
- * @default false
711
+ * @env DD_TRACE_EXPERIMENTAL_EXPORTER
712
+ * Programmatic configuration takes precedence over the environment variables listed above.
644
713
  */
645
714
  exporter?: 'log' | 'agent' | 'datadog'
646
715
 
647
716
  /**
648
717
  * Whether to enable the experimental `getRumData` method.
649
718
  * @default false
719
+ * @env DD_TRACE_EXPERIMENTAL_GET_RUM_DATA_ENABLED
720
+ * Programmatic configuration takes precedence over the environment variables listed above.
650
721
  */
651
722
  enableGetRumData?: boolean
652
723
 
@@ -674,22 +745,32 @@ declare namespace tracer {
674
745
  aiguard?: {
675
746
  /**
676
747
  * Set to `true` to enable the SDK.
748
+ * @env DD_AI_GUARD_ENABLED
749
+ * Programmatic configuration takes precedence over the environment variables listed above.
677
750
  */
678
751
  enabled?: boolean,
679
752
  /**
680
753
  * URL of the AI Guard REST API.
754
+ * @env DD_AI_GUARD_ENDPOINT
755
+ * Programmatic configuration takes precedence over the environment variables listed above.
681
756
  */
682
757
  endpoint?: string,
683
758
  /**
684
759
  * Timeout used in calls to the AI Guard REST API in milliseconds (default 5000)
760
+ * @env DD_AI_GUARD_TIMEOUT
761
+ * Programmatic configuration takes precedence over the environment variables listed above.
685
762
  */
686
763
  timeout?: number,
687
764
  /**
688
765
  * Maximum number of conversational messages allowed to be set in the meta-struct
766
+ * @env DD_AI_GUARD_MAX_MESSAGES_LENGTH
767
+ * Programmatic configuration takes precedence over the environment variables listed above.
689
768
  */
690
769
  maxMessagesLength?: number,
691
770
  /**
692
771
  * Max size of the content property set in the meta-struct
772
+ * @env DD_AI_GUARD_MAX_CONTENT_SIZE
773
+ * Programmatic configuration takes precedence over the environment variables listed above.
693
774
  */
694
775
  maxContentSize?: number
695
776
  }
@@ -706,6 +787,8 @@ declare namespace tracer {
706
787
  * Can be configured via DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED environment variable.
707
788
  *
708
789
  * @default false
790
+ * @env DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED
791
+ * Programmatic configuration takes precedence over the environment variables listed above.
709
792
  */
710
793
  enabled?: boolean
711
794
  /**
@@ -714,6 +797,8 @@ declare namespace tracer {
714
797
  * Can be configured via DD_EXPERIMENTAL_FLAGGING_PROVIDER_INITIALIZATION_TIMEOUT_MS environment variable.
715
798
  *
716
799
  * @default 30000
800
+ * @env DD_EXPERIMENTAL_FLAGGING_PROVIDER_INITIALIZATION_TIMEOUT_MS
801
+ * Programmatic configuration takes precedence over the environment variables listed above.
717
802
  */
718
803
  initializationTimeoutMs?: number
719
804
  }
@@ -739,24 +824,32 @@ declare namespace tracer {
739
824
 
740
825
  /**
741
826
  * Global tags that should be assigned to every span.
827
+ * @env DD_TAGS, OTEL_RESOURCE_ATTRIBUTES
828
+ * Programmatic configuration takes precedence over the environment variables listed above.
742
829
  */
743
830
  tags?: { [key: string]: any };
744
831
 
745
832
  /**
746
833
  * Whether to report the hostname of the service host. This is used when the agent is deployed on a different host and cannot determine the hostname automatically.
747
834
  * @default false
835
+ * @env DD_TRACE_REPORT_HOSTNAME
836
+ * Programmatic configuration takes precedence over the environment variables listed above.
748
837
  */
749
838
  reportHostname?: boolean
750
839
 
751
840
  /**
752
841
  * A string representing the minimum tracer log level to use when debug logging is enabled
753
842
  * @default 'debug'
843
+ * @env DD_TRACE_LOG_LEVEL, OTEL_LOG_LEVEL
844
+ * Programmatic configuration takes precedence over the environment variables listed above.
754
845
  */
755
- logLevel?: 'error' | 'debug'
846
+ logLevel?: 'debug' | 'info' | 'warn' | 'error'
756
847
 
757
848
  /**
758
849
  * Enables DBM to APM link using tag injection.
759
850
  * @default 'disabled'
851
+ * @env DD_DBM_PROPAGATION_MODE
852
+ * Programmatic configuration takes precedence over the environment variables listed above.
760
853
  */
761
854
  dbmPropagationMode?: 'disabled' | 'service' | 'full'
762
855
 
@@ -765,9 +858,26 @@ declare namespace tracer {
765
858
  * Can also be enabled via the DD_DATA_STREAMS_ENABLED environment variable.
766
859
  * When not provided, the value of DD_DATA_STREAMS_ENABLED is used.
767
860
  * @default false
861
+ * @env DD_DATA_STREAMS_ENABLED
862
+ * Programmatic configuration takes precedence over the environment variables listed above.
768
863
  */
769
864
  dsmEnabled?: boolean
770
865
 
866
+ /**
867
+ * Configuration for Database Monitoring (DBM).
868
+ */
869
+ dbm?: {
870
+ /**
871
+ * Controls whether to inject the SQL base hash (propagation hash) in DBM SQL comments.
872
+ * This option requires DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED=true to take effect.
873
+ * The propagation hash enables correlation between traces and database operations.
874
+ * @default false
875
+ * @env DD_DBM_INJECT_SQL_BASEHASH
876
+ * Programmatic configuration takes precedence over the environment variables listed above.
877
+ */
878
+ injectSqlBaseHash?: boolean
879
+ }
880
+
771
881
  /**
772
882
  * Configuration of the AppSec protection. Can be a boolean as an alias to `appsec.enabled`.
773
883
  */
@@ -775,48 +885,66 @@ declare namespace tracer {
775
885
  /**
776
886
  * Whether to enable AppSec.
777
887
  * @default false
888
+ * @env DD_APPSEC_ENABLED
889
+ * Programmatic configuration takes precedence over the environment variables listed above.
778
890
  */
779
891
  enabled?: boolean,
780
892
 
781
893
  /**
782
894
  * Specifies a path to a custom rules file.
895
+ * @env DD_APPSEC_RULES
896
+ * Programmatic configuration takes precedence over the environment variables listed above.
783
897
  */
784
898
  rules?: string,
785
899
 
786
900
  /**
787
901
  * Controls the maximum amount of traces sampled by AppSec attacks, per second.
788
902
  * @default 100
903
+ * @env DD_APPSEC_TRACE_RATE_LIMIT
904
+ * Programmatic configuration takes precedence over the environment variables listed above.
789
905
  */
790
906
  rateLimit?: number,
791
907
 
792
908
  /**
793
909
  * Controls the maximum amount of time in microseconds the WAF is allowed to run synchronously for.
794
910
  * @default 5000
911
+ * @env DD_APPSEC_WAF_TIMEOUT
912
+ * Programmatic configuration takes precedence over the environment variables listed above.
795
913
  */
796
914
  wafTimeout?: number,
797
915
 
798
916
  /**
799
917
  * Specifies a regex that will redact sensitive data by its key in attack reports.
918
+ * @env DD_APPSEC_OBFUSCATION_PARAMETER_KEY_REGEXP
919
+ * Programmatic configuration takes precedence over the environment variables listed above.
800
920
  */
801
921
  obfuscatorKeyRegex?: string,
802
922
 
803
923
  /**
804
924
  * Specifies a regex that will redact sensitive data by its value in attack reports.
925
+ * @env DD_APPSEC_OBFUSCATION_PARAMETER_VALUE_REGEXP
926
+ * Programmatic configuration takes precedence over the environment variables listed above.
805
927
  */
806
928
  obfuscatorValueRegex?: string,
807
929
 
808
930
  /**
809
931
  * Specifies a path to a custom blocking template html file.
932
+ * @env DD_APPSEC_HTTP_BLOCKED_TEMPLATE_HTML
933
+ * Programmatic configuration takes precedence over the environment variables listed above.
810
934
  */
811
935
  blockedTemplateHtml?: string,
812
936
 
813
937
  /**
814
938
  * Specifies a path to a custom blocking template json file.
939
+ * @env DD_APPSEC_HTTP_BLOCKED_TEMPLATE_JSON
940
+ * Programmatic configuration takes precedence over the environment variables listed above.
815
941
  */
816
942
  blockedTemplateJson?: string,
817
943
 
818
944
  /**
819
945
  * Specifies a path to a custom blocking template json file for graphql requests
946
+ * @env DD_APPSEC_GRAPHQL_BLOCKED_TEMPLATE_JSON
947
+ * Programmatic configuration takes precedence over the environment variables listed above.
820
948
  */
821
949
  blockedTemplateGraphql?: string,
822
950
 
@@ -838,6 +966,8 @@ declare namespace tracer {
838
966
  *
839
967
  * Unknown values will be considered as 'disabled'
840
968
  * @default 'identification'
969
+ * @env DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE
970
+ * Programmatic configuration takes precedence over the environment variables listed above.
841
971
  */
842
972
  mode?:
843
973
  'anonymous' | 'anon' | 'safe' |
@@ -850,16 +980,22 @@ declare namespace tracer {
850
980
  apiSecurity?: {
851
981
  /** Whether to enable Api Security.
852
982
  * @default true
983
+ * @env DD_API_SECURITY_ENABLED
984
+ * Programmatic configuration takes precedence over the environment variables listed above.
853
985
  */
854
986
  enabled?: boolean,
855
987
 
856
988
  /** Whether to enable endpoint collection for API Security.
857
989
  * @default true
990
+ * @env DD_API_SECURITY_ENDPOINT_COLLECTION_ENABLED
991
+ * Programmatic configuration takes precedence over the environment variables listed above.
858
992
  */
859
993
  endpointCollectionEnabled?: boolean,
860
994
 
861
995
  /** Maximum number of endpoints that can be serialized per message.
862
996
  * @default 300
997
+ * @env DD_API_SECURITY_ENDPOINT_COLLECTION_MESSAGE_LIMIT
998
+ * Programmatic configuration takes precedence over the environment variables listed above.
863
999
  */
864
1000
  endpointCollectionMessageLimit?: number,
865
1001
  },
@@ -869,6 +1005,8 @@ declare namespace tracer {
869
1005
  rasp?: {
870
1006
  /** Whether to enable RASP.
871
1007
  * @default false
1008
+ * @env DD_APPSEC_RASP_ENABLED
1009
+ * Programmatic configuration takes precedence over the environment variables listed above.
872
1010
  */
873
1011
  enabled?: boolean,
874
1012
 
@@ -876,6 +1014,8 @@ declare namespace tracer {
876
1014
  * @default false
877
1015
  *
878
1016
  * @deprecated Use UI and Remote Configuration to enable extended data collection
1017
+ * @env DD_APPSEC_RASP_COLLECT_REQUEST_BODY
1018
+ * Programmatic configuration takes precedence over the environment variables listed above.
879
1019
  */
880
1020
  bodyCollection?: boolean
881
1021
  },
@@ -885,16 +1025,22 @@ declare namespace tracer {
885
1025
  stackTrace?: {
886
1026
  /** Whether to enable stack trace reporting.
887
1027
  * @default true
1028
+ * @env DD_APPSEC_STACK_TRACE_ENABLED
1029
+ * Programmatic configuration takes precedence over the environment variables listed above.
888
1030
  */
889
1031
  enabled?: boolean,
890
1032
 
891
1033
  /** Specifies the maximum number of stack traces to be reported.
892
1034
  * @default 2
1035
+ * @env DD_APPSEC_MAX_STACK_TRACES
1036
+ * Programmatic configuration takes precedence over the environment variables listed above.
893
1037
  */
894
1038
  maxStackTraces?: number,
895
1039
 
896
1040
  /** Specifies the maximum depth of a stack trace to be reported.
897
1041
  * @default 32
1042
+ * @env DD_APPSEC_MAX_STACK_TRACE_DEPTH
1043
+ * Programmatic configuration takes precedence over the environment variables listed above.
898
1044
  */
899
1045
  maxDepth?: number,
900
1046
  },
@@ -908,6 +1054,8 @@ declare namespace tracer {
908
1054
  * @default false
909
1055
  *
910
1056
  * @deprecated Use UI and Remote Configuration to enable extended data collection
1057
+ * @env DD_APPSEC_COLLECT_ALL_HEADERS
1058
+ * Programmatic configuration takes precedence over the environment variables listed above.
911
1059
  */
912
1060
  enabled: boolean,
913
1061
 
@@ -915,6 +1063,8 @@ declare namespace tracer {
915
1063
  * @default true
916
1064
  *
917
1065
  * @deprecated Use UI and Remote Configuration to enable extended data collection
1066
+ * @env DD_APPSEC_HEADER_COLLECTION_REDACTION_ENABLED
1067
+ * Programmatic configuration takes precedence over the environment variables listed above.
918
1068
  */
919
1069
  redaction: boolean,
920
1070
 
@@ -922,6 +1072,8 @@ declare namespace tracer {
922
1072
  * @default 50
923
1073
  *
924
1074
  * @deprecated Use UI and Remote Configuration to enable extended data collection
1075
+ * @env DD_APPSEC_MAX_COLLECTED_HEADERS
1076
+ * Programmatic configuration takes precedence over the environment variables listed above.
925
1077
  */
926
1078
  maxHeaders: number,
927
1079
  }
@@ -934,6 +1086,8 @@ declare namespace tracer {
934
1086
  /**
935
1087
  * Whether to enable Code Origin for Spans.
936
1088
  * @default true
1089
+ * @env DD_CODE_ORIGIN_FOR_SPANS_ENABLED
1090
+ * Programmatic configuration takes precedence over the environment variables listed above.
937
1091
  */
938
1092
  enabled?: boolean
939
1093
  }
@@ -950,6 +1104,8 @@ declare namespace tracer {
950
1104
  /**
951
1105
  * Specifies the remote configuration polling interval in seconds
952
1106
  * @default 5
1107
+ * @env DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS
1108
+ * Programmatic configuration takes precedence over the environment variables listed above.
953
1109
  */
954
1110
  pollInterval?: number,
955
1111
  }
@@ -957,16 +1113,23 @@ declare namespace tracer {
957
1113
  /**
958
1114
  * Whether to enable client IP collection from relevant IP headers
959
1115
  * @default false
1116
+ * @env DD_TRACE_CLIENT_IP_ENABLED
1117
+ * Programmatic configuration takes precedence over the environment variables listed above.
960
1118
  */
961
1119
  clientIpEnabled?: boolean
962
1120
 
963
1121
  /**
964
1122
  * Custom header name to source the http.client_ip tag from.
1123
+ * @env DD_TRACE_CLIENT_IP_HEADER
1124
+ * Programmatic configuration takes precedence over the environment variables listed above.
965
1125
  */
966
1126
  clientIpHeader?: string,
967
1127
 
968
1128
  /**
969
1129
  * The selection and priority order of context propagation injection and extraction mechanisms.
1130
+ * @env DD_TRACE_PROPAGATION_STYLE, DD_TRACE_PROPAGATION_STYLE_INJECT, DD_TRACE_PROPAGATION_STYLE_EXTRACT
1131
+ * Also configurable via OTEL_PROPAGATORS when DD-specific propagation vars are not set.
1132
+ * Programmatic configuration takes precedence over the environment variables listed above.
970
1133
  */
971
1134
  tracePropagationStyle?: string[] | PropagationStyle
972
1135
 
@@ -977,21 +1140,29 @@ declare namespace tracer {
977
1140
  /**
978
1141
  * Additional JSONPath queries to replace with `redacted` in request payloads
979
1142
  * Undefined or invalid JSONPath queries disable the feature for requests.
1143
+ * @env DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING
1144
+ * Programmatic configuration takes precedence over the environment variables listed above.
980
1145
  */
981
1146
  request?: string,
982
1147
  /**
983
1148
  * Additional JSONPath queries to replace with `redacted` in response payloads
984
1149
  * Undefined or invalid JSONPath queries disable the feature for responses.
1150
+ * @env DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING
1151
+ * Programmatic configuration takes precedence over the environment variables listed above.
985
1152
  */
986
1153
  response?: string,
987
1154
  /**
988
1155
  * Maximum depth of payload traversal for tags
1156
+ * @env DD_TRACE_CLOUD_PAYLOAD_TAGGING_MAX_DEPTH
1157
+ * Programmatic configuration takes precedence over the environment variables listed above.
989
1158
  */
990
1159
  maxDepth?: number
991
1160
  }
992
1161
 
993
1162
  /**
994
1163
  * Configuration enabling LLM Observability. Enablement is superseded by the DD_LLMOBS_ENABLED environment variable.
1164
+ * @env DD_LLMOBS_ENABLED
1165
+ * The environment variable listed above takes precedence over programmatic configuration.
995
1166
  */
996
1167
  llmobs?: llmobs.LLMObsEnableOptions
997
1168
 
@@ -1002,35 +1173,54 @@ declare namespace tracer {
1002
1173
  /**
1003
1174
  * Whether to enable Dynamic Instrumentation.
1004
1175
  * @default false
1176
+ * @env DD_DYNAMIC_INSTRUMENTATION_ENABLED
1177
+ * Programmatic configuration takes precedence over the environment variables listed above.
1005
1178
  */
1006
1179
  enabled?: boolean
1007
1180
 
1008
1181
  /**
1009
1182
  * Path to a custom probes configuration file.
1183
+ * @env DD_DYNAMIC_INSTRUMENTATION_PROBE_FILE
1184
+ * Programmatic configuration takes precedence over the environment variables listed above.
1010
1185
  */
1011
1186
  probeFile?: string
1012
1187
 
1013
1188
  /**
1014
1189
  * Timeout in milliseconds for capturing variable values.
1015
- * @default 100
1190
+ * @default 15
1191
+ * @env DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT_MS
1192
+ * Programmatic configuration takes precedence over the environment variables listed above.
1016
1193
  */
1017
1194
  captureTimeoutMs?: number
1018
1195
 
1019
1196
  /**
1020
1197
  * Interval in seconds between uploads of probe data.
1021
1198
  * @default 1
1199
+ * @env DD_DYNAMIC_INSTRUMENTATION_UPLOAD_INTERVAL_SECONDS
1200
+ * Programmatic configuration takes precedence over the environment variables listed above.
1022
1201
  */
1023
1202
  uploadIntervalSeconds?: number
1024
1203
 
1025
1204
  /**
1026
1205
  * List of identifier names to redact in captured data.
1206
+ * These are added to the built-in default list, which always applies.
1207
+ * See {@link https://github.com/DataDog/dd-trace-js/blob/master/packages/dd-trace/src/debugger/devtools_client/snapshot/redaction.js | redaction.js}
1208
+ * for the default identifiers.
1209
+ * To avoid redacting some of those built-in identifiers, use
1210
+ * {@link redactionExcludedIdentifiers}.
1027
1211
  * @default []
1212
+ * @env DD_DYNAMIC_INSTRUMENTATION_REDACTED_IDENTIFIERS
1213
+ * Programmatic configuration takes precedence over the environment variables listed above.
1028
1214
  */
1029
1215
  redactedIdentifiers?: string[]
1030
1216
 
1031
1217
  /**
1032
1218
  * List of identifier names to exclude from redaction.
1219
+ * Use this to avoid redacting some of the built-in identifiers (see
1220
+ * {@link redactedIdentifiers}).
1033
1221
  * @default []
1222
+ * @env DD_DYNAMIC_INSTRUMENTATION_REDACTION_EXCLUDED_IDENTIFIERS
1223
+ * Programmatic configuration takes precedence over the environment variables listed above.
1034
1224
  */
1035
1225
  redactionExcludedIdentifiers?: string[]
1036
1226
  }
@@ -2465,6 +2655,7 @@ declare namespace tracer {
2465
2655
  * [openai](https://platform.openai.com/docs/api-reference?lang=node.js) module.
2466
2656
  *
2467
2657
  * Note that for logs to work you'll need to set the `DD_API_KEY` environment variable.
2658
+ * @env DD_API_KEY
2468
2659
  * You'll also need to adjust any firewall settings to allow the tracer to communicate
2469
2660
  * with `http-intake.logs.datadoghq.com`.
2470
2661
  *
@@ -2677,6 +2868,7 @@ declare namespace tracer {
2677
2868
  /**
2678
2869
  * Controls whether websocket messages should be traced.
2679
2870
  * This is also configurable via `DD_TRACE_WEBSOCKET_MESSAGES_ENABLED`.
2871
+ * @env DD_TRACE_WEBSOCKET_MESSAGES_ENABLED
2680
2872
  */
2681
2873
  traceWebsocketMessagesEnabled?: boolean;
2682
2874
  }
@@ -2988,24 +3180,32 @@ declare namespace tracer {
2988
3180
  /**
2989
3181
  * Whether to enable IAST.
2990
3182
  * @default false
3183
+ * @env DD_IAST_ENABLED
3184
+ * Programmatic configuration takes precedence over the environment variables listed above.
2991
3185
  */
2992
3186
  enabled?: boolean,
2993
3187
 
2994
3188
  /**
2995
3189
  * Controls the percentage of requests that iast will analyze
2996
3190
  * @default 30
3191
+ * @env DD_IAST_REQUEST_SAMPLING
3192
+ * Programmatic configuration takes precedence over the environment variables listed above.
2997
3193
  */
2998
3194
  requestSampling?: number,
2999
3195
 
3000
3196
  /**
3001
3197
  * Controls how many request can be analyzing code vulnerabilities at the same time
3002
3198
  * @default 2
3199
+ * @env DD_IAST_MAX_CONCURRENT_REQUESTS
3200
+ * Programmatic configuration takes precedence over the environment variables listed above.
3003
3201
  */
3004
3202
  maxConcurrentRequests?: number,
3005
3203
 
3006
3204
  /**
3007
3205
  * Controls how many code vulnerabilities can be detected in the same request
3008
3206
  * @default 2
3207
+ * @env DD_IAST_MAX_CONTEXT_OPERATIONS
3208
+ * Programmatic configuration takes precedence over the environment variables listed above.
3009
3209
  */
3010
3210
  maxContextOperations?: number,
3011
3211
 
@@ -3019,27 +3219,37 @@ declare namespace tracer {
3019
3219
  /**
3020
3220
  * Defines the number of rows to taint in data coming from databases
3021
3221
  * @default 1
3222
+ * @env DD_IAST_DB_ROWS_TO_TAINT
3223
+ * Programmatic configuration takes precedence over the environment variables listed above.
3022
3224
  */
3023
3225
  dbRowsToTaint?: number,
3024
3226
 
3025
3227
  /**
3026
3228
  * Whether to enable vulnerability deduplication
3229
+ * @env DD_IAST_DEDUPLICATION_ENABLED
3230
+ * Programmatic configuration takes precedence over the environment variables listed above.
3027
3231
  */
3028
3232
  deduplicationEnabled?: boolean,
3029
3233
 
3030
3234
  /**
3031
3235
  * Whether to enable vulnerability redaction
3032
3236
  * @default true
3237
+ * @env DD_IAST_REDACTION_ENABLED
3238
+ * Programmatic configuration takes precedence over the environment variables listed above.
3033
3239
  */
3034
3240
  redactionEnabled?: boolean,
3035
3241
 
3036
3242
  /**
3037
3243
  * Specifies a regex that will redact sensitive source names in vulnerability reports.
3244
+ * @env DD_IAST_REDACTION_NAME_PATTERN
3245
+ * Programmatic configuration takes precedence over the environment variables listed above.
3038
3246
  */
3039
3247
  redactionNamePattern?: string,
3040
3248
 
3041
3249
  /**
3042
3250
  * Specifies a regex that will redact sensitive source values in vulnerability reports.
3251
+ * @env DD_IAST_REDACTION_VALUE_PATTERN
3252
+ * Programmatic configuration takes precedence over the environment variables listed above.
3043
3253
  */
3044
3254
  redactionValuePattern?: string,
3045
3255
 
@@ -3048,11 +3258,15 @@ declare namespace tracer {
3048
3258
  * using ESM.
3049
3259
  * @deprecated Please use the DD_IAST_SECURITY_CONTROLS_CONFIGURATION
3050
3260
  * environment variable instead.
3261
+ * @env DD_IAST_SECURITY_CONTROLS_CONFIGURATION
3262
+ * Programmatic configuration takes precedence over the environment variables listed above.
3051
3263
  */
3052
3264
  securityControlsConfiguration?: string,
3053
3265
 
3054
3266
  /**
3055
3267
  * Specifies the verbosity of the sent telemetry. Default 'INFORMATION'
3268
+ * @env DD_IAST_TELEMETRY_VERBOSITY
3269
+ * Programmatic configuration takes precedence over the environment variables listed above.
3056
3270
  */
3057
3271
  telemetryVerbosity?: string,
3058
3272
 
@@ -3062,6 +3276,8 @@ declare namespace tracer {
3062
3276
  stackTrace?: {
3063
3277
  /** Whether to enable stack trace reporting.
3064
3278
  * @default true
3279
+ * @env DD_IAST_STACK_TRACE_ENABLED
3280
+ * Programmatic configuration takes precedence over the environment variables listed above.
3065
3281
  */
3066
3282
  enabled?: boolean,
3067
3283
  }
@@ -3243,13 +3459,13 @@ declare namespace tracer {
3243
3459
  /**
3244
3460
  * The type of evaluation metric, one of 'categorical', 'score', or 'boolean'
3245
3461
  */
3246
- metricType: 'categorical' | 'score' | 'boolean',
3462
+ metricType: 'categorical' | 'score' | 'boolean' | 'json',
3247
3463
 
3248
3464
  /**
3249
3465
  * The value of the evaluation metric.
3250
- * Must be string for 'categorical' metrics, number for 'score' metrics, and boolean for 'boolean' metrics.
3466
+ * Must be string for 'categorical' metrics, number for 'score' metrics, boolean for 'boolean' metrics and a JSON object for 'json' metrics.
3251
3467
  */
3252
- value: string | number | boolean,
3468
+ value: string | number | boolean | { [key: string]: any },
3253
3469
 
3254
3470
  /**
3255
3471
  * An object of string key-value pairs to tag the evaluation metric with.
@@ -3265,6 +3481,21 @@ declare namespace tracer {
3265
3481
  * The timestamp in milliseconds when the evaluation metric result was generated.
3266
3482
  */
3267
3483
  timestampMs?: number
3484
+
3485
+ /**
3486
+ * Reasoning for the evaluation result.
3487
+ */
3488
+ reasoning?: string,
3489
+
3490
+ /**
3491
+ * Whether the evaluation passed or failed. Valid values are pass and fail.
3492
+ */
3493
+ assessment?: 'pass' | 'fail',
3494
+
3495
+ /**
3496
+ * Arbitrary JSON data associated with the evaluation.
3497
+ */
3498
+ metadata?: { [key: string]: any }
3268
3499
  }
3269
3500
 
3270
3501
  interface Document {
@@ -3476,6 +3707,7 @@ declare namespace tracer {
3476
3707
  /**
3477
3708
  * The name of the ML application that the agent is orchestrating.
3478
3709
  * If not provided, the default value will be set to mlApp provided during initialization, or `DD_LLMOBS_ML_APP`.
3710
+ * @env DD_LLMOBS_ML_APP
3479
3711
  */
3480
3712
  mlApp?: string,
3481
3713
 
@@ -3511,11 +3743,15 @@ declare namespace tracer {
3511
3743
  interface LLMObsEnableOptions {
3512
3744
  /**
3513
3745
  * The name of your ML application.
3746
+ * @env DD_LLMOBS_ML_APP
3747
+ * Programmatic configuration takes precedence over the environment variables listed above.
3514
3748
  */
3515
3749
  mlApp?: string,
3516
3750
 
3517
3751
  /**
3518
3752
  * Set to `true` to disable sending data that requires a Datadog Agent.
3753
+ * @env DD_LLMOBS_AGENTLESS_ENABLED
3754
+ * Programmatic configuration takes precedence over the environment variables listed above.
3519
3755
  */
3520
3756
  agentlessEnabled?: boolean,
3521
3757
  }