kuszz commented on code in PR #1991:
URL: 
https://github.com/apache/incubator-uniffle/pull/1991#discussion_r1701175318


##########
pom.xml:
##########
@@ -105,6 +105,7 @@
     <skipITs>${skipTests}</skipITs>
     <skipBuildImage>true</skipBuildImage>
     <snakeyaml.version>2.2</snakeyaml.version>
+    <prometheus.version>0.8.0</prometheus.version>

Review Comment:
   done



##########
common/src/main/java/org/apache/uniffle/common/metrics/MetricsManager.java:
##########
@@ -66,14 +75,37 @@ public Counter.Child addLabeledCounter(String name) {
     return c.labels(this.defaultLabelValues);
   }
 
+  @Deprecated
   public Gauge addGauge(String name, String... labels) {
     return addGauge(name, "Gauge " + name, labels);
   }
 
+  @Deprecated
   public Gauge addGauge(String name, String help, String[] labels) {
     return 
Gauge.build().name(name).labelNames(labels).help(help).register(collectorRegistry);
   }
 
+  public synchronized <T> void addGauge(String name, 
com.codahale.metrics.Gauge<T> metric) {

Review Comment:
   done



##########
common/src/main/java/org/apache/uniffle/common/metrics/MetricsManager.java:
##########
@@ -66,14 +75,37 @@ public Counter.Child addLabeledCounter(String name) {
     return c.labels(this.defaultLabelValues);
   }
 
+  @Deprecated
   public Gauge addGauge(String name, String... labels) {
     return addGauge(name, "Gauge " + name, labels);
   }
 
+  @Deprecated
   public Gauge addGauge(String name, String help, String[] labels) {
     return 
Gauge.build().name(name).labelNames(labels).help(help).register(collectorRegistry);
   }
 
+  public synchronized <T> void addGauge(String name, 
com.codahale.metrics.Gauge<T> metric) {
+    if (!metricRegistry.getMetrics().containsKey(name)) {
+      metricRegistry.register(name, metric);
+    }
+  }
+
+  public synchronized <T> void addGauge(

Review Comment:
   done



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