NicoK commented on a change in pull request #8990: [FLINK-13104][metrics] 
Updated request callback to log warning on failure
URL: https://github.com/apache/flink/pull/8990#discussion_r303484312
 
 

 ##########
 File path: 
flink-metrics/flink-metrics-datadog/src/main/java/org/apache/flink/metrics/datadog/DatadogHttpClient.java
 ##########
 @@ -133,6 +143,11 @@ public void onFailure(Call call, IOException e) {
 
                @Override
                public void onResponse(Call call, Response response) throws 
IOException {
+
+                       if (!response.isSuccessful()) {
+                               
getLogger().warn(FAILED_SENDING_REQUEST_TO_DATADOG, response.code());
 
 Review comment:
   How about using this?
   ```
   LOGGER.warn("Failed to send request to Datadog (response was {})", response);
   ```
   
   Its `toString()` method would print everything you would need for debugging:
   ```
     @Override public String toString() {
       return "Response{protocol="
           + protocol
           + ", code="
           + code
           + ", message="
           + message
           + ", url="
           + request.url()
           + '}';
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to