Skip to content

Commit 9a4ee58

Browse files
Remove the remote config check asserting a matching env / service, as this is incorrect behavior
1 parent 1a5985e commit 9a4ee58

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

src/datadog/config_manager.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,6 @@ Optional<std::string> ConfigManager::on_update(const Configuration& config) {
151151

152152
const auto config_json = nlohmann::json::parse(config.content);
153153

154-
const auto& targeted_service = config_json.at("service_target");
155-
if (targeted_service.at("service").get<StringView>() !=
156-
tracer_signature_.default_service ||
157-
targeted_service.at("env").get<StringView>() !=
158-
tracer_signature_.default_environment) {
159-
return "Wrong service targeted";
160-
}
161-
162154
auto config_update = parse_dynamic_config(config_json.at("lib_config"));
163155

164156
auto config_metadata = apply_update(config_update);

test/test_config_manager.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,6 @@ CONFIG_MANAGER_TEST("remote configuration handling") {
3838
/* version = */ 1,
3939
rc::product::Flag::APM_TRACING};
4040

41-
SECTION(
42-
"configuration updates targetting the wrong tracer reports an error") {
43-
// clang-format off
44-
auto test_case = GENERATE(values<std::string>({
45-
R"({ "service_target": { "service": "not-testsvc", "env": "test" } })",
46-
R"({ "service_target": { "service": "testsvc", "env": "not-test" } })"
47-
}));
48-
// clang-format on
49-
50-
CAPTURE(test_case);
51-
52-
config_update.content = test_case;
53-
54-
// TODO: targetting wrong procut -> error
55-
const auto err = config_manager.on_update(config_update);
56-
CHECK(err);
57-
}
58-
5941
SECTION("handling of `tracing_sampling_rate`") {
6042
// SECTION("invalid value") {
6143
// config_update.content = R"({

0 commit comments

Comments
 (0)