@@ -164,23 +164,20 @@ Expected<void> DatadogAgent::send(
164164 return std::nullopt ;
165165}
166166
167- void DatadogAgent::config_json (nlohmann::json& destination ) const {
167+ nlohmann::json DatadogAgent::config_json () const {
168168 const auto & url = traces_endpoint_; // brevity
169169 const auto flush_interval_milliseconds =
170170 std::chrono::duration_cast<std::chrono::milliseconds>(flush_interval_)
171171 .count ();
172- nlohmann::json http_client_json, event_scheduler_json;
173- http_client_->config_json (http_client_json);
174- event_scheduler_->config_json (event_scheduler_json);
175172
176173 // clang-format off
177- destination = nlohmann::json::object ({
174+ return nlohmann::json::object ({
178175 {" type" , " datadog::tracing::DatadogAgent" },
179176 {" config" , nlohmann::json::object ({
180177 {" url" , (url.scheme + " ://" + url.authority + url.path )},
181178 {" flush_interval_milliseconds" , flush_interval_milliseconds},
182- {" http_client" , http_client_json },
183- {" event_scheduler" , event_scheduler_json },
179+ {" http_client" , http_client_-> config_json () },
180+ {" event_scheduler" , event_scheduler_-> config_json () },
184181 })},
185182 });
186183 // clang-format on
0 commit comments