Skip to content

Commit d6e7ed8

Browse files
bm1549claude
andcommitted
fix: add stable_config to BUILD.bazel, remove fake product defaults
- Add stable_config.cpp and stable_config.h to Bazel build - Remove hardcoded product defaults from parametric server — C++ should not fake values for products it doesn't support (profiling, runtime metrics, data streams, logs injection, dynamic instrumentation). The system tests are updated to not enforce those defaults for C++. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent f380c1d commit d6e7ed8

2 files changed

Lines changed: 5 additions & 20 deletions

File tree

BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ cc_library(
8181
"src/datadog/trace_segment.cpp",
8282
"src/datadog/trace_source.cpp",
8383
"src/datadog/tracer.cpp",
84+
"src/datadog/stable_config.cpp",
85+
"src/datadog/stable_config.h",
8486
"src/datadog/tracer_config.cpp",
8587
"src/datadog/version.cpp",
8688
"src/datadog/w3c_propagation.cpp",

test/system-tests/request_handler.cpp

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -94,28 +94,11 @@ void RequestHandler::on_trace_config(const httplib::Request& /* req */,
9494
return val;
9595
};
9696

97-
// Default values for keys that dd-trace-cpp doesn't natively support
98-
// but the system tests expect. These represent the product enablement
99-
// defaults for features not available in the C++ tracer.
100-
const std::unordered_map<std::string, std::string> product_defaults = {
101-
{"DD_PROFILING_ENABLED", "false"},
102-
{"DD_RUNTIME_METRICS_ENABLED", "false"},
103-
{"DD_DATA_STREAMS_ENABLED", "false"},
104-
{"DD_LOGS_INJECTION", "false"},
105-
{"DD_DYNAMIC_INSTRUMENTATION_ENABLED", "false"},
106-
};
107-
108-
// Start with product defaults, then overlay stable config, then env vars.
109-
// This produces the merged effective config with correct precedence.
110-
// Precedence: fleet_stable > env > local_stable > product_default
97+
// Merge stable config and env var values with correct precedence.
98+
// Precedence: fleet_stable > env > local_stable
11199
std::unordered_map<std::string, std::string> effective_config;
112100

113-
// 1. Product defaults (lowest precedence for non-native keys)
114-
for (const auto& [key, value] : product_defaults) {
115-
effective_config[key] = value;
116-
}
117-
118-
// 2. Local stable config
101+
// 1. Local stable config (lowest precedence)
119102
for (const auto& [key, value] : local_stable_config_values_) {
120103
effective_config[key] = normalize_value(value);
121104
}

0 commit comments

Comments
 (0)