sijie commented on a change in pull request #1765: Use default metric registry in Prometheus exporter URL: https://github.com/apache/bookkeeper/pull/1765#discussion_r228747674
########## File path: bookkeeper-stats-providers/prometheus-metrics-provider/src/main/java/org/apache/bookkeeper/stats/prometheus/PrometheusMetricsProvider.java ########## @@ -128,10 +128,17 @@ public void start(Configuration conf) { } // Include standard JVM stats - new StandardExports().register(registry); - new MemoryPoolsExports().register(registry); - new GarbageCollectorExports().register(registry); - new ThreadExports().register(registry); + try { + new StandardExports().register(registry); + new MemoryPoolsExports().register(registry); + new GarbageCollectorExports().register(registry); + new ThreadExports().register(registry); + } catch (Exception e) { Review comment: this approach will cause some exports are not registered. for example, if `StandardExports` was registered but no the others, this approach will cause the others being skipped. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services