nsivabalan commented on code in PR #10068:
URL: https://github.com/apache/hudi/pull/10068#discussion_r1397982302


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metrics/prometheus/PrometheusReporter.java:
##########
@@ -18,42 +18,75 @@
 
 package org.apache.hudi.metrics.prometheus;
 
+import org.apache.hudi.common.util.StringUtils;
 import org.apache.hudi.config.HoodieWriteConfig;
 import org.apache.hudi.exception.HoodieException;
 import org.apache.hudi.metrics.MetricsReporter;
 
 import com.codahale.metrics.MetricRegistry;
+import io.prometheus.client.Collector;
 import io.prometheus.client.CollectorRegistry;
 import io.prometheus.client.dropwizard.DropwizardExports;
+import io.prometheus.client.dropwizard.samplebuilder.DefaultSampleBuilder;
+import io.prometheus.client.dropwizard.samplebuilder.SampleBuilder;
 import io.prometheus.client.exporter.HTTPServer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.net.InetSocketAddress;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
 
 /**
  * Implementation of Prometheus reporter, which connects to the Http server, 
and get metrics
  * from that server.
  */
 public class PrometheusReporter extends MetricsReporter {
+  private static final Pattern LABEL_PATTERN = Pattern.compile("\\s*,\\s*");
 
   private static final Logger LOG = 
LoggerFactory.getLogger(PrometheusReporter.class);
+  private static final Map<Integer, CollectorRegistry> 
PORT_TO_COLLECTOR_REGISTRY = new HashMap<>();
+  private static final Map<Integer, HTTPServer> PORT_TO_SERVER = new 
HashMap<>();

Review Comment:
   I am stopping all http server instances(after your suggestion). but the 
entire instance of PrometheusReporter will be invalid or GCed. So, not sure if 
we need to remove entries from map. 



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

Reply via email to