nastra commented on code in PR #11416:
URL: https://github.com/apache/iceberg/pull/11416#discussion_r1820315278


##########
core/src/main/java/org/apache/iceberg/SnapshotScan.java:
##########
@@ -154,7 +155,17 @@ public CloseableIterable<T> planFiles() {
                   
.scanMetrics(ScanMetricsResult.fromScanMetrics(scanMetrics()))
                   .metadata(metadata)
                   .build();
-          context().metricsReporter().report(scanReport);
+          MetricsReporter metricsReporter = context().metricsReporter();
+          if (metricsReporter != null) {
+            try {
+              metricsReporter.report(scanReport);
+            } catch (Exception e) {
+              LOG.warn(
+                  "MetricsReporter threw an exception. metricsReporter={}",
+                  metricsReporter.getClass().getName(),

Review Comment:
   I agree here. The metrics reporter itself has enough context and can log why 
reporting failed



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to