You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/02/14 09:16:53 UTC

[GitHub] jinglining commented on a change in pull request #7582: [FLINK-11424][metrics]fix remove error type Gauge in DatadogHttpReporter

jinglining 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_r256746411
 
 

 ##########
 File path: flink-metrics/flink-metrics-datadog/src/main/java/org/apache/flink/metrics/datadog/DatadogHttpReporter.java
 ##########
 @@ -125,9 +125,13 @@ public void report() {
 				// Flink uses Gauge to store many types other than Number
 				g.getMetricValue();
 				request.addGauge(g);
-			} catch (Exception e) {
+			} catch (ClassCastException e) {
 				LOGGER.info("The Gauge {} will not be reported because only number types are supported by this reporter.", g.getMetric());
 				gaugesToRemove.add(entry.getKey());
+			} catch (Exception e) {
+				LOGGER.info("The Gauge {} will not be reported because it threw an exception.", g.getMetric());
+				LOGGER.warn("Failed add gauge metric.", e);
+				gaugesToRemove.add(entry.getKey());
 			}
 
 Review comment:
   @zentol  is it ok?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services