zentol commented on a change in pull request #7582: [FLINK-11424][metrics]fix 
remove error type Gauge in DatadogHttpReporter
URL: https://github.com/apache/flink/pull/7582#discussion_r252639049
 
 

 ##########
 File path: 
flink-metrics/flink-metrics-datadog/src/main/java/org/apache/flink/metrics/datadog/DatadogHttpReporter.java
 ##########
 @@ -126,11 +126,14 @@ public void report() {
                                g.getMetricValue();
                                request.addGauge(g);
                        } catch (Exception e) {
-                               // Remove that Gauge if it's not of Number type
-                               gauges.remove(entry.getKey());
+                               LOGGER.warn("the Gauge {} is not of Number 
type", g.getMetric());
 
 Review comment:
   There are a few things I'd like to change here. First I'd like us to be able 
to differentiate between broken gauge implementations (throwing exceptions) and 
non-Number gauges (I guess resulting in a ClassCastException).
   
   Then, log on INFO either:
   `The Gauge {} will not be reported because only number types are supported 
by this reporter.`
   `The Gauge {} will not be reported because it threw an exception.`
   
   In case of a random exception, also log the exception on TRACE.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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