yihua commented on code in PR #8997:
URL: https://github.com/apache/hudi/pull/8997#discussion_r1233398530


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metrics/datadog/DatadogHttpClient.java:
##########
@@ -84,8 +84,8 @@ private void validateApiKey() {
     try (CloseableHttpResponse response = client.execute(request)) {
       int statusCode = response.getStatusLine().getStatusCode();
       ValidationUtils.checkState(statusCode == HttpStatus.SC_OK, "API key is 
invalid.");
-    } catch (IOException e) {
-      throw new IllegalStateException("Failed to connect to Datadog to 
validate API key.", e);
+    } catch (IOException | IllegalStateException e) {
+      LOG.warn(String.format("Failed to connect to Datadog to validate API 
key. %s", e.getMessage()));

Review Comment:
   What I meant is, we should not change the behavior of throwing an exception 
here.  If the metric collection does not work due to API key, it should fail 
the job so that the user knows and fixes it before proceeding.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to