@@ -25,7 +25,7 @@ const StringView traces_api_path = "/v0.4/traces";
2525
2626HTTPClient::URL traces_endpoint (const HTTPClient::URL& agent_url) {
2727 auto traces_url = agent_url;
28- traces_url.path += traces_api_path;
28+ append ( traces_url.path , traces_api_path) ;
2929 return traces_url;
3030}
3131
@@ -59,10 +59,10 @@ std::variant<CollectorResponse, std::string> parse_agent_traces_response(
5959 " Parsing the Datadog Agent's response to traces we sent it failed. "
6060 " The response is expected to be a JSON object, but instead it's a JSON "
6161 " value with type \" " ;
62- message += type;
62+ append ( message, type) ;
6363 message += ' \" ' ;
6464 message += " \n Error occurred for response body (begins on next line):\n " ;
65- message += body;
65+ append ( message, body) ;
6666 return message;
6767 }
6868
@@ -78,14 +78,14 @@ std::variant<CollectorResponse, std::string> parse_agent_traces_response(
7878 message +=
7979 " Parsing the Datadog Agent's response to traces we sent it failed. "
8080 " The \" " ;
81- message += sample_rates_property;
81+ append ( message, sample_rates_property) ;
8282 message +=
8383 " \" property of the response is expected to be a JSON object, but "
8484 " instead it's a JSON value with type \" " ;
85- message += type;
85+ append ( message, type) ;
8686 message += ' \" ' ;
8787 message += " \n Error occurred for response body (begins on next line):\n " ;
88- message += body;
88+ append ( message, body) ;
8989 return message;
9090 }
9191
@@ -99,10 +99,10 @@ std::variant<CollectorResponse, std::string> parse_agent_traces_response(
9999 " for the key \" " ;
100100 message += key;
101101 message += " \" . Rate should be a number, but it's a \" " ;
102- message += type;
102+ append ( message, type) ;
103103 message += " \" instead." ;
104104 message += " \n Error occurred for response body (begins on next line):\n " ;
105- message += body;
105+ append ( message, body) ;
106106 return message;
107107 }
108108 auto maybe_rate = Rate::from (value);
@@ -115,7 +115,7 @@ std::variant<CollectorResponse, std::string> parse_agent_traces_response(
115115 message += " \" : " ;
116116 message += error->message ;
117117 message += " \n Error occurred for response body (begins on next line):\n " ;
118- message += body;
118+ append ( message, body) ;
119119 return message;
120120 }
121121 sample_rates.emplace (key, *maybe_rate);
@@ -128,7 +128,7 @@ std::variant<CollectorResponse, std::string> parse_agent_traces_response(
128128 " JSON error: " ;
129129 message += error.what ();
130130 message += " \n Error occurred for response body (begins on next line):\n " ;
131- message += body;
131+ append ( message, body) ;
132132 return message;
133133}
134134
@@ -161,7 +161,7 @@ Expected<void> DatadogAgent::send(
161161 std::lock_guard<std::mutex> lock (mutex_);
162162 incoming_trace_chunks_.push_back (
163163 TraceChunk{std::move (spans), response_handler});
164- return std:: nullopt ;
164+ return nullopt ;
165165}
166166
167167nlohmann::json DatadogAgent::config_json () const {
0 commit comments