diff --git a/packages/dd-trace/src/config/defaults.js b/packages/dd-trace/src/config/defaults.js index 4c2af2c9bc2..3480bc0365e 100644 --- a/packages/dd-trace/src/config/defaults.js +++ b/packages/dd-trace/src/config/defaults.js @@ -36,6 +36,9 @@ function parseDefaultByType (raw, type) { case 'decimal': { return Number(raw) } + case 'json': { + return JSON.parse(raw) + } case 'array': { if (!raw || raw.length === 0) return [] // TODO: Make the parsing a helper that is reused. @@ -86,14 +89,12 @@ for (const entries of Object.values(supportedConfigurations)) { // The name of that method should be expressive for users. // TODO: Add handling for all environment variable names. They should not // need a configuration name for being listed with their default. - if (!Array.isArray(entry.configurationNames)) { + const defaultConfigurationName = entry.internalPropertyName ?? entry.configurationNames?.[0] + if (!defaultConfigurationName) { continue } - const parsedValue = parseDefaultByType(entry.default, entry.type) - for (const configurationName of entry.configurationNames) { - metadataDefaults[configurationName] = entry.default === null ? undefined : parsedValue - } + metadataDefaults[defaultConfigurationName] = parsedValue } } @@ -174,4 +175,17 @@ const defaults = { version: pkg.version, } +// Keep legacy object defaults that the pre-runtime-refactor config merge still expects. +defaults.sampler = { + sampleRate: defaults.sampleRate, + rateLimit: defaults.rateLimit, + rules: defaults.samplingRules, + spanSamplingRules: defaults.spanSamplingRules, +} +defaults['sampler.rateLimit'] = defaults.rateLimit +defaults['sampler.rules'] = defaults.samplingRules +defaults['sampler.spanSamplingRules'] = defaults.spanSamplingRules +defaults['profiling.exporters'] = 'agent' +defaults['profiling.sourceMap'] = true + module.exports = defaults diff --git a/packages/dd-trace/src/config/helper.js b/packages/dd-trace/src/config/helper.js index 0ba7b197758..2d8f9d7ea25 100644 --- a/packages/dd-trace/src/config/helper.js +++ b/packages/dd-trace/src/config/helper.js @@ -9,6 +9,9 @@ * @property {string|number|boolean|null|object|unknown[]} default * @property {string[]} [aliases] * @property {string[]} [configurationNames] + * @property {string} [internalPropertyName] + * @property {string} [transform] + * @property {string} [allowed] * @property {string|boolean} [deprecated] */ @@ -57,6 +60,13 @@ for (const [canonical, configuration] of Object.entries(supportedConfigurations) const aliasToCanonical = {} for (const canonical of Object.keys(aliases)) { for (const alias of aliases[canonical]) { + if (supportedConfigurations[alias]) { + // Allow 'fallback' aliases to be used for other configurations. + // This is used to handle the case where an alias could be used for multiple configurations. + // For example, OTEL_EXPORTER_OTLP_ENDPOINT is used for OTEL_EXPORTER_OTLP_LOGS_ENDPOINT + // and OTEL_EXPORTER_OTLP_METRICS_ENDPOINT. + continue + } if (aliasToCanonical[alias]) { throw new Error(`The alias ${alias} is already used for ${aliasToCanonical[alias]}.`) } @@ -113,8 +123,9 @@ function getValueFromSource (name, source) { } function validateAccess (name) { - if ((name.startsWith('DD_') || name.startsWith('OTEL_') || aliasToCanonical[name]) && - !supportedConfigurations[name]) { + if ((name.startsWith('DD_') || name.startsWith('OTEL_')) && + !supportedConfigurations[name] && + !aliasToCanonical[name]) { throw new Error(`Missing ${name} env/configuration in "supported-configurations.json" file.`) } } diff --git a/packages/dd-trace/src/config/index.js b/packages/dd-trace/src/config/index.js index 797d983e644..0f99856b4e5 100644 --- a/packages/dd-trace/src/config/index.js +++ b/packages/dd-trace/src/config/index.js @@ -33,8 +33,11 @@ const TELEMETRY_COUNTERS = new Map([ ['otel.env.invalid', {}], ]) const OTEL_DD_ENV_MAPPING = new Map([ + // eslint-disable-next-line eslint-rules/eslint-env-aliases ['OTEL_LOG_LEVEL', 'DD_TRACE_LOG_LEVEL'], + // eslint-disable-next-line eslint-rules/eslint-env-aliases ['OTEL_PROPAGATORS', 'DD_TRACE_PROPAGATION_STYLE'], + // eslint-disable-next-line eslint-rules/eslint-env-aliases ['OTEL_SERVICE_NAME', 'DD_SERVICE'], ['OTEL_TRACES_SAMPLER', 'DD_TRACE_SAMPLE_RATE'], ['OTEL_TRACES_SAMPLER_ARG', 'DD_TRACE_SAMPLE_RATE'], @@ -405,7 +408,6 @@ class Config { DD_TRACE_WEBSOCKET_MESSAGES_INHERIT_SAMPLING, DD_TRACE_WEBSOCKET_MESSAGES_SEPARATE_TRACES, DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH, - DD_TRACING_ENABLED, DD_VERSION, DD_VERTEXAI_SPAN_PROMPT_COMPLETION_SAMPLE_RATE, DD_VERTEXAI_SPAN_CHAR_LIMIT, @@ -462,6 +464,7 @@ class Config { setString(target, 'otelLogsHeaders', OTEL_EXPORTER_OTLP_LOGS_HEADERS || target.otelHeaders) setString(target, 'otelProtocol', OTEL_EXPORTER_OTLP_PROTOCOL) setString(target, 'otelLogsProtocol', OTEL_EXPORTER_OTLP_LOGS_PROTOCOL || target.otelProtocol) + // eslint-disable-next-line eslint-rules/eslint-env-aliases const otelTimeout = nonNegInt(OTEL_EXPORTER_OTLP_TIMEOUT, 'OTEL_EXPORTER_OTLP_TIMEOUT') if (otelTimeout !== undefined) { target.otelTimeout = otelTimeout @@ -607,7 +610,8 @@ class Config { target['experimental.flaggingProvider.initializationTimeoutMs'] = maybeInt(DD_EXPERIMENTAL_FLAGGING_PROVIDER_INITIALIZATION_TIMEOUT_MS) } - setBoolean(target, 'traceEnabled', DD_TRACE_ENABLED) + setString(target, 'logLevel', source.DD_TRACE_LOG_LEVEL ?? source.OTEL_LOG_LEVEL) + setBoolean(target, 'tracing', DD_TRACE_ENABLED) setBoolean(target, 'experimental.aiguard.enabled', DD_AI_GUARD_ENABLED) setString(target, 'experimental.aiguard.endpoint', DD_AI_GUARD_ENDPOINT) target['experimental.aiguard.maxContentSize'] = maybeInt(DD_AI_GUARD_MAX_CONTENT_SIZE) @@ -654,10 +658,9 @@ class Config { setString(target, 'installSignature.id', DD_INSTRUMENTATION_INSTALL_ID) setString(target, 'installSignature.time', DD_INSTRUMENTATION_INSTALL_TIME) setString(target, 'installSignature.type', DD_INSTRUMENTATION_INSTALL_TYPE) - // TODO: Why is DD_INJECTION_ENABLED a comma separated list? - setArray(target, 'injectionEnabled', DD_INJECTION_ENABLED) - if (DD_INJECTION_ENABLED !== undefined) { - setString(target, 'instrumentationSource', DD_INJECTION_ENABLED ? 'ssi' : 'manual') + setString(target, 'injectionEnabled', DD_INJECTION_ENABLED) + if (DD_INJECTION_ENABLED) { + setString(target, 'instrumentationSource', 'ssi') } setBoolean(target, 'injectForce', DD_INJECT_FORCE) setBoolean(target, 'isAzureFunction', getIsAzureFunction()) @@ -811,6 +814,7 @@ class Config { for (const style of otelStyles || []) { if (!VALID_PROPAGATION_STYLES.has(style)) { log.warn('unexpected value %s for OTEL_PROPAGATORS environment variable', style) + // eslint-disable-next-line eslint-rules/eslint-env-aliases getCounter('otel.env.invalid', 'DD_TRACE_PROPAGATION_STYLE', 'OTEL_PROPAGATORS').inc() } } @@ -824,7 +828,6 @@ class Config { setBoolean(target, 'traceWebsocketMessagesEnabled', DD_TRACE_WEBSOCKET_MESSAGES_ENABLED) setBoolean(target, 'traceWebsocketMessagesInheritSampling', DD_TRACE_WEBSOCKET_MESSAGES_INHERIT_SAMPLING) setBoolean(target, 'traceWebsocketMessagesSeparateTraces', DD_TRACE_WEBSOCKET_MESSAGES_SEPARATE_TRACES) - setBoolean(target, 'tracing', DD_TRACING_ENABLED) setString(target, 'version', DD_VERSION || tags.version) setBoolean(target, 'inferredProxyServicesEnabled', DD_TRACE_INFERRED_PROXY_SERVICES_ENABLED) setBoolean(target, 'trace.aws.addSpanPointers', DD_TRACE_AWS_ADD_SPAN_POINTERS) @@ -987,6 +990,7 @@ class Config { setBoolean(opts, 'llmobs.agentlessEnabled', options.llmobs?.agentlessEnabled) setString(opts, 'llmobs.mlApp', options.llmobs?.mlApp) setBoolean(opts, 'logInjection', options.logInjection) + setString(opts, 'logLevel', options.logLevel) opts.lookup = options.lookup setBoolean(opts, 'middlewareTracingEnabled', options.middlewareTracingEnabled) setBoolean(opts, 'openAiLogsEnabled', options.openAiLogsEnabled) @@ -1366,12 +1370,16 @@ function isInvalidOtelEnvironmentVariable (envVar, value) { // Skip validation if the value is undefined (it was not set as environment variable) if (value === undefined) return false + // eslint-disable-next-line eslint-rules/eslint-env-aliases + if (envVar === 'OTEL_PROPAGATORS' || envVar === 'OTEL_SERVICE_NAME') { + return typeof value !== 'string' + } + switch (envVar) { + // eslint-disable-next-line eslint-rules/eslint-env-aliases case 'OTEL_LOG_LEVEL': return !VALID_LOG_LEVELS.has(value) - case 'OTEL_PROPAGATORS': case 'OTEL_RESOURCE_ATTRIBUTES': - case 'OTEL_SERVICE_NAME': return typeof value !== 'string' case 'OTEL_TRACES_SAMPLER': return getFromOtelSamplerMap(value, getEnv('OTEL_TRACES_SAMPLER_ARG')) === undefined diff --git a/packages/dd-trace/src/config/supported-configurations.json b/packages/dd-trace/src/config/supported-configurations.json index 5bca7736dc9..38c26385fe8 100644 --- a/packages/dd-trace/src/config/supported-configurations.json +++ b/packages/dd-trace/src/config/supported-configurations.json @@ -13,9 +13,7 @@ "implementation": "A", "type": "boolean", "default": "false", - "configurationNames": [ - "ciVisAgentlessLogSubmissionEnabled" - ] + "internalPropertyName": "ciVisAgentlessLogSubmissionEnabled" } ], "DD_AGENTLESS_LOG_SUBMISSION_URL": [ @@ -104,9 +102,7 @@ "aliases": [ "DATADOG_API_KEY" ], - "configurationNames": [ - "apiKey" - ] + "internalPropertyName": "apiKey" } ], "DD_API_SECURITY_ENABLED": [ @@ -114,7 +110,8 @@ "implementation": "A", "type": "boolean", "configurationNames": [ - "appsec.apiSecurity.enabled" + "appsec.apiSecurity.enabled", + "experimental.appsec.apiSecurity.enabled" ], "default": "true", "aliases": [ @@ -127,7 +124,8 @@ "implementation": "A", "type": "boolean", "configurationNames": [ - "appsec.apiSecurity.endpointCollectionEnabled" + "appsec.apiSecurity.endpointCollectionEnabled", + "experimental.appsec.apiSecurity.endpointCollectionEnabled" ], "default": "true" } @@ -137,7 +135,8 @@ "implementation": "A", "type": "int", "configurationNames": [ - "appsec.apiSecurity.endpointCollectionMessageLimit" + "appsec.apiSecurity.endpointCollectionMessageLimit", + "experimental.appsec.apiSecurity.endpointCollectionMessageLimit" ], "default": "300" } @@ -146,9 +145,7 @@ { "implementation": "A", "type": "decimal", - "configurationNames": [ - "appsec.apiSecurity.downstreamBodyAnalysisSampleRate" - ], + "internalPropertyName": "appsec.apiSecurity.downstreamBodyAnalysisSampleRate", "default": "0.5" } ], @@ -156,9 +153,7 @@ { "implementation": "A", "type": "int", - "configurationNames": [ - "appsec.apiSecurity.maxDownstreamRequestBodyAnalysis" - ], + "internalPropertyName": "appsec.apiSecurity.maxDownstreamRequestBodyAnalysis", "default": "1" } ], @@ -167,9 +162,7 @@ "implementation": "A", "type": "decimal", "default": "30", - "configurationNames": [ - "appsec.apiSecurity.sampleDelay" - ] + "internalPropertyName": "appsec.apiSecurity.sampleDelay" } ], "DD_APM_FLUSH_DEADLINE_MILLISECONDS": [ @@ -194,7 +187,8 @@ "implementation": "E", "type": "string", "configurationNames": [ - "appsec.eventTracking.mode" + "appsec.eventTracking.mode", + "experimental.appsec.eventTracking.mode" ], "default": "identification", "aliases": [ @@ -207,7 +201,8 @@ "implementation": "A", "type": "boolean", "configurationNames": [ - "appsec.extendedHeadersCollection.enabled" + "appsec.extendedHeadersCollection.enabled", + "experimental.appsec.extendedHeadersCollection.enabled" ], "default": "false", "deprecated": true @@ -218,7 +213,10 @@ "implementation": "C", "type": "boolean", "configurationNames": [ - "appsec.enabled" + "appsec.enabled", + "appsec", + "experimental.appsec.enabled", + "experimental.appsec" ], "default": null } @@ -228,9 +226,11 @@ "implementation": "A", "type": "string", "configurationNames": [ - "appsec.blockedTemplateGraphql" + "appsec.blockedTemplateGraphql", + "experimental.appsec.blockedTemplateGraphql" ], - "default": null + "default": null, + "transform": "readFilePath" } ], "DD_APPSEC_HEADER_COLLECTION_REDACTION_ENABLED": [ @@ -238,7 +238,8 @@ "implementation": "A", "type": "boolean", "configurationNames": [ - "appsec.extendedHeadersCollection.redaction" + "appsec.extendedHeadersCollection.redaction", + "experimental.appsec.extendedHeadersCollection.redaction" ], "default": "true" } @@ -248,9 +249,11 @@ "implementation": "B", "type": "string", "configurationNames": [ - "appsec.blockedTemplateHtml" + "appsec.blockedTemplateHtml", + "experimental.appsec.blockedTemplateHtml" ], - "default": null + "default": null, + "transform": "readFilePath" } ], "DD_APPSEC_HTTP_BLOCKED_TEMPLATE_JSON": [ @@ -258,9 +261,11 @@ "implementation": "B", "type": "string", "configurationNames": [ - "appsec.blockedTemplateJson" + "appsec.blockedTemplateJson", + "experimental.appsec.blockedTemplateJson" ], - "default": null + "default": null, + "transform": "readFilePath" } ], "DD_APPSEC_MAX_COLLECTED_HEADERS": [ @@ -268,7 +273,8 @@ "implementation": "A", "type": "int", "configurationNames": [ - "appsec.extendedHeadersCollection.maxHeaders" + "appsec.extendedHeadersCollection.maxHeaders", + "experimental.appsec.extendedHeadersCollection.maxHeaders" ], "default": "50" } @@ -278,7 +284,11 @@ "implementation": "A", "type": "int", "configurationNames": [ - "appsec.stackTrace.maxStackTraces" + "appsec.stackTrace.maxStackTraces", + "experimental.appsec.stackTrace.maxStackTraces" + ], + "aliases": [ + "DD_APPSEC_MAX_STACKTRACES" ], "default": "2" } @@ -288,7 +298,11 @@ "implementation": "A", "type": "int", "configurationNames": [ - "appsec.stackTrace.maxDepth" + "appsec.stackTrace.maxDepth", + "experimental.appsec.stackTrace.maxDepth" + ], + "aliases": [ + "DD_APPSEC_MAX_STACKTRACE_DEPTH" ], "default": "32" } @@ -298,7 +312,8 @@ "implementation": "B", "type": "string", "configurationNames": [ - "appsec.obfuscatorKeyRegex" + "appsec.obfuscatorKeyRegex", + "experimental.appsec.obfuscatorKeyRegex" ], "default": "(?i)pass|pw(?:or)?d|secret|(?:api|private|public|access)[_-]?key|token|consumer[_-]?(?:id|key|secret)|sign(?:ed|ature)|bearer|authorization|jsessionid|phpsessid|asp\\.net[_-]sessionid|sid|jwt" } @@ -308,7 +323,8 @@ "implementation": "G", "type": "string", "configurationNames": [ - "appsec.obfuscatorValueRegex" + "appsec.obfuscatorValueRegex", + "experimental.appsec.obfuscatorValueRegex" ], "default": "(?i)(?:p(?:ass)?w(?:or)?d|pass(?:[_-]?phrase)?|secret(?:[_-]?key)?|(?:(?:api|private|public|access)[_-]?)key(?:[_-]?id)?|(?:(?:auth|access|id|refresh)[_-]?)?token|consumer[_-]?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?|jsessionid|phpsessid|asp\\.net(?:[_-]|-)sessionid|sid|jwt)(?:\\s*=([^;&]+)|\"\\s*:\\s*(\"[^\"]+\"|\\d+))|bearer\\s+([a-z0-9\\._\\-]+)|token\\s*:\\s*([a-z0-9]{13})|gh[opsu]_([0-9a-zA-Z]{36})|ey[I-L][\\w=-]+\\.(ey[I-L][\\w=-]+(?:\\.[\\w.+\\/=-]+)?)|[\\-]{5}BEGIN[a-z\\s]+PRIVATE\\sKEY[\\-]{5}([^\\-]+)[\\-]{5}END[a-z\\s]+PRIVATE\\sKEY|ssh-rsa\\s*([a-z0-9\\/\\.+]{100,})" } @@ -318,7 +334,8 @@ "implementation": "A", "type": "boolean", "configurationNames": [ - "appsec.rasp.bodyCollection" + "appsec.rasp.bodyCollection", + "experimental.appsec.rasp.bodyCollection" ], "default": "false", "deprecated": true @@ -329,7 +346,8 @@ "implementation": "A", "type": "boolean", "configurationNames": [ - "appsec.rasp.enabled" + "appsec.rasp.enabled", + "experimental.appsec.rasp.enabled" ], "default": "true" } @@ -339,7 +357,8 @@ "implementation": "B", "type": "string", "configurationNames": [ - "appsec.rules" + "appsec.rules", + "experimental.appsec.rules" ], "default": null } @@ -349,9 +368,7 @@ "implementation": "B", "type": "boolean", "default": null, - "configurationNames": [ - "appsec.sca.enabled" - ] + "internalPropertyName": "appsec.sca.enabled" } ], "DD_APPSEC_STACK_TRACE_ENABLED": [ @@ -359,7 +376,8 @@ "implementation": "A", "type": "boolean", "configurationNames": [ - "appsec.stackTrace.enabled" + "appsec.stackTrace.enabled", + "experimental.appsec.stackTrace.enabled" ], "default": "true" } @@ -369,7 +387,8 @@ "implementation": "A", "type": "int", "configurationNames": [ - "appsec.rateLimit" + "appsec.rateLimit", + "experimental.appsec.rateLimit" ], "default": "100" } @@ -379,7 +398,8 @@ "implementation": "E", "type": "int", "configurationNames": [ - "appsec.wafTimeout" + "appsec.wafTimeout", + "experimental.appsec.wafTimeout" ], "default": "5000" } @@ -389,9 +409,7 @@ "implementation": "A", "type": "string", "default": null, - "configurationNames": [ - "appKey" - ] + "internalPropertyName": "appKey" } ], "DD_AZURE_RESOURCE_GROUP": [ @@ -441,9 +459,7 @@ "implementation": "B", "type": "boolean", "default": "true", - "configurationNames": [ - "isEarlyFlakeDetectionEnabled" - ] + "internalPropertyName": "isEarlyFlakeDetectionEnabled" } ], "DD_CIVISIBILITY_ENABLED": [ @@ -458,9 +474,7 @@ "implementation": "A", "type": "int", "default": "5", - "configurationNames": [ - "flakyTestRetriesCount" - ] + "internalPropertyName": "flakyTestRetriesCount" } ], "DD_CIVISIBILITY_FLAKY_RETRY_ENABLED": [ @@ -468,9 +482,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "isFlakyTestRetriesEnabled" - ] + "internalPropertyName": "isFlakyTestRetriesEnabled" } ], "DD_CIVISIBILITY_GIT_UNSHALLOW_ENABLED": [ @@ -485,9 +497,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "isGitUploadEnabled" - ] + "internalPropertyName": "isGitUploadEnabled" } ], "DD_CIVISIBILITY_IMPACTED_TESTS_DETECTION_ENABLED": [ @@ -495,9 +505,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "isImpactedTestsEnabled" - ] + "internalPropertyName": "isImpactedTestsEnabled" } ], "DD_CIVISIBILITY_ITR_ENABLED": [ @@ -505,9 +513,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "isIntelligentTestRunnerEnabled" - ] + "internalPropertyName": "isIntelligentTestRunnerEnabled" } ], "DD_CIVISIBILITY_MANUAL_API_ENABLED": [ @@ -515,9 +521,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "isManualApiEnabled" - ] + "internalPropertyName": "isManualApiEnabled" } ], "DD_CIVISIBILITY_RUM_FLUSH_WAIT_MILLIS": [ @@ -573,9 +577,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "crashtracking.enabled" - ] + "internalPropertyName": "crashtracking.enabled" } ], "DD_CUSTOM_TRACE_ID": [ @@ -690,19 +692,19 @@ ], "DD_DYNAMIC_INSTRUMENTATION_UPLOAD_INTERVAL_SECONDS": [ { - "implementation": "A", - "type": "int", + "implementation": "C", + "type": "decimal", "configurationNames": [ "dynamicInstrumentation.uploadIntervalSeconds" ], - "default": "1" + "default": "1.0" } ], "DD_ENABLE_NX_SERVICE_NAME": [ { - "implementation": "A", - "type": "string", - "default": null + "implementation": "B", + "type": "boolean", + "default": "false" } ], "DD_ENV": [ @@ -717,9 +719,12 @@ ], "DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED": [ { - "implementation": "A", + "implementation": "B", "type": "boolean", - "default": "true" + "default": "false", + "configurationNames": [ + "experimental.appsec.standalone.enabled" + ] } ], "DD_EXPERIMENTAL_FLAGGING_PROVIDER_INITIALIZATION_TIMEOUT_MS": [ @@ -747,9 +752,7 @@ "implementation": "B", "type": "boolean", "default": "true", - "configurationNames": [ - "propagateProcessTags.enabled" - ] + "internalPropertyName": "propagateProcessTags.enabled" } ], "DD_EXPERIMENTAL_TEST_OPT_SETTINGS_CACHE": [ @@ -894,23 +897,20 @@ ], "DD_GRPC_CLIENT_ERROR_STATUSES": [ { - "implementation": "A", - "type": "array", - "default": "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16", - "configurationNames": [ - "grpc.client.error.statuses" - ], - "handler": "GRPC_HANDLER" + "implementation": "C", + "type": "string", + "default": "1-16", + "internalPropertyName": "grpc.client.error.statuses", + "transform": "setIntegerRangeSet" } ], "DD_GRPC_SERVER_ERROR_STATUSES": [ { - "implementation": "A", - "type": "array", - "default": "2,3,4,5,6,7,8,9,10,11,12,13,14,15,16", - "configurationNames": [ - "grpc.server.error.statuses" - ] + "implementation": "C", + "type": "string", + "default": "2-16", + "internalPropertyName": "grpc.server.error.statuses", + "transform": "setIntegerRangeSet" } ], "DD_HEAP_SNAPSHOT_COUNT": [ @@ -918,9 +918,7 @@ "implementation": "A", "type": "int", "default": "0", - "configurationNames": [ - "heapSnapshot.count" - ] + "internalPropertyName": "heapSnapshot.count" } ], "DD_HEAP_SNAPSHOT_DESTINATION": [ @@ -928,9 +926,7 @@ "implementation": "A", "type": "string", "default": "", - "configurationNames": [ - "heapSnapshot.destination" - ] + "internalPropertyName": "heapSnapshot.destination" } ], "DD_HEAP_SNAPSHOT_INTERVAL": [ @@ -938,9 +934,7 @@ "implementation": "A", "type": "int", "default": "3600", - "configurationNames": [ - "heapSnapshot.interval" - ] + "internalPropertyName": "heapSnapshot.interval" } ], "DD_IAST_DB_ROWS_TO_TAINT": [ @@ -948,7 +942,8 @@ "implementation": "A", "type": "int", "configurationNames": [ - "iast.dbRowsToTaint" + "iast.dbRowsToTaint", + "experimental.iast.dbRowsToTaint" ], "default": "1" } @@ -958,7 +953,8 @@ "implementation": "A", "type": "boolean", "configurationNames": [ - "iast.deduplicationEnabled" + "iast.deduplicationEnabled", + "experimental.iast.deduplicationEnabled" ], "default": "true" } @@ -968,7 +964,10 @@ "implementation": "B", "type": "boolean", "configurationNames": [ - "iast.enabled" + "iast.enabled", + "iast", + "experimental.iast.enabled", + "experimental.iast" ], "default": "false" } @@ -978,7 +977,8 @@ "implementation": "A", "type": "int", "configurationNames": [ - "iast.maxConcurrentRequests" + "iast.maxConcurrentRequests", + "experimental.iast.maxConcurrentRequests" ], "default": "2" } @@ -988,7 +988,8 @@ "implementation": "A", "type": "int", "configurationNames": [ - "iast.maxContextOperations" + "iast.maxContextOperations", + "experimental.iast.maxContextOperations" ], "default": "2" } @@ -998,7 +999,8 @@ "implementation": "A", "type": "boolean", "configurationNames": [ - "iast.redactionEnabled" + "iast.redactionEnabled", + "experimental.iast.redactionEnabled" ], "default": "true" } @@ -1008,7 +1010,8 @@ "implementation": "A", "type": "string", "configurationNames": [ - "iast.redactionNamePattern" + "iast.redactionNamePattern", + "experimental.iast.redactionNamePattern" ], "default": "(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?|public_?|access_?|secret_?)key(?:_?id)?|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?|(?:sur|last)name|user(?:name)?|address|e?mail)" } @@ -1018,7 +1021,8 @@ "implementation": "A", "type": "string", "configurationNames": [ - "iast.redactionValuePattern" + "iast.redactionValuePattern", + "experimental.iast.redactionValuePattern" ], "default": "(?:bearer\\s+[a-z0-9\\._\\-]+|glpat-[\\w\\-]{20}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L][\\w=\\-]+\\.ey[I-L][\\w=\\-]+(?:\\.[\\w.+/=\\-]+)?|(?:[\\-]{5}BEGIN[a-z\\s]+PRIVATE\\sKEY[\\-]{5}[^\\-]+[\\-]{5}END[a-z\\s]+PRIVATE\\sKEY[\\-]{5}|ssh-rsa\\s*[a-z0-9/\\.+]{100,})|[\\w\\.-]+@[a-zA-Z\\d\\.-]+\\.[a-zA-Z]{2,})" } @@ -1028,9 +1032,12 @@ "implementation": "A", "type": "int", "configurationNames": [ - "iast.requestSampling" + "iast.requestSampling", + "experimental.iast.requestSampling" ], - "default": "30" + "default": "30", + "allowed": "100|[1-9]?\\d", + "transform": "iastRequestSampling" } ], "DD_IAST_SECURITY_CONTROLS_CONFIGURATION": [ @@ -1038,7 +1045,8 @@ "implementation": "B", "type": "string", "configurationNames": [ - "iast.securityControlsConfiguration" + "iast.securityControlsConfiguration", + "experimental.iast.securityControlsConfiguration" ], "default": null } @@ -1048,7 +1056,8 @@ "implementation": "B", "type": "boolean", "configurationNames": [ - "iast.stackTrace.enabled" + "iast.stackTrace.enabled", + "experimental.iast.stackTrace.enabled" ], "default": "true" } @@ -1058,19 +1067,18 @@ "implementation": "B", "type": "string", "configurationNames": [ - "iast.telemetryVerbosity" + "iast.telemetryVerbosity", + "experimental.iast.telemetryVerbosity" ], "default": "INFORMATION" } ], "DD_INJECTION_ENABLED": [ { - "implementation": "A", - "type": "array", - "default": "", - "configurationNames": [ - "injectionEnabled" - ] + "implementation": "C", + "type": "string", + "default": null, + "internalPropertyName": "injectionEnabled" } ], "DD_INJECT_FORCE": [ @@ -1078,9 +1086,7 @@ "implementation": "A", "type": "boolean", "default": "false", - "configurationNames": [ - "injectForce" - ] + "internalPropertyName": "injectForce" } ], "DD_INSTRUMENTATION_CONFIG_ID": [ @@ -1088,9 +1094,7 @@ "implementation": "A", "type": "string", "default": null, - "configurationNames": [ - "instrumentation_config_id" - ] + "internalPropertyName": "instrumentation_config_id" } ], "DD_INSTRUMENTATION_INSTALL_ID": [ @@ -1098,9 +1102,7 @@ "implementation": "A", "type": "string", "default": null, - "configurationNames": [ - "installSignature.id" - ] + "internalPropertyName": "installSignature.id" } ], "DD_INSTRUMENTATION_INSTALL_TIME": [ @@ -1108,9 +1110,7 @@ "implementation": "A", "type": "string", "default": null, - "configurationNames": [ - "installSignature.time" - ] + "internalPropertyName": "installSignature.time" } ], "DD_INSTRUMENTATION_INSTALL_TYPE": [ @@ -1118,9 +1118,7 @@ "implementation": "A", "type": "string", "default": null, - "configurationNames": [ - "installSignature.type" - ] + "internalPropertyName": "installSignature.type" } ], "DD_INSTRUMENTATION_TELEMETRY_ENABLED": [ @@ -1131,9 +1129,7 @@ "aliases": [ "DD_TRACE_TELEMETRY_ENABLED" ], - "configurationNames": [ - "telemetry.enabled" - ] + "internalPropertyName": "telemetry.enabled" } ], "DD_INTERNAL_PROFILING_LONG_LIVED_THRESHOLD": [ @@ -1141,9 +1137,7 @@ "implementation": "A", "type": "int", "default": "30000", - "configurationNames": [ - "profiling.longLivedThreshold" - ] + "internalPropertyName": "profiling.longLivedThreshold" } ], "DD_INTERNAL_PROFILING_TIMELINE_SAMPLING_ENABLED": [ @@ -1165,9 +1159,7 @@ "implementation": "A", "type": "int", "default": "128", - "configurationNames": [ - "langchain.spanCharLimit" - ] + "internalPropertyName": "langchain.spanCharLimit" } ], "DD_LANGCHAIN_SPAN_PROMPT_COMPLETION_SAMPLE_RATE": [ @@ -1175,9 +1167,7 @@ "implementation": "A", "type": "decimal", "default": "1", - "configurationNames": [ - "langchain.spanPromptCompletionSampleRate" - ] + "internalPropertyName": "langchain.spanPromptCompletionSampleRate" } ], "DD_LLMOBS_AGENTLESS_ENABLED": [ @@ -1195,9 +1185,7 @@ "implementation": "A", "type": "boolean", "default": "false", - "configurationNames": [ - "llmobs.enabled" - ] + "internalPropertyName": "llmobs.enabled" } ], "DD_LLMOBS_ML_APP": [ @@ -1225,16 +1213,22 @@ "implementation": "A", "type": "boolean", "default": "false", - "configurationNames": [ - "otelLogsEnabled" - ] + "internalPropertyName": "otelLogsEnabled" } ], - "DD_LOG_LEVEL": [ + "DD_TRACE_LOG_LEVEL": [ { - "implementation": "B", + "implementation": "C", "type": "string", - "default": null + "default": "debug", + "configurationNames": [ + "logLevel" + ], + "aliases": [ + "DD_LOG_LEVEL", + "OTEL_LOG_LEVEL" + ], + "allowed": "debug|info|warn|error" } ], "DD_METRICS_OTEL_ENABLED": [ @@ -1242,9 +1236,7 @@ "implementation": "A", "type": "boolean", "default": "false", - "configurationNames": [ - "otelMetricsEnabled" - ] + "internalPropertyName": "otelMetricsEnabled" } ], "DD_MINI_AGENT_PATH": [ @@ -1269,9 +1261,7 @@ "implementation": "A", "type": "int", "default": "128", - "configurationNames": [ - "openai.spanCharLimit" - ] + "internalPropertyName": "openai.spanCharLimit" } ], "DD_PIPELINE_EXECUTION_ID": [ @@ -1346,38 +1336,30 @@ ], "DD_PROFILING_DEBUG_UPLOAD_COMPRESSION": [ { - "implementation": "A", + "implementation": "B", "type": "string", - "default": "zstd" + "default": "on", + "allowed": "on|off|(gzip|zstd)(-[1-9][0-9]?)?", + "transform": "toLowerCase" } ], "DD_PROFILING_ENABLED": [ { - "implementation": "A", - "type": "boolean", + "implementation": "B", + "type": "string", + "internalPropertyName": "profiling.enabled", "configurationNames": [ - "profiling.enabled" + "profiling" ], + "allowed": "false|true|auto|1|0", + "transform": "normalizeProfilingEnabled", "default": "false", + "__TODO__": "The alias is deprecated and should log. This needs an re-implementation.", "aliases": [ "DD_EXPERIMENTAL_PROFILING_ENABLED" ] } ], - "DD_EXPERIMENTAL_PROFILING_ENABLED": [ - { - "implementation": "A", - "type": "boolean", - "configurationNames": [ - "profiling.enabled" - ], - "default": "false", - "aliases": [ - "DD_PROFILING_ENABLED" - ], - "deprecated": true - } - ], "DD_PROFILING_ENDPOINT_COLLECTION_ENABLED": [ { "implementation": "A", @@ -1401,8 +1383,8 @@ ], "DD_PROFILING_EXPERIMENTAL_OOM_EXPORT_STRATEGIES": [ { - "implementation": "A", - "type": "string", + "implementation": "B", + "type": "array", "default": "process" } ], @@ -1429,19 +1411,16 @@ ], "DD_PROFILING_EXPORTERS": [ { - "implementation": "A", - "type": "string", - "default": "agent", - "configurationNames": [ - "profiling.exporters" - ] + "implementation": "B", + "type": "array", + "default": "agent" } ], "DD_PROFILING_HEAP_ENABLED": [ { - "implementation": "A", + "implementation": "B", "type": "boolean", - "default": "false" + "default": null } ], "DD_PROFILING_HEAP_SAMPLING_INTERVAL": [ @@ -1460,8 +1439,8 @@ ], "DD_PROFILING_PROFILERS": [ { - "implementation": "A", - "type": "string", + "implementation": "B", + "type": "array", "default": "space,wall" } ], @@ -1469,10 +1448,7 @@ { "implementation": "A", "type": "boolean", - "default": "true", - "configurationNames": [ - "profiling.sourceMap" - ] + "default": "true" } ], "DD_PROFILING_TIMELINE_ENABLED": [ @@ -1519,9 +1495,9 @@ ], "DD_PROFILING_WALLTIME_ENABLED": [ { - "implementation": "B", + "implementation": "A", "type": "boolean", - "default": "true" + "default": null } ], "DD_REMOTE_CONFIGURATION_ENABLED": [ @@ -1532,9 +1508,7 @@ "aliases": [ "DD_REMOTE_CONFIG_ENABLED" ], - "configurationNames": [ - "remoteConfig.enabled" - ] + "internalPropertyName": "remoteConfig.enabled" } ], "DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS": [ @@ -1552,7 +1526,8 @@ "implementation": "A", "type": "boolean", "configurationNames": [ - "runtimeMetrics.enabled" + "runtimeMetrics.enabled", + "runtimeMetrics" ], "default": "false" } @@ -1597,6 +1572,14 @@ ] } ], + "DD_ROOT_JS_SESSION_ID": [ + { + "implementation": "A", + "type": "string", + "default": null, + "internal": true + } + ], "DD_TRACE_EXPERIMENTAL_RUNTIME_ID_ENABLED": [ { "implementation": "B", @@ -1617,8 +1600,10 @@ ], "default": null, "aliases": [ - "DD_SERVICE_NAME" - ] + "DD_SERVICE_NAME", + "OTEL_SERVICE_NAME" + ], + "allowed": ".+" } ], "DD_SERVICE_MAPPING": [ @@ -1643,20 +1628,21 @@ ], "DD_SPAN_SAMPLING_RULES": [ { - "implementation": "C", - "type": "array", + "implementation": "D", + "type": "json", "configurationNames": [ - "spanSamplingRules", - "sampler.spanSamplingRules" + "spanSamplingRules" ], - "default": null + "default": null, + "transform": "toCamelCase" } ], "DD_SPAN_SAMPLING_RULES_FILE": [ { - "implementation": "B", + "implementation": "A", "type": "string", - "default": "" + "default": null, + "transform": "readFilePath" } ], "DD_TAGS": [ @@ -1674,9 +1660,7 @@ "implementation": "A", "type": "boolean", "default": "false", - "configurationNames": [ - "telemetry.debug" - ] + "internalPropertyName": "telemetry.debug" } ], "DD_TELEMETRY_DEPENDENCY_COLLECTION_ENABLED": [ @@ -1684,9 +1668,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "telemetry.dependencyCollection" - ] + "internalPropertyName": "telemetry.dependencyCollection" } ], "DD_TELEMETRY_FORWARDER_PATH": [ @@ -1701,9 +1683,7 @@ "implementation": "B", "type": "decimal", "default": "60.0", - "configurationNames": [ - "telemetry.heartbeatInterval" - ] + "internalPropertyName": "telemetry.heartbeatInterval" } ], "DD_TELEMETRY_LOG_COLLECTION_ENABLED": [ @@ -1711,9 +1691,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "telemetry.logCollection" - ] + "internalPropertyName": "telemetry.logCollection" } ], "DD_TELEMETRY_METRICS_ENABLED": [ @@ -1721,9 +1699,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "telemetry.metrics" - ] + "internalPropertyName": "telemetry.metrics" } ], "DD_TEST_FAILED_TEST_REPLAY_ENABLED": [ @@ -1731,9 +1707,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "isTestDynamicInstrumentationEnabled" - ] + "internalPropertyName": "isTestDynamicInstrumentationEnabled" } ], "DD_TEST_FLEET_CONFIG_PATH": [ @@ -1755,9 +1729,7 @@ "implementation": "C", "type": "int", "default": "20", - "configurationNames": [ - "testManagementAttemptToFixRetries" - ] + "internalPropertyName": "testManagementAttemptToFixRetries" } ], "DD_TEST_MANAGEMENT_ENABLED": [ @@ -1765,9 +1737,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "isTestManagementEnabled" - ] + "internalPropertyName": "isTestManagementEnabled" } ], "DD_TEST_TIA_KEEP_COV_CONFIG": [ @@ -1775,9 +1745,7 @@ "implementation": "A", "type": "boolean", "default": "false", - "configurationNames": [ - "isKeepingCoverageConfiguration" - ] + "internalPropertyName": "isKeepingCoverageConfiguration" } ], "DD_TEST_SESSION_NAME": [ @@ -1785,9 +1753,7 @@ "implementation": "A", "type": "string", "default": null, - "configurationNames": [ - "ciVisibilityTestSessionName" - ] + "internalPropertyName": "ciVisibilityTestSessionName" } ], "DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED": [ @@ -1939,9 +1905,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "trace.aws.addSpanPointers" - ] + "internalPropertyName": "trace.aws.addSpanPointers" } ], "DD_TRACE_AWS_SDK_AWS_BATCH_PROPAGATION_ENABLED": [ @@ -2327,7 +2291,8 @@ "configurationNames": [ "clientIpHeader" ], - "default": null + "default": null, + "transform": "toLowerCase" } ], "DD_TRACE_CLOUD_PAYLOAD_TAGGING_MAX_DEPTH": [ @@ -2337,27 +2302,30 @@ "configurationNames": [ "cloudPayloadTagging.maxDepth" ], - "default": "10" + "default": "10", + "allowed": "\\d+" } ], "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": [ { "implementation": "A", - "type": "array", + "type": "string", "configurationNames": [ "cloudPayloadTagging.request" ], - "default": null + "default": null, + "transform": "splitJSONPathRules" } ], "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": [ { - "implementation": "A", - "type": "array", + "implementation": "B", + "type": "string", "configurationNames": [ "cloudPayloadTagging.response" ], - "default": null + "default": null, + "transform": "splitJSONPathRules" } ], "DD_TRACE_COLLECTIONS_ENABLED": [ @@ -2470,9 +2438,7 @@ "implementation": "A", "type": "string", "default": null, - "configurationNames": [ - "trace.dynamoDb.tablePrimaryKeys" - ] + "internalPropertyName": "trace.dynamoDb.tablePrimaryKeys" } ], "DD_TRACE_ELASTICSEARCH_ENABLED": [ @@ -2501,8 +2467,9 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "traceEnabled" + "internalPropertyName": "tracing", + "aliases": [ + "DD_TRACING_ENABLED" ] } ], @@ -2620,10 +2587,7 @@ { "implementation": "A", "type": "boolean", - "default": "true", - "configurationNames": [ - "isGCPPubSubPushSubscriptionEnabled" - ] + "default": "true" } ], "DD_TRACE_GENERIC_POOL_ENABLED": [ @@ -2638,9 +2602,7 @@ "implementation": "A", "type": "boolean", "default": "true", - "configurationNames": [ - "gitMetadataEnabled" - ] + "internalPropertyName": "gitMetadataEnabled" } ], "DD_TRACE_GOOGLE_CLOUD_PUBSUB_ENABLED": [ @@ -2683,9 +2645,7 @@ "implementation": "A", "type": "array", "default": "", - "configurationNames": [ - "graphqlErrorExtensions" - ] + "internalPropertyName": "graphqlErrorExtensions" } ], "DD_TRACE_GRAPHQL_TAG_ENABLED": [ @@ -2772,7 +2732,8 @@ "default": "", "configurationNames": [ "headerTags" - ] + ], + "transform": "stripColonWhitespace" } ], "DD_TRACE_HONO_ENABLED": [ @@ -3040,13 +3001,6 @@ "default": "true" } ], - "DD_TRACE_LOG_LEVEL": [ - { - "implementation": "C", - "type": "string", - "default": "debug" - } - ], "DD_TRACE_LOOPBACK_ENABLED": [ { "implementation": "A", @@ -3066,9 +3020,7 @@ "implementation": "A", "type": "boolean", "default": "false", - "configurationNames": [ - "memcachedCommandEnabled" - ] + "internalPropertyName": "memcachedCommandEnabled" } ], "DD_TRACE_MEMCACHED_ENABLED": [ @@ -3184,9 +3136,7 @@ "implementation": "A", "type": "boolean", "default": "false", - "configurationNames": [ - "trace.nativeSpanEvents" - ] + "internalPropertyName": "trace.nativeSpanEvents" } ], "DD_TRACE_NET_ENABLED": [ @@ -3236,9 +3186,7 @@ "implementation": "F", "type": "string", "default": "(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?|public_?|access_?|secret_?)key(?:_?id)?|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:(?:\\s|%20)*(?:=|%3D)[^&]+|(?:\"|%22)(?:\\s|%20)*(?::|%3A)(?:\\s|%20)*(?:\"|%22)(?:%2[^2]|%[^2]|[^\"%])+(?:\"|%22))|bearer(?:\\s|%20)+[a-z0-9\\._\\-]+|token(?::|%3A)[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L](?:[\\w=-]|%3D)+\\.ey[I-L](?:[\\w=-]|%3D)+(?:\\.(?:[\\w.+\\/=-]|%3D|%2F|%2B)+)?|[\\-]{5}BEGIN(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY[\\-]{5}[^\\-]+[\\-]{5}END(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY|ssh-rsa(?:\\s|%20)*(?:[a-z0-9\\/\\.+]|%2F|%5C|%2B){100,}", - "configurationNames": [ - "queryStringObfuscation" - ] + "internalPropertyName": "queryStringObfuscation" } ], "DD_TRACE_OPENAI_ENABLED": [ @@ -3429,10 +3377,10 @@ { "implementation": "B", "type": "string", + "allowed": "continue|restart|ignore", + "transform": "toLowerCase", "default": "continue", - "configurationNames": [ - "tracePropagationBehaviorExtract" - ] + "internalPropertyName": "tracePropagationBehaviorExtract" } ], "DD_TRACE_PROPAGATION_EXTRACT_FIRST": [ @@ -3440,19 +3388,18 @@ "implementation": "A", "type": "boolean", "default": "false", - "configurationNames": [ - "tracePropagationExtractFirst" - ] + "internalPropertyName": "tracePropagationExtractFirst" } ], "DD_TRACE_PROPAGATION_STYLE": [ { "implementation": "D", "type": "array", - "configurationNames": [ - "tracePropagationStyle" - ], - "default": "datadog,tracecontext,baggage" + "default": "datadog,tracecontext,baggage", + "transform": "validatePropagationStyles", + "aliases": [ + "OTEL_PROPAGATORS" + ] } ], "DD_TRACE_PROPAGATION_STYLE_EXTRACT": [ @@ -3462,7 +3409,8 @@ "configurationNames": [ "tracePropagationStyle.extract" ], - "default": "datadog, tracecontext, baggage" + "default": "datadog, tracecontext, baggage", + "transform": "toLowerCase" } ], "DD_TRACE_PROPAGATION_STYLE_INJECT": [ @@ -3472,7 +3420,8 @@ "configurationNames": [ "tracePropagationStyle.inject" ], - "default": "datadog, tracecontext, baggage" + "default": "datadog, tracecontext, baggage", + "transform": "toLowerCase" } ], "DD_TRACE_PROTOBUFJS_ENABLED": [ @@ -3501,8 +3450,8 @@ "implementation": "A", "type": "int", "configurationNames": [ - "ingestion.rateLimit", - "sampler.rateLimit" + "rateLimit", + "ingestion.rateLimit" ], "default": "100" } @@ -3567,9 +3516,7 @@ "implementation": "A", "type": "boolean", "default": "false", - "configurationNames": [ - "resourceRenamingEnabled" - ] + "internalPropertyName": "resourceRenamingEnabled" } ], "DD_TRACE_RESTIFY_ENABLED": [ @@ -3598,20 +3545,22 @@ "implementation": "B", "type": "decimal", "configurationNames": [ + "sampleRate", "ingestion.sampleRate" ], - "default": null + "default": null, + "transform": "sampleRate" } ], "DD_TRACE_SAMPLING_RULES": [ { - "implementation": "A", - "type": "array", + "implementation": "E", + "type": "json", "configurationNames": [ - "samplingRules", - "sampler.rules" + "samplingRules" ], - "default": "" + "default": "[]", + "transform": "toCamelCase" } ], "DD_TRACE_SCOPE": [ @@ -3619,9 +3568,7 @@ "implementation": "A", "type": "string", "default": null, - "configurationNames": [ - "scope" - ] + "internalPropertyName": "scope" } ], "DD_TRACE_SELENIUM_ENABLED": [ @@ -3663,6 +3610,8 @@ { "implementation": "B", "type": "string", + "allowed": "v0|v1", + "transform": "toLowerCase", "configurationNames": [ "spanAttributeSchema" ], @@ -3673,9 +3622,7 @@ { "implementation": "A", "type": "int", - "configurationNames": [ - "spanLeakDebug" - ], + "internalPropertyName": "spanLeakDebug", "default": "0" } ], @@ -3688,20 +3635,21 @@ ], "DD_TRACE_STARTUP_LOGS": [ { - "implementation": "D", + "implementation": "C", "type": "boolean", "configurationNames": [ "startupLogs" ], - "default": "false" + "default": "true" } ], "DD_TRACE_STATS_COMPUTATION_ENABLED": [ { "implementation": "A", "type": "boolean", + "internalPropertyName": "stats.enabled", "configurationNames": [ - "stats.enabled" + "stats" ], "default": "false" } @@ -3828,19 +3776,7 @@ "implementation": "A", "type": "int", "default": "512", - "configurationNames": [ - "tagsHeaderMaxLength" - ] - } - ], - "DD_TRACING_ENABLED": [ - { - "implementation": "A", - "type": "boolean", - "default": "true", - "configurationNames": [ - "tracing" - ] + "internalPropertyName": "tagsHeaderMaxLength" } ], "DD_VERSION": [ @@ -3858,9 +3794,7 @@ "implementation": "A", "type": "int", "default": "128", - "configurationNames": [ - "vertexai.spanCharLimit" - ] + "internalPropertyName": "vertexai.spanCharLimit" } ], "DD_VERTEXAI_SPAN_PROMPT_COMPLETION_SAMPLE_RATE": [ @@ -3868,9 +3802,7 @@ "implementation": "A", "type": "decimal", "default": "1", - "configurationNames": [ - "vertexai.spanPromptCompletionSampleRate" - ] + "internalPropertyName": "vertexai.spanPromptCompletionSampleRate" } ], "DD_VITEST_WORKER": [ @@ -3884,50 +3816,42 @@ { "implementation": "A", "type": "int", - "configurationNames": [ - "otelMaxExportBatchSize" - ], - "default": "512" + "internalPropertyName": "otelMaxExportBatchSize", + "default": "512", + "allowed": "[1-9]\\d*" } ], "OTEL_BSP_MAX_QUEUE_SIZE": [ { "implementation": "A", "type": "int", - "configurationNames": [ - "otelMaxQueueSize" - ], - "default": "2048" + "internalPropertyName": "otelMaxQueueSize", + "default": "2048", + "allowed": "[1-9]\\d*" } ], "OTEL_BSP_SCHEDULE_DELAY": [ { "implementation": "A", "type": "int", - "configurationNames": [ - "otelBatchTimeout" - ], - "default": "5000" + "internalPropertyName": "otelBatchTimeout", + "default": "5000", + "allowed": "[1-9]\\d*" } ], "OTEL_EXPORTER_OTLP_ENDPOINT": [ { "implementation": "A", "type": "string", - "default": null, - "configurationNames": [ - "otelUrl" - ] + "default": null } ], "OTEL_EXPORTER_OTLP_HEADERS": [ { - "implementation": "B", - "type": "map", + "implementation": "C", + "type": "string", "default": null, - "configurationNames": [ - "otelHeaders" - ] + "internalPropertyName": "otelHeaders" } ], "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT": [ @@ -3935,18 +3859,20 @@ "implementation": "A", "type": "string", "default": null, - "configurationNames": [ - "otelLogsUrl" + "internalPropertyName": "otelLogsUrl", + "aliases": [ + "OTEL_EXPORTER_OTLP_ENDPOINT" ] } ], "OTEL_EXPORTER_OTLP_LOGS_HEADERS": [ { - "implementation": "B", - "type": "map", + "implementation": "A", + "type": "string", "default": null, - "configurationNames": [ - "otelLogsHeaders" + "internalPropertyName": "otelLogsHeaders", + "aliases": [ + "OTEL_EXPORTER_OTLP_HEADERS" ] } ], @@ -3955,8 +3881,9 @@ "implementation": "D", "type": "string", "default": "http/protobuf", - "configurationNames": [ - "otelLogsProtocol" + "internalPropertyName": "otelLogsProtocol", + "aliases": [ + "OTEL_EXPORTER_OTLP_PROTOCOL" ] } ], @@ -3964,10 +3891,12 @@ { "implementation": "A", "type": "int", - "configurationNames": [ - "otelLogsTimeout" - ], - "default": "10000" + "internalPropertyName": "otelLogsTimeout", + "default": "10000", + "allowed": "[1-9]\\d*", + "aliases": [ + "OTEL_EXPORTER_OTLP_TIMEOUT" + ] } ], "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT": [ @@ -3975,18 +3904,20 @@ "implementation": "A", "type": "string", "default": null, - "configurationNames": [ - "otelMetricsUrl" + "internalPropertyName": "otelMetricsUrl", + "aliases": [ + "OTEL_EXPORTER_OTLP_ENDPOINT" ] } ], "OTEL_EXPORTER_OTLP_METRICS_HEADERS": [ { - "implementation": "A", - "type": "map", + "implementation": "B", + "type": "string", "default": null, - "configurationNames": [ - "otelMetricsHeaders" + "internalPropertyName": "otelMetricsHeaders", + "aliases": [ + "OTEL_EXPORTER_OTLP_HEADERS" ] } ], @@ -3995,8 +3926,9 @@ "implementation": "B", "type": "string", "default": "http/protobuf", - "configurationNames": [ - "otelMetricsProtocol" + "internalPropertyName": "otelMetricsProtocol", + "aliases": [ + "OTEL_EXPORTER_OTLP_PROTOCOL" ] } ], @@ -4004,9 +3936,9 @@ { "implementation": "A", "type": "string", - "configurationNames": [ - "otelMetricsTemporalityPreference" - ], + "allowed": "Delta|Cumulative|LowMemory", + "transform": "toUpperCase", + "internalPropertyName": "otelMetricsTemporalityPreference", "default": "delta" } ], @@ -4014,10 +3946,12 @@ { "implementation": "B", "type": "int", - "configurationNames": [ - "otelMetricsTimeout" - ], - "default": "10000" + "allowed": "[1-9]\\d*", + "internalPropertyName": "otelMetricsTimeout", + "default": "10000", + "aliases": [ + "OTEL_EXPORTER_OTLP_TIMEOUT" + ] } ], "OTEL_EXPORTER_OTLP_PROTOCOL": [ @@ -4025,18 +3959,15 @@ "implementation": "A", "type": "string", "default": "http/protobuf", - "configurationNames": [ - "otelProtocol" - ] + "internalPropertyName": "otelProtocol" } ], "OTEL_EXPORTER_OTLP_TIMEOUT": [ { - "implementation": "A", + "implementation": "Z", "type": "int", - "configurationNames": [ - "otelTimeout" - ], + "allowed": "[1-9]\\d*", + "internalPropertyName": "otelTimeout", "default": "10000" } ], @@ -4044,30 +3975,34 @@ { "implementation": "A", "type": "string", - "default": null + "default": null, + "allowed": "none|otlp", + "transform": "toLowerCase" } ], "OTEL_LOG_LEVEL": [ { "implementation": "C", "type": "string", - "default": null + "default": null, + "allowed": "debug|info|warn|error" } ], "OTEL_METRICS_EXPORTER": [ { "implementation": "C", "type": "string", - "default": null + "default": null, + "allowed": "none|otlp", + "transform": "toLowerCase" } ], "OTEL_METRIC_EXPORT_INTERVAL": [ { "implementation": "A", "type": "int", - "configurationNames": [ - "otelMetricsExportInterval" - ], + "allowed": "[1-9]\\d*", + "internalPropertyName": "otelMetricsExportInterval", "default": "10000" } ], @@ -4075,9 +4010,8 @@ { "implementation": "A", "type": "int", - "configurationNames": [ - "otelMetricsExportTimeout" - ], + "allowed": "[1-9]\\d*", + "internalPropertyName": "otelMetricsExportTimeout", "default": "7500" } ], @@ -4085,7 +4019,7 @@ { "implementation": "A", "type": "array", - "default": "", + "default": "datadog,tracecontext,baggage", "configurationNames": [ "tracePropagationStyle.otelPropagators" ] @@ -4095,7 +4029,8 @@ { "implementation": "B", "type": "string", - "default": "" + "default": "", + "transform": "parseOtelTags" } ], "OTEL_SDK_DISABLED": [ @@ -4105,38 +4040,30 @@ "default": "true" } ], - "OTEL_SERVICE_NAME": [ - { - "implementation": "B", - "type": "string", - "configurationNames": [ - "service" - ], - "default": null - } - ], "OTEL_TRACES_EXPORTER": [ { "implementation": "F", "type": "string", - "default": "otlp" + "default": "otlp", + "allowed": "none|otlp", + "transform": "toLowerCase" } ], "OTEL_TRACES_SAMPLER": [ { "implementation": "E", "type": "string", - "default": "parentbased_always_on" + "default": "parentbased_always_on", + "allowed": "always_on|always_off|traceidratio|parentbased_always_on|parentbased_always_off|parentbased_traceidratio", + "transform": "toLowerCase" } ], "OTEL_TRACES_SAMPLER_ARG": [ { "implementation": "D", "type": "decimal", - "configurationNames": [ - "sampleRate" - ], - "default": null + "default": null, + "allowed": "\\d+(\\.\\d+)?" } ] } diff --git a/packages/dd-trace/src/log/index.js b/packages/dd-trace/src/log/index.js index 7ff2a82fe99..2a2e72bf2a1 100644 --- a/packages/dd-trace/src/log/index.js +++ b/packages/dd-trace/src/log/index.js @@ -110,6 +110,7 @@ const log = { return isTrue( fleetStableConfigValue ?? getValueFromEnvSources('DD_TRACE_DEBUG') ?? + // eslint-disable-next-line eslint-rules/eslint-env-aliases (getValueFromEnvSources('OTEL_LOG_LEVEL') === 'debug' || undefined) ?? localStableConfigValue ?? config.enabled @@ -124,6 +125,7 @@ const log = { return optionsValue ?? fleetStableConfigValue ?? getValueFromEnvSources('DD_TRACE_LOG_LEVEL') ?? + // eslint-disable-next-line eslint-rules/eslint-env-aliases getValueFromEnvSources('OTEL_LOG_LEVEL') ?? localStableConfigValue ?? config.logLevel diff --git a/packages/dd-trace/src/profiling/exporter_cli.js b/packages/dd-trace/src/profiling/exporter_cli.js index cba3d6349b1..a122a334664 100644 --- a/packages/dd-trace/src/profiling/exporter_cli.js +++ b/packages/dd-trace/src/profiling/exporter_cli.js @@ -17,9 +17,6 @@ function exporterFromURL (url) { if (url.protocol === 'file:') { return new FileExporter({ pprofPrefix: fileURLToPath(url) }) } - // TODO: Why is DD_INJECTION_ENABLED a comma separated list? - const injectionEnabled = (getValueFromEnvSources('DD_INJECTION_ENABLED') ?? '').split(',') - const libraryInjected = injectionEnabled.length > 0 const profilingEnabled = (getValueFromEnvSources('DD_PROFILING_ENABLED') ?? '').toLowerCase() const activation = ['true', '1'].includes(profilingEnabled) ? 'manual' @@ -30,7 +27,7 @@ function exporterFromURL (url) { url, logger, uploadTimeout: timeoutMs, - libraryInjected, + libraryInjected: !!getValueFromEnvSources('DD_INJECTION_ENABLED'), activation, }) } diff --git a/packages/dd-trace/src/profiling/profiler.js b/packages/dd-trace/src/profiling/profiler.js index c107fc82750..e8b06719e54 100644 --- a/packages/dd-trace/src/profiling/profiler.js +++ b/packages/dd-trace/src/profiling/profiler.js @@ -95,7 +95,7 @@ class Profiler extends EventEmitter { error (...args) { log.error(...args) }, } - const libraryInjected = injectionEnabled.length > 0 + const libraryInjected = !!injectionEnabled let activation if (enabled === 'auto') { activation = 'auto' diff --git a/packages/dd-trace/src/telemetry/telemetry.js b/packages/dd-trace/src/telemetry/telemetry.js index e113bb9e077..152c6d7956d 100644 --- a/packages/dd-trace/src/telemetry/telemetry.js +++ b/packages/dd-trace/src/telemetry/telemetry.js @@ -450,10 +450,15 @@ const nameMapping = { injectForce: 'ssi_forced_injection_enabled', 'runtimeMetrics.enabled': 'runtimeMetrics', otelLogsEnabled: 'DD_LOGS_OTEL_ENABLED', + // eslint-disable-next-line eslint-rules/eslint-env-aliases otelUrl: 'OTEL_EXPORTER_OTLP_ENDPOINT', + // eslint-disable-next-line eslint-rules/eslint-env-aliases otelEndpoint: 'OTEL_EXPORTER_OTLP_ENDPOINT', + // eslint-disable-next-line eslint-rules/eslint-env-aliases otelHeaders: 'OTEL_EXPORTER_OTLP_HEADERS', + // eslint-disable-next-line eslint-rules/eslint-env-aliases otelProtocol: 'OTEL_EXPORTER_OTLP_PROTOCOL', + // eslint-disable-next-line eslint-rules/eslint-env-aliases otelTimeout: 'OTEL_EXPORTER_OTLP_TIMEOUT', otelLogsHeaders: 'OTEL_EXPORTER_OTLP_LOGS_HEADERS', otelLogsProtocol: 'OTEL_EXPORTER_OTLP_LOGS_PROTOCOL', diff --git a/packages/dd-trace/test/config/index.spec.js b/packages/dd-trace/test/config/index.spec.js index 16e8d53275e..221af5e98a3 100644 --- a/packages/dd-trace/test/config/index.spec.js +++ b/packages/dd-trace/test/config/index.spec.js @@ -42,6 +42,14 @@ describe('Config', () => { const comparator = (a, b) => a.name.localeCompare(b.name) || a.origin.localeCompare(b.origin) + function assertConfigUpdateContains (actual, expected) { + for (const entry of expected) { + const match = actual.find(actualEntry => actualEntry.name === entry.name && actualEntry.origin === entry.origin) + assert.ok(match, `Expected update for ${entry.name} (${entry.origin})`) + assertObjectContains(match, entry) + } + } + function reloadLoggerAndConfig () { log = proxyquire('../../src/log', {}) log.use = sinon.spy() @@ -110,9 +118,7 @@ describe('Config', () => { it('should return aliased value', () => { process.env.DATADOG_API_KEY = '12345' - assert.throws(() => getEnvironmentVariable('DATADOG_API_KEY'), { - message: /Missing DATADOG_API_KEY env\/configuration in "supported-configurations.json" file./, - }) + assert.strictEqual(getEnvironmentVariable('DATADOG_API_KEY'), '12345') assert.strictEqual(getEnvironmentVariable('DD_API_KEY'), '12345') const { DD_API_KEY, DATADOG_API_KEY } = getEnvironmentVariables() assert.strictEqual(DATADOG_API_KEY, undefined) @@ -436,7 +442,6 @@ describe('Config', () => { spanAttributeSchema: 'v0', spanComputePeerService: false, spanRemoveIntegrationFromService: false, - traceEnabled: true, traceId128BitGenerationEnabled: true, traceId128BitLoggingEnabled: true, tracePropagationBehaviorExtract: 'continue', @@ -445,7 +450,7 @@ describe('Config', () => { assert.deepStrictEqual(config.dynamicInstrumentation?.redactionExcludedIdentifiers, []) assert.deepStrictEqual(config.grpc.client.error.statuses, GRPC_CLIENT_ERROR_STATUSES) assert.deepStrictEqual(config.grpc.server.error.statuses, GRPC_SERVER_ERROR_STATUSES) - assert.deepStrictEqual(config.injectionEnabled, []) + assert.deepStrictEqual(config.injectionEnabled, undefined) assert.deepStrictEqual(config.serviceMapping, {}) assert.deepStrictEqual(config.tracePropagationStyle?.extract, ['datadog', 'tracecontext', 'baggage']) assert.deepStrictEqual(config.tracePropagationStyle?.inject, ['datadog', 'tracecontext', 'baggage']) @@ -455,7 +460,7 @@ describe('Config', () => { sinon.assert.calledOnce(updateConfig) - assertObjectContains(updateConfig.getCall(0).args[0].sort(comparator), [ + assertConfigUpdateContains(updateConfig.getCall(0).args[0], [ { name: 'apmTracingEnabled', value: true, origin: 'default' }, { name: 'appsec.apiSecurity.enabled', value: true, origin: 'default' }, { name: 'appsec.apiSecurity.sampleDelay', value: 30, origin: 'default' }, @@ -533,7 +538,7 @@ describe('Config', () => { { name: 'iast.stackTrace.enabled', value: true, origin: 'default' }, { name: 'iast.telemetryVerbosity', value: 'INFORMATION', origin: 'default' }, { name: 'injectForce', value: false, origin: 'default' }, - { name: 'injectionEnabled', value: [], origin: 'default' }, + { name: 'injectionEnabled', value: undefined, origin: 'default' }, { name: 'instrumentationSource', value: 'manual', origin: 'default' }, { name: 'isCiVisibility', value: false, origin: 'default' }, { name: 'isEarlyFlakeDetectionEnabled', value: true, origin: 'default' }, @@ -555,7 +560,7 @@ describe('Config', () => { { name: 'peerServiceMapping', value: {}, origin: 'default' }, { name: 'plugins', value: true, origin: 'default' }, { name: 'port', value: '8126', origin: 'default' }, - { name: 'profiling.enabled', value: false, origin: 'default' }, + { name: 'profiling.enabled', value: 'false', origin: 'default' }, { name: 'profiling.exporters', value: 'agent', origin: 'default' }, { name: 'profiling.sourceMap', value: true, origin: 'default' }, { name: 'protocolVersion', value: '0.4', origin: 'default' }, @@ -587,7 +592,6 @@ describe('Config', () => { { name: 'telemetry.heartbeatInterval', value: 60, origin: 'default' }, { name: 'telemetry.logCollection', value: true, origin: 'default' }, { name: 'telemetry.metrics', value: true, origin: 'default' }, - { name: 'traceEnabled', value: true, origin: 'default' }, { name: 'traceId128BitGenerationEnabled', value: true, origin: 'default' }, { name: 'traceId128BitLoggingEnabled', value: true, origin: 'default' }, { name: 'tracing', value: true, origin: 'default' }, @@ -595,7 +599,7 @@ describe('Config', () => { { name: 'version', value: '', origin: 'default' }, { name: 'vertexai.spanCharLimit', value: 128, origin: 'default' }, { name: 'vertexai.spanPromptCompletionSampleRate', value: 1.0, origin: 'default' }, - ].sort(comparator)) + ]) }) it('should support logging', () => { @@ -896,11 +900,10 @@ describe('Config', () => { version: '1.0.0', env: 'test', }, - traceEnabled: true, traceId128BitGenerationEnabled: true, traceId128BitLoggingEnabled: true, tracePropagationBehaviorExtract: 'restart', - tracing: false, + tracing: true, version: '1.0.0', }) assert.deepStrictEqual(config.grpc.client.error.statuses, [3, 13, 400, 401, 402, 403]) @@ -932,7 +935,7 @@ describe('Config', () => { sinon.assert.calledOnce(updateConfig) - assertObjectContains(updateConfig.getCall(0).args[0].sort(comparator), [ + assertConfigUpdateContains(updateConfig.getCall(0).args[0], [ { name: 'apmTracingEnabled', value: false, origin: 'env_var' }, { name: 'appsec.apiSecurity.enabled', value: true, origin: 'env_var' }, { name: 'appsec.apiSecurity.sampleDelay', value: 25, origin: 'env_var' }, @@ -996,7 +999,7 @@ describe('Config', () => { { name: 'iast.stackTrace.enabled', value: false, origin: 'env_var' }, { name: 'iast.telemetryVerbosity', value: 'DEBUG', origin: 'env_var' }, { name: 'injectForce', value: false, origin: 'env_var' }, - { name: 'injectionEnabled', value: ['tracer'], origin: 'env_var' }, + { name: 'injectionEnabled', value: 'tracer', origin: 'env_var' }, { name: 'instrumentation_config_id', value: 'abcdef123', origin: 'env_var' }, { name: 'instrumentationSource', value: 'ssi', origin: 'env_var' }, { name: 'isGCPFunction', value: false, origin: 'env_var' }, @@ -1023,11 +1026,11 @@ describe('Config', () => { { name: 'spanRemoveIntegrationFromService', value: true, origin: 'env_var' }, { name: 'traceId128BitGenerationEnabled', value: true, origin: 'env_var' }, { name: 'traceId128BitLoggingEnabled', value: true, origin: 'env_var' }, - { name: 'tracing', value: false, origin: 'env_var' }, + { name: 'tracing', value: true, origin: 'env_var' }, { name: 'version', value: '1.0.0', origin: 'env_var' }, { name: 'vertexai.spanCharLimit', value: 50, origin: 'env_var' }, { name: 'vertexai.spanPromptCompletionSampleRate', value: 0.5, origin: 'env_var' }, - ].sort(comparator)) + ]) }) it('should ignore empty strings', () => { @@ -1479,6 +1482,7 @@ describe('Config', () => { { name: 'iast.telemetryVerbosity', value: 'DEBUG', origin: 'code' }, { name: 'llmobs.agentlessEnabled', value: true, origin: 'code' }, { name: 'llmobs.mlApp', value: 'myMlApp', origin: 'code' }, + { name: 'logLevel', value: logLevel, origin: 'code' }, { name: 'middlewareTracingEnabled', value: false, origin: 'code' }, { name: 'peerServiceMapping', value: { d: 'dd' }, origin: 'code' }, { name: 'plugins', value: false, origin: 'code' },