From a345bd0bcbc264ca4fb3649eb697da6d117c752f Mon Sep 17 00:00:00 2001 From: Benjamin De Bernardi Date: Fri, 3 Apr 2026 16:56:37 +0200 Subject: [PATCH 1/4] fix(config-inversion): lowercase type fields in supported-configurations --- supported-configurations.json | 82 ++++++++++++++++----------------- tools/config-inversion/main.cpp | 8 +++- 2 files changed, 48 insertions(+), 42 deletions(-) diff --git a/supported-configurations.json b/supported-configurations.json index 6f5e3d790..94a459ade 100644 --- a/supported-configurations.json +++ b/supported-configurations.json @@ -4,287 +4,287 @@ { "default": "localhost", "implementation": "A", - "type": "STRING" + "type": "string" } ], "DD_APM_TRACING_ENABLED": [ { "default": "1", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_ENV": [ { "default": "", "implementation": "A", - "type": "STRING" + "type": "string" } ], "DD_EXTERNAL_ENV": [ { "default": "", "implementation": "A", - "type": "STRING" + "type": "string" } ], "DD_INSTRUMENTATION_INSTALL_ID": [ { "default": "", "implementation": "A", - "type": "STRING" + "type": "string" } ], "DD_INSTRUMENTATION_INSTALL_TIME": [ { "default": "", "implementation": "A", - "type": "STRING" + "type": "string" } ], "DD_INSTRUMENTATION_INSTALL_TYPE": [ { "default": "", "implementation": "A", - "type": "STRING" + "type": "string" } ], "DD_INSTRUMENTATION_TELEMETRY_ENABLED": [ { "default": "1", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_PROPAGATION_STYLE_EXTRACT": [ { "default": "datadog,tracecontext,baggage", "implementation": "A", - "type": "ARRAY" + "type": "array" } ], "DD_PROPAGATION_STYLE_INJECT": [ { "default": "datadog,tracecontext,baggage", "implementation": "A", - "type": "ARRAY" + "type": "array" } ], "DD_REMOTE_CONFIGURATION_ENABLED": [ { "default": "1", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS": [ { "default": "5", "implementation": "A", - "type": "DECIMAL" + "type": "decimal" } ], "DD_SERVICE": [ { "default": "", "implementation": "A", - "type": "STRING" + "type": "string" } ], "DD_SPAN_SAMPLING_RULES": [ { "default": "[]", "implementation": "A", - "type": "ARRAY" + "type": "array" } ], "DD_SPAN_SAMPLING_RULES_FILE": [ { "default": "", "implementation": "A", - "type": "STRING" + "type": "string" } ], "DD_TAGS": [ { "default": "", "implementation": "A", - "type": "MAP" + "type": "map" } ], "DD_TELEMETRY_DEBUG": [ { "default": "0", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL": [ { "default": "86400", "implementation": "A", - "type": "DECIMAL" + "type": "decimal" } ], "DD_TELEMETRY_HEARTBEAT_INTERVAL": [ { "default": "10", "implementation": "A", - "type": "DECIMAL" + "type": "decimal" } ], "DD_TELEMETRY_LOG_COLLECTION_ENABLED": [ { "default": "1", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_TELEMETRY_METRICS_ENABLED": [ { "default": "1", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_TELEMETRY_METRICS_INTERVAL_SECONDS": [ { "default": "60", "implementation": "A", - "type": "DECIMAL" + "type": "decimal" } ], "DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED": [ { "default": "1", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_TRACE_AGENT_PORT": [ { "default": "8126", "implementation": "A", - "type": "INT" + "type": "int" } ], "DD_TRACE_AGENT_URL": [ { "default": "", "implementation": "A", - "type": "STRING" + "type": "string" } ], "DD_TRACE_BAGGAGE_MAX_BYTES": [ { "default": "8192", "implementation": "A", - "type": "INT" + "type": "int" } ], "DD_TRACE_BAGGAGE_MAX_ITEMS": [ { "default": "64", "implementation": "A", - "type": "INT" + "type": "int" } ], "DD_TRACE_DEBUG": [ { "default": "0", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_TRACE_ENABLED": [ { "default": "1", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_TRACE_PROPAGATION_STYLE": [ { "default": "datadog,tracecontext,baggage", "implementation": "A", - "type": "ARRAY" + "type": "array" } ], "DD_TRACE_PROPAGATION_STYLE_EXTRACT": [ { "default": "datadog,tracecontext,baggage", "implementation": "A", - "type": "ARRAY" + "type": "array" } ], "DD_TRACE_PROPAGATION_STYLE_INJECT": [ { "default": "datadog,tracecontext,baggage", "implementation": "A", - "type": "ARRAY" + "type": "array" } ], "DD_TRACE_RATE_LIMIT": [ { "default": "100", "implementation": "A", - "type": "DECIMAL" + "type": "decimal" } ], "DD_TRACE_REPORT_HOSTNAME": [ { "default": "0", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_TRACE_RESOURCE_RENAMING_ALWAYS_SIMPLIFIED_ENDPOINT": [ { "default": "0", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_TRACE_RESOURCE_RENAMING_ENABLED": [ { "default": "0", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_TRACE_SAMPLE_RATE": [ { "default": "1", "implementation": "A", - "type": "DECIMAL" + "type": "decimal" } ], "DD_TRACE_SAMPLING_RULES": [ { "default": "[]", "implementation": "A", - "type": "ARRAY" + "type": "array" } ], "DD_TRACE_STARTUP_LOGS": [ { "default": "1", "implementation": "A", - "type": "BOOLEAN" + "type": "boolean" } ], "DD_TRACE_TAGS_PROPAGATION_MAX_LENGTH": [ { "default": "512", "implementation": "A", - "type": "INT" + "type": "int" } ], "DD_VERSION": [ { "default": "", "implementation": "A", - "type": "STRING" + "type": "string" } ] }, diff --git a/tools/config-inversion/main.cpp b/tools/config-inversion/main.cpp index 1bef85ddd..1ea6e00c4 100644 --- a/tools/config-inversion/main.cpp +++ b/tools/config-inversion/main.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -33,7 +34,12 @@ nlohmann::json build_configuration() { auto obj = nlohmann::json::object(); \ obj["default"] = to_string_any(DEFAULT_VALUE); \ obj["implementation"] = "A"; \ - obj["type"] = QUOTED(TYPE); \ + { \ + std::string type_str = QUOTED(TYPE); \ + std::transform(type_str.begin(), type_str.end(), type_str.begin(), \ + [](unsigned char c) { return std::tolower(c); }); \ + obj["type"] = type_str; \ + } \ supported_configurations[QUOTED(NAME)] = nlohmann::json::array({obj}); \ } while (0); From a728db4d6fa1ef8cb80a284efa2cedf3c20b332c Mon Sep 17 00:00:00 2001 From: Benjamin De Bernardi Date: Fri, 3 Apr 2026 17:33:48 +0200 Subject: [PATCH 2/4] fix(config-inversion): preserve implementation versions from existing JSON --- supported-configurations.json | 20 ++++++++++---------- tools/config-inversion/main.cpp | 32 +++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/supported-configurations.json b/supported-configurations.json index 94a459ade..04161fc94 100644 --- a/supported-configurations.json +++ b/supported-configurations.json @@ -59,14 +59,14 @@ "DD_PROPAGATION_STYLE_EXTRACT": [ { "default": "datadog,tracecontext,baggage", - "implementation": "A", + "implementation": "C", "type": "array" } ], "DD_PROPAGATION_STYLE_INJECT": [ { "default": "datadog,tracecontext,baggage", - "implementation": "A", + "implementation": "C", "type": "array" } ], @@ -87,7 +87,7 @@ "DD_SERVICE": [ { "default": "", - "implementation": "A", + "implementation": "F", "type": "string" } ], @@ -101,7 +101,7 @@ "DD_SPAN_SAMPLING_RULES_FILE": [ { "default": "", - "implementation": "A", + "implementation": "B", "type": "string" } ], @@ -129,7 +129,7 @@ "DD_TELEMETRY_HEARTBEAT_INTERVAL": [ { "default": "10", - "implementation": "A", + "implementation": "D", "type": "decimal" } ], @@ -206,21 +206,21 @@ "DD_TRACE_PROPAGATION_STYLE": [ { "default": "datadog,tracecontext,baggage", - "implementation": "A", + "implementation": "D", "type": "array" } ], "DD_TRACE_PROPAGATION_STYLE_EXTRACT": [ { "default": "datadog,tracecontext,baggage", - "implementation": "A", + "implementation": "D", "type": "array" } ], "DD_TRACE_PROPAGATION_STYLE_INJECT": [ { "default": "datadog,tracecontext,baggage", - "implementation": "A", + "implementation": "D", "type": "array" } ], @@ -255,14 +255,14 @@ "DD_TRACE_SAMPLE_RATE": [ { "default": "1", - "implementation": "A", + "implementation": "C", "type": "decimal" } ], "DD_TRACE_SAMPLING_RULES": [ { "default": "[]", - "implementation": "A", + "implementation": "D", "type": "array" } ], diff --git a/tools/config-inversion/main.cpp b/tools/config-inversion/main.cpp index 1ea6e00c4..65b8dc3cc 100644 --- a/tools/config-inversion/main.cpp +++ b/tools/config-inversion/main.cpp @@ -18,7 +18,23 @@ std::string to_string_any(const T& value) { return oss.str(); } -nlohmann::json build_configuration() { +// Look up the existing implementation version for a config name from a +// previously generated JSON. Returns "A" if not found. +std::string existing_version(const nlohmann::json& existing, + const std::string& name) { + if (existing.contains("supportedConfigurations")) { + const auto& sc = existing["supportedConfigurations"]; + if (sc.contains(name) && sc[name].is_array() && !sc[name].empty()) { + const auto& first = sc[name][0]; + if (first.contains("implementation")) { + return first["implementation"].get(); + } + } + } + return "A"; +} + +nlohmann::json build_configuration(const nlohmann::json& existing) { nlohmann::json j; j["version"] = "2"; @@ -33,7 +49,7 @@ nlohmann::json build_configuration() { do { \ auto obj = nlohmann::json::object(); \ obj["default"] = to_string_any(DEFAULT_VALUE); \ - obj["implementation"] = "A"; \ + obj["implementation"] = existing_version(existing, QUOTED(NAME)); \ { \ std::string type_str = QUOTED(TYPE); \ std::transform(type_str.begin(), type_str.end(), type_str.begin(), \ @@ -70,7 +86,17 @@ int main(int argc, char** argv) { const fs::path output_file = result["output-file"].as(); - const auto j = build_configuration(); + // Read existing file to preserve implementation versions. + nlohmann::json existing; + { + std::ifstream in(output_file); + if (in) { + existing = nlohmann::json::parse(in, nullptr, false); + if (existing.is_discarded()) existing = nlohmann::json::object(); + } + } + + const auto j = build_configuration(existing); std::ofstream file(output_file, std::ios::binary); if (!file) { std::cerr << "Unable to write configuration file"; From b83639da7b41e7cb004a387b57ccbe8ced867350 Mon Sep 17 00:00:00 2001 From: Benjamin De Bernardi Date: Tue, 7 Apr 2026 22:00:41 +0200 Subject: [PATCH 3/4] fix(config-inversion): serialize boolean defaults and fix versions --- supported-configurations.json | 44 ++++++++++++++++----------------- tools/config-inversion/main.cpp | 3 ++- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/supported-configurations.json b/supported-configurations.json index 04161fc94..fa9e76ea7 100644 --- a/supported-configurations.json +++ b/supported-configurations.json @@ -9,7 +9,7 @@ ], "DD_APM_TRACING_ENABLED": [ { - "default": "1", + "default": "true", "implementation": "A", "type": "boolean" } @@ -24,34 +24,34 @@ "DD_EXTERNAL_ENV": [ { "default": "", - "implementation": "A", + "implementation": "B", "type": "string" } ], "DD_INSTRUMENTATION_INSTALL_ID": [ { "default": "", - "implementation": "A", + "implementation": "B", "type": "string" } ], "DD_INSTRUMENTATION_INSTALL_TIME": [ { "default": "", - "implementation": "A", + "implementation": "B", "type": "string" } ], "DD_INSTRUMENTATION_INSTALL_TYPE": [ { "default": "", - "implementation": "A", + "implementation": "B", "type": "string" } ], "DD_INSTRUMENTATION_TELEMETRY_ENABLED": [ { - "default": "1", + "default": "true", "implementation": "A", "type": "boolean" } @@ -72,7 +72,7 @@ ], "DD_REMOTE_CONFIGURATION_ENABLED": [ { - "default": "1", + "default": "true", "implementation": "A", "type": "boolean" } @@ -80,7 +80,7 @@ "DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS": [ { "default": "5", - "implementation": "A", + "implementation": "C", "type": "decimal" } ], @@ -114,7 +114,7 @@ ], "DD_TELEMETRY_DEBUG": [ { - "default": "0", + "default": "false", "implementation": "A", "type": "boolean" } @@ -122,7 +122,7 @@ "DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL": [ { "default": "86400", - "implementation": "A", + "implementation": "B", "type": "decimal" } ], @@ -135,14 +135,14 @@ ], "DD_TELEMETRY_LOG_COLLECTION_ENABLED": [ { - "default": "1", + "default": "true", "implementation": "A", "type": "boolean" } ], "DD_TELEMETRY_METRICS_ENABLED": [ { - "default": "1", + "default": "true", "implementation": "A", "type": "boolean" } @@ -156,7 +156,7 @@ ], "DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED": [ { - "default": "1", + "default": "true", "implementation": "A", "type": "boolean" } @@ -191,14 +191,14 @@ ], "DD_TRACE_DEBUG": [ { - "default": "0", - "implementation": "A", + "default": "false", + "implementation": "B", "type": "boolean" } ], "DD_TRACE_ENABLED": [ { - "default": "1", + "default": "true", "implementation": "A", "type": "boolean" } @@ -227,27 +227,27 @@ "DD_TRACE_RATE_LIMIT": [ { "default": "100", - "implementation": "A", + "implementation": "C", "type": "decimal" } ], "DD_TRACE_REPORT_HOSTNAME": [ { - "default": "0", + "default": "false", "implementation": "A", "type": "boolean" } ], "DD_TRACE_RESOURCE_RENAMING_ALWAYS_SIMPLIFIED_ENDPOINT": [ { - "default": "0", + "default": "false", "implementation": "A", "type": "boolean" } ], "DD_TRACE_RESOURCE_RENAMING_ENABLED": [ { - "default": "0", + "default": "false", "implementation": "A", "type": "boolean" } @@ -268,8 +268,8 @@ ], "DD_TRACE_STARTUP_LOGS": [ { - "default": "1", - "implementation": "A", + "default": "true", + "implementation": "C", "type": "boolean" } ], diff --git a/tools/config-inversion/main.cpp b/tools/config-inversion/main.cpp index 65b8dc3cc..539fbfc2c 100644 --- a/tools/config-inversion/main.cpp +++ b/tools/config-inversion/main.cpp @@ -14,7 +14,8 @@ namespace env = datadog::tracing::environment; template std::string to_string_any(const T& value) { std::ostringstream oss; - oss << value; + // boolalpha ensures bools are serialized as "true"/"false" instead of "1"/"0". + oss << std::boolalpha << value; return oss.str(); } From 64a792f837fb9de09b9f8aae2cb750e0ee883303 Mon Sep 17 00:00:00 2001 From: Benjamin De Bernardi Date: Tue, 7 Apr 2026 22:06:07 +0200 Subject: [PATCH 4/4] fix(ci): enable backfilled validation for supported configurations --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4c06787a4..a63dc2e74 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,7 @@ validate_supported_configurations_v2_local_file: extends: .validate_supported_configurations_v2_local_file variables: LOCAL_JSON_PATH: "supported-configurations.json" - BACKFILLED: false + BACKFILLED: true update_central_configurations_version_range_v2: stage: config-validation