dd-trace
    Preparing search index...

    Interface TracerOptions

    List of options available to the tracer.

    interface TracerOptions {
        apmTracingEnabled?: boolean;
        appsec?:
            | boolean
            | {
                apiSecurity?: {
                    enabled?: boolean;
                    endpointCollectionEnabled?: boolean;
                    endpointCollectionMessageLimit?: number;
                };
                blockedTemplateGraphql?: string;
                blockedTemplateHtml?: string;
                blockedTemplateJson?: string;
                enabled?: boolean;
                eventTracking?: {
                    mode?: | "disabled"
                    | "anonymous"
                    | "anon"
                    | "safe"
                    | "identification"
                    | "ident"
                    | "extended";
                };
                extendedHeadersCollection?: {
                    enabled: boolean;
                    maxHeaders: number;
                    redaction: boolean;
                };
                obfuscatorKeyRegex?: string;
                obfuscatorValueRegex?: string;
                rasp?: { bodyCollection?: boolean; enabled?: boolean };
                rateLimit?: number;
                rules?: string;
                stackTrace?: {
                    enabled?: boolean;
                    maxDepth?: number;
                    maxStackTraces?: number;
                };
                wafTimeout?: number;
            };
        clientIpEnabled?: boolean;
        clientIpHeader?: string;
        cloudPayloadTagging?: {
            maxDepth?: number;
            request?: string;
            response?: string;
        };
        codeOriginForSpans?: { enabled?: boolean };
        dbm?: { injectSqlBaseHash?: boolean };
        dbmPropagationMode?: "full" | "service" | "disabled";
        dogstatsd?: { hostname?: string; port?: number };
        dsmEnabled?: boolean;
        dynamicInstrumentation?: {
            captureTimeoutMs?: number;
            enabled?: boolean;
            probeFile?: string;
            redactedIdentifiers?: string[];
            redactionExcludedIdentifiers?: string[];
            uploadIntervalSeconds?: number;
        };
        env?: string;
        experimental?: {
            aiguard?: {
                enabled?: boolean;
                endpoint?: string;
                maxContentSize?: number;
                maxMessagesLength?: number;
                timeout?: number;
            };
            appsec?: { standalone?: { enabled?: boolean } };
            b3?: boolean;
            enableGetRumData?: boolean;
            exporter?: "log" | "agent" | "datadog";
            flaggingProvider?: { enabled?: boolean; initializationTimeoutMs?: number };
            iast?: boolean | IastOptions;
        };
        flushInterval?: number;
        flushMinSpans?: number;
        hostname?: string;
        iast?: boolean
        | IastOptions;
        llmobs?: LLMObsEnableOptions;
        logger?: {
            debug: (message: string) => void;
            error: (err: string | Error) => void;
            info: (message: string) => void;
            warn: (message: string) => void;
        };
        logInjection?: boolean;
        logLevel?: "error"
        | "debug"
        | "info"
        | "warn";
        lookup?: LookupFunction;
        plugins?: boolean;
        port?: string | number;
        profiling?: boolean;
        protocolVersion?: string;
        rateLimit?: number;
        remoteConfig?: { pollInterval?: number };
        reportHostname?: boolean;
        runtimeMetrics?:
            | boolean
            | { enabled?: boolean; eventLoop?: boolean; gc?: boolean };
        runtimeMetricsRuntimeId?: boolean;
        sampleRate?: number;
        samplingRules?: SamplingRule[];
        service?: string;
        serviceMapping?: { [key: string]: string };
        spanSamplingRules?: SpanSamplingRule[];
        startupLogs?: boolean;
        tags?: { [key: string]: any };
        tracePropagationStyle?: string[] | PropagationStyle;
        url?: string;
        version?: string;
    }
    Index

    Properties

    apmTracingEnabled?: boolean

    Used to disable APM Tracing when using standalone products

    true
    

    DD_APM_TRACING_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

    appsec?:
        | boolean
        | {
            apiSecurity?: {
                enabled?: boolean;
                endpointCollectionEnabled?: boolean;
                endpointCollectionMessageLimit?: number;
            };
            blockedTemplateGraphql?: string;
            blockedTemplateHtml?: string;
            blockedTemplateJson?: string;
            enabled?: boolean;
            eventTracking?: {
                mode?: | "disabled"
                | "anonymous"
                | "anon"
                | "safe"
                | "identification"
                | "ident"
                | "extended";
            };
            extendedHeadersCollection?: {
                enabled: boolean;
                maxHeaders: number;
                redaction: boolean;
            };
            obfuscatorKeyRegex?: string;
            obfuscatorValueRegex?: string;
            rasp?: { bodyCollection?: boolean; enabled?: boolean };
            rateLimit?: number;
            rules?: string;
            stackTrace?: {
                enabled?: boolean;
                maxDepth?: number;
                maxStackTraces?: number;
            };
            wafTimeout?: number;
        }

    Configuration of the AppSec protection. Can be a boolean as an alias to appsec.enabled.

    Type Declaration

    • boolean
    • {
          apiSecurity?: {
              enabled?: boolean;
              endpointCollectionEnabled?: boolean;
              endpointCollectionMessageLimit?: number;
          };
          blockedTemplateGraphql?: string;
          blockedTemplateHtml?: string;
          blockedTemplateJson?: string;
          enabled?: boolean;
          eventTracking?: {
              mode?: | "disabled"
              | "anonymous"
              | "anon"
              | "safe"
              | "identification"
              | "ident"
              | "extended";
          };
          extendedHeadersCollection?: {
              enabled: boolean;
              maxHeaders: number;
              redaction: boolean;
          };
          obfuscatorKeyRegex?: string;
          obfuscatorValueRegex?: string;
          rasp?: { bodyCollection?: boolean; enabled?: boolean };
          rateLimit?: number;
          rules?: string;
          stackTrace?: {
              enabled?: boolean;
              maxDepth?: number;
              maxStackTraces?: number;
          };
          wafTimeout?: number;
      }
      • OptionalapiSecurity?: {
            enabled?: boolean;
            endpointCollectionEnabled?: boolean;
            endpointCollectionMessageLimit?: number;
        }

        Configuration for Api Security

        • Optionalenabled?: boolean

          Whether to enable Api Security.

          true
          

          DD_API_SECURITY_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

        • OptionalendpointCollectionEnabled?: boolean

          Whether to enable endpoint collection for API Security.

          true
          

          DD_API_SECURITY_ENDPOINT_COLLECTION_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

        • OptionalendpointCollectionMessageLimit?: number

          Maximum number of endpoints that can be serialized per message.

          300
          

          DD_API_SECURITY_ENDPOINT_COLLECTION_MESSAGE_LIMIT Programmatic configuration takes precedence over the environment variables listed above.

      • OptionalblockedTemplateGraphql?: string

        Specifies a path to a custom blocking template json file for graphql requests

        DD_APPSEC_GRAPHQL_BLOCKED_TEMPLATE_JSON Programmatic configuration takes precedence over the environment variables listed above.

      • OptionalblockedTemplateHtml?: string

        Specifies a path to a custom blocking template html file.

        DD_APPSEC_HTTP_BLOCKED_TEMPLATE_HTML Programmatic configuration takes precedence over the environment variables listed above.

      • OptionalblockedTemplateJson?: string

        Specifies a path to a custom blocking template json file.

        DD_APPSEC_HTTP_BLOCKED_TEMPLATE_JSON Programmatic configuration takes precedence over the environment variables listed above.

      • Optionalenabled?: boolean

        Whether to enable AppSec.

        false
        

        DD_APPSEC_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

      • OptionaleventTracking?: {
            mode?:
                | "disabled"
                | "anonymous"
                | "anon"
                | "safe"
                | "identification"
                | "ident"
                | "extended";
        }

        Controls the automated user event tracking configuration

        • Optionalmode?:
              | "disabled"
              | "anonymous"
              | "anon"
              | "safe"
              | "identification"
              | "ident"
              | "extended"

          Controls the automated user tracking mode for user IDs and logins collections. Possible values:

          • 'anonymous': will hash user IDs and user logins before collecting them

          • 'anon': alias for 'anonymous'

          • 'safe': deprecated alias for 'anonymous'

          • 'identification': will collect user IDs and logins without redaction

          • 'ident': alias for 'identification'

          • 'extended': deprecated alias for 'identification'

          • 'disabled': will not collect user IDs and logins

          Unknown values will be considered as 'disabled'

          'identification'
          

          DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE Programmatic configuration takes precedence over the environment variables listed above.

      • OptionalextendedHeadersCollection?: { enabled: boolean; maxHeaders: number; redaction: boolean }

        Configuration for extended headers collection tied to security events

        Use UI and Remote Configuration to enable extended data collection

        • enabled: boolean

          Whether to enable extended headers collection

          false
          

          Use UI and Remote Configuration to enable extended data collection

          DD_APPSEC_COLLECT_ALL_HEADERS Programmatic configuration takes precedence over the environment variables listed above.

        • maxHeaders: number

          Specifies the maximum number of headers collected.

          50
          

          Use UI and Remote Configuration to enable extended data collection

          DD_APPSEC_MAX_COLLECTED_HEADERS Programmatic configuration takes precedence over the environment variables listed above.

        • redaction: boolean

          Whether to redact collected headers

          true
          

          Use UI and Remote Configuration to enable extended data collection

          DD_APPSEC_HEADER_COLLECTION_REDACTION_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

      • OptionalobfuscatorKeyRegex?: string

        Specifies a regex that will redact sensitive data by its key in attack reports.

        DD_APPSEC_OBFUSCATION_PARAMETER_KEY_REGEXP Programmatic configuration takes precedence over the environment variables listed above.

      • OptionalobfuscatorValueRegex?: string

        Specifies a regex that will redact sensitive data by its value in attack reports.

        DD_APPSEC_OBFUSCATION_PARAMETER_VALUE_REGEXP Programmatic configuration takes precedence over the environment variables listed above.

      • Optionalrasp?: { bodyCollection?: boolean; enabled?: boolean }

        Configuration for RASP

        • OptionalbodyCollection?: boolean

          Whether to enable request body collection on RASP event

          false
          

          Use UI and Remote Configuration to enable extended data collection

          DD_APPSEC_RASP_COLLECT_REQUEST_BODY Programmatic configuration takes precedence over the environment variables listed above.

        • Optionalenabled?: boolean

          Whether to enable RASP.

          false
          

          DD_APPSEC_RASP_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

      • OptionalrateLimit?: number

        Controls the maximum amount of traces sampled by AppSec attacks, per second.

        100
        

        DD_APPSEC_TRACE_RATE_LIMIT Programmatic configuration takes precedence over the environment variables listed above.

      • Optionalrules?: string

        Specifies a path to a custom rules file.

        DD_APPSEC_RULES Programmatic configuration takes precedence over the environment variables listed above.

      • OptionalstackTrace?: { enabled?: boolean; maxDepth?: number; maxStackTraces?: number }

        Configuration for stack trace reporting

        • Optionalenabled?: boolean

          Whether to enable stack trace reporting.

          true
          

          DD_APPSEC_STACK_TRACE_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

        • OptionalmaxDepth?: number

          Specifies the maximum depth of a stack trace to be reported.

          32
          

          DD_APPSEC_MAX_STACK_TRACE_DEPTH Programmatic configuration takes precedence over the environment variables listed above.

        • OptionalmaxStackTraces?: number

          Specifies the maximum number of stack traces to be reported.

          2
          

          DD_APPSEC_MAX_STACK_TRACES Programmatic configuration takes precedence over the environment variables listed above.

      • OptionalwafTimeout?: number

        Controls the maximum amount of time in microseconds the WAF is allowed to run synchronously for.

        5000
        

        DD_APPSEC_WAF_TIMEOUT Programmatic configuration takes precedence over the environment variables listed above.

    clientIpEnabled?: boolean

    Whether to enable client IP collection from relevant IP headers

    false
    

    DD_TRACE_CLIENT_IP_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

    clientIpHeader?: string

    Custom header name to source the http.client_ip tag from.

    DD_TRACE_CLIENT_IP_HEADER Programmatic configuration takes precedence over the environment variables listed above.

    cloudPayloadTagging?: { maxDepth?: number; request?: string; response?: string }

    Cloud payload report as tags

    Type Declaration

    • OptionalmaxDepth?: number

      Maximum depth of payload traversal for tags

      DD_TRACE_CLOUD_PAYLOAD_TAGGING_MAX_DEPTH Programmatic configuration takes precedence over the environment variables listed above.

    • Optionalrequest?: string

      Additional JSONPath queries to replace with redacted in request payloads Undefined or invalid JSONPath queries disable the feature for requests.

      DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING Programmatic configuration takes precedence over the environment variables listed above.

    • Optionalresponse?: string

      Additional JSONPath queries to replace with redacted in response payloads Undefined or invalid JSONPath queries disable the feature for responses.

      DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING Programmatic configuration takes precedence over the environment variables listed above.

    codeOriginForSpans?: { enabled?: boolean }

    Configuration for Code Origin for Spans.

    Type Declaration

    • Optionalenabled?: boolean

      Whether to enable Code Origin for Spans.

      true
      

      DD_CODE_ORIGIN_FOR_SPANS_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

    dbm?: { injectSqlBaseHash?: boolean }

    Configuration for Database Monitoring (DBM).

    Type Declaration

    • OptionalinjectSqlBaseHash?: boolean

      Controls whether to inject the SQL base hash (propagation hash) in DBM SQL comments. This option requires DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED=true to take effect. The propagation hash enables correlation between traces and database operations.

      false
      

      DD_DBM_INJECT_SQL_BASEHASH Programmatic configuration takes precedence over the environment variables listed above.

    dbmPropagationMode?: "full" | "service" | "disabled"

    Enables DBM to APM link using tag injection.

    'disabled'
    

    DD_DBM_PROPAGATION_MODE Programmatic configuration takes precedence over the environment variables listed above.

    dogstatsd?: { hostname?: string; port?: number }

    Options specific for the Dogstatsd agent.

    Type Declaration

    • Optionalhostname?: string

      The hostname of the Dogstatsd agent that the metrics will submitted to.

      DD_DOGSTATSD_HOST Programmatic configuration takes precedence over the environment variables listed above.

    • Optionalport?: number

      The port of the Dogstatsd agent that the metrics will submitted to.

      8125
      

      DD_DOGSTATSD_PORT Programmatic configuration takes precedence over the environment variables listed above.

    dsmEnabled?: boolean

    Whether to enable Data Streams Monitoring. Can also be enabled via the DD_DATA_STREAMS_ENABLED environment variable. When not provided, the value of DD_DATA_STREAMS_ENABLED is used.

    false
    

    DD_DATA_STREAMS_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

    dynamicInstrumentation?: {
        captureTimeoutMs?: number;
        enabled?: boolean;
        probeFile?: string;
        redactedIdentifiers?: string[];
        redactionExcludedIdentifiers?: string[];
        uploadIntervalSeconds?: number;
    }

    Configuration for Dynamic Instrumentation (Live Debugging).

    Type Declaration

    • OptionalcaptureTimeoutMs?: number

      Timeout in milliseconds for capturing variable values.

      15
      

      DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT_MS Programmatic configuration takes precedence over the environment variables listed above.

    • Optionalenabled?: boolean

      Whether to enable Dynamic Instrumentation.

      false
      

      DD_DYNAMIC_INSTRUMENTATION_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

    • OptionalprobeFile?: string

      Path to a custom probes configuration file.

      DD_DYNAMIC_INSTRUMENTATION_PROBE_FILE Programmatic configuration takes precedence over the environment variables listed above.

    • OptionalredactedIdentifiers?: string[]

      List of identifier names to redact in captured data. These are added to the built-in default list, which always applies. See redaction.js for the default identifiers. To avoid redacting some of those built-in identifiers, use redactionExcludedIdentifiers.

      []
      

      DD_DYNAMIC_INSTRUMENTATION_REDACTED_IDENTIFIERS Programmatic configuration takes precedence over the environment variables listed above.

    • OptionalredactionExcludedIdentifiers?: string[]

      List of identifier names to exclude from redaction. Use this to avoid redacting some of the built-in identifiers (see redactedIdentifiers).

      []
      

      DD_DYNAMIC_INSTRUMENTATION_REDACTION_EXCLUDED_IDENTIFIERS Programmatic configuration takes precedence over the environment variables listed above.

    • OptionaluploadIntervalSeconds?: number

      Interval in seconds between uploads of probe data.

      1
      

      DD_DYNAMIC_INSTRUMENTATION_UPLOAD_INTERVAL_SECONDS Programmatic configuration takes precedence over the environment variables listed above.

    env?: string

    Set an application’s environment e.g. prod, pre-prod, stage.

    DD_ENV Programmatic configuration takes precedence over the environment variables listed above.

    experimental?: {
        aiguard?: {
            enabled?: boolean;
            endpoint?: string;
            maxContentSize?: number;
            maxMessagesLength?: number;
            timeout?: number;
        };
        appsec?: { standalone?: { enabled?: boolean } };
        b3?: boolean;
        enableGetRumData?: boolean;
        exporter?: "log" | "agent" | "datadog";
        flaggingProvider?: { enabled?: boolean; initializationTimeoutMs?: number };
        iast?: boolean | IastOptions;
    }

    Experimental features can be enabled individually using key / value pairs.

    Type Declaration

    • Optionalaiguard?: {
          enabled?: boolean;
          endpoint?: string;
          maxContentSize?: number;
          maxMessagesLength?: number;
          timeout?: number;
      }
      • Optionalenabled?: boolean

        Set to true to enable the SDK.

        DD_AI_GUARD_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

      • Optionalendpoint?: string

        URL of the AI Guard REST API.

        DD_AI_GUARD_ENDPOINT Programmatic configuration takes precedence over the environment variables listed above.

      • OptionalmaxContentSize?: number

        Max size of the content property set in the meta-struct

        DD_AI_GUARD_MAX_CONTENT_SIZE Programmatic configuration takes precedence over the environment variables listed above.

      • OptionalmaxMessagesLength?: number

        Maximum number of conversational messages allowed to be set in the meta-struct

        DD_AI_GUARD_MAX_MESSAGES_LENGTH Programmatic configuration takes precedence over the environment variables listed above.

      • Optionaltimeout?: number

        Timeout used in calls to the AI Guard REST API in milliseconds (default 5000)

        DD_AI_GUARD_TIMEOUT Programmatic configuration takes precedence over the environment variables listed above.

    • Optionalappsec?: { standalone?: { enabled?: boolean } }
      • Optionalstandalone?: { enabled?: boolean }

        Configuration of Standalone ASM mode Deprecated in favor of apmTracingEnabled.

        • Optionalenabled?: boolean

          Whether to enable Standalone ASM.

          false
          
    • Optionalb3?: boolean
      false
      

      DD_TRACE_EXPERIMENTAL_B3_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

    • OptionalenableGetRumData?: boolean

      Whether to enable the experimental getRumData method.

      false
      

      DD_TRACE_EXPERIMENTAL_GET_RUM_DATA_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

    • Optionalexporter?: "log" | "agent" | "datadog"

      Whether to write traces to log output or agentless, rather than send to an agent

      DD_TRACE_EXPERIMENTAL_EXPORTER Programmatic configuration takes precedence over the environment variables listed above.

    • Optional BetaflaggingProvider?: { enabled?: boolean; initializationTimeoutMs?: number }

      Configuration for Feature Flagging & Experimentation.

      This feature is in preview and not ready for production use

      • Optionalenabled?: boolean

        Whether to enable the feature flagging provider. Requires Remote Config to be properly configured. Can be configured via DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED environment variable.

        false
        

        DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

      • OptionalinitializationTimeoutMs?: number

        Timeout in milliseconds for OpenFeature provider initialization. If configuration is not received within this time, initialization fails. Can be configured via DD_EXPERIMENTAL_FLAGGING_PROVIDER_INITIALIZATION_TIMEOUT_MS environment variable.

        30000
        

        DD_EXPERIMENTAL_FLAGGING_PROVIDER_INITIALIZATION_TIMEOUT_MS Programmatic configuration takes precedence over the environment variables listed above.

    • Optionaliast?: boolean | IastOptions

      Configuration of the IAST. Can be a boolean as an alias to iast.enabled.

    {}
    
    flushInterval?: number

    Interval in milliseconds at which the tracer will submit traces to the agent.

    2000
    

    DD_TRACE_FLUSH_INTERVAL Programmatic configuration takes precedence over the environment variables listed above.

    flushMinSpans?: number

    Number of spans before partially exporting a trace. This prevents keeping all the spans in memory for very large traces.

    1000
    

    DD_TRACE_PARTIAL_FLUSH_MIN_SPANS Programmatic configuration takes precedence over the environment variables listed above.

    hostname?: string

    The address of the trace agent that the tracer will submit to.

    '127.0.0.1'
    

    DD_AGENT_HOST Programmatic configuration takes precedence over the environment variables listed above.

    iast?: boolean | IastOptions

    Configuration of the IAST. Can be a boolean as an alias to iast.enabled.

    Configuration enabling LLM Observability. Enablement is superseded by the DD_LLMOBS_ENABLED environment variable.

    DD_LLMOBS_ENABLED The environment variable listed above takes precedence over programmatic configuration.

    logger?: {
        debug: (message: string) => void;
        error: (err: string | Error) => void;
        info: (message: string) => void;
        warn: (message: string) => void;
    }

    Custom logger to be used by the tracer (if debug = true), should support error(), warn(), info(), and debug() methods see https://datadog.github.io/dd-trace-js/#custom-logging

    logInjection?: boolean

    Whether to enable trace ID injection in log records to be able to correlate traces with logs.

    false
    

    DD_LOGS_INJECTION Programmatic configuration takes precedence over the environment variables listed above.

    logLevel?: "error" | "debug" | "info" | "warn"

    A string representing the minimum tracer log level to use when debug logging is enabled

    'debug'
    

    DD_TRACE_LOG_LEVEL, OTEL_LOG_LEVEL Programmatic configuration takes precedence over the environment variables listed above.

    lookup?: LookupFunction

    Custom function for DNS lookups when sending requests to the agent.

    dns.lookup()
    
    plugins?: boolean

    Whether to load all built-in plugins.

    true
    
    port?: string | number

    The port of the trace agent that the tracer will submit to.

    8126
    

    DD_TRACE_AGENT_PORT Programmatic configuration takes precedence over the environment variables listed above.

    profiling?: boolean

    Whether to enable profiling.

    DD_PROFILING_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

    protocolVersion?: string

    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.

    0.4
    

    DD_TRACE_AGENT_PROTOCOL_VERSION Programmatic configuration takes precedence over the environment variables listed above.

    rateLimit?: number

    Global rate limit that is applied on the global sample rate and all rules, and controls the ingestion rate limit between the agent and the backend. Defaults to deferring the decision to the agent.

    DD_TRACE_RATE_LIMIT Programmatic configuration takes precedence over the environment variables listed above.

    remoteConfig?: { pollInterval?: number }

    Configuration of ASM Remote Configuration

    Type Declaration

    • OptionalpollInterval?: number

      Specifies the remote configuration polling interval in seconds

      5
      

      DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS Programmatic configuration takes precedence over the environment variables listed above.

    reportHostname?: boolean

    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.

    false
    

    DD_TRACE_REPORT_HOSTNAME Programmatic configuration takes precedence over the environment variables listed above.

    runtimeMetrics?:
        | boolean
        | { enabled?: boolean; eventLoop?: boolean; gc?: boolean }

    Whether to enable runtime metrics, or an object specifying whether to enable specific metric types.

    Type Declaration

    • boolean
    • { enabled?: boolean; eventLoop?: boolean; gc?: boolean }
      • Optionalenabled?: boolean

        DD_RUNTIME_METRICS_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

      • OptionaleventLoop?: boolean

        DD_RUNTIME_METRICS_EVENT_LOOP_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

      • Optionalgc?: boolean

        DD_RUNTIME_METRICS_GC_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

    false
    
    runtimeMetricsRuntimeId?: boolean

    Whether to add an auto-generated runtime-id tag to metrics.

    false
    

    DD_RUNTIME_METRICS_RUNTIME_ID_ENABLED Programmatic configuration takes precedence over the environment variables listed above.

    sampleRate?: number

    Controls the ingestion sample rate (between 0 and 1) between the agent and the backend.

    DD_TRACE_SAMPLE_RATE, OTEL_TRACES_SAMPLER, OTEL_TRACES_SAMPLER_ARG Programmatic configuration takes precedence over the environment variables listed above.

    samplingRules?: SamplingRule[]

    Sampling rules to apply to priority sampling. Each rule is a JSON, consisting of service and name, which are regexes to match against a trace's service and name, and a corresponding sampleRate. If not specified, will defer to global sampling rate for all spans.

    []
    

    DD_TRACE_SAMPLING_RULES Programmatic configuration takes precedence over the environment variables listed above.

    service?: string

    The service name to be used for this program. If not set, the service name will attempted to be inferred from package.json

    DD_SERVICE, OTEL_SERVICE_NAME Programmatic configuration takes precedence over the environment variables listed above.

    serviceMapping?: { [key: string]: string }

    Provide service name mappings for each plugin.

    DD_SERVICE_MAPPING Programmatic configuration takes precedence over the environment variables listed above.

    spanSamplingRules?: SpanSamplingRule[]

    Span sampling rules that take effect when the enclosing trace is dropped, to ingest single spans

    []
    

    DD_SPAN_SAMPLING_RULES, DD_SPAN_SAMPLING_RULES_FILE Programmatic configuration takes precedence over the environment variables listed above.

    startupLogs?: boolean

    Whether to enable startup logs.

    false
    

    DD_TRACE_STARTUP_LOGS Programmatic configuration takes precedence over the environment variables listed above.

    tags?: { [key: string]: any }

    Global tags that should be assigned to every span.

    DD_TAGS, OTEL_RESOURCE_ATTRIBUTES Programmatic configuration takes precedence over the environment variables listed above.

    tracePropagationStyle?: string[] | PropagationStyle

    The selection and priority order of context propagation injection and extraction mechanisms.

    DD_TRACE_PROPAGATION_STYLE, DD_TRACE_PROPAGATION_STYLE_INJECT, DD_TRACE_PROPAGATION_STYLE_EXTRACT Also configurable via OTEL_PROPAGATORS when DD-specific propagation vars are not set. Programmatic configuration takes precedence over the environment variables listed above.

    url?: string

    The url of the trace agent that the tracer will submit to. Takes priority over hostname and port, if set.

    DD_TRACE_AGENT_URL Programmatic configuration takes precedence over the environment variables listed above.

    version?: string

    The version number of the application. If not set, the version will attempted to be inferred from package.json.

    DD_VERSION Programmatic configuration takes precedence over the environment variables listed above.