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_r252626021
##########
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());
+ notNumberGauges.add(entry.getKey());
}
}
-
+ // Remove that Gauge if it's not of Number type
+ if (!notNumberGauges.isEmpty()) {
+ notNumberGauges.stream().forEach(g -> gauges.remove(g));
Review comment:
can be shortened to `notNumberGauges.forEach(gauges::remove);`
----------------------------------------------------------------
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