pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] merlimat commented on a change in pull request #2914: Beginging to refactor function metrics to use prometheus
Date Sat, 03 Nov 2018 06:57:43 GMT
merlimat commented on a change in pull request #2914: Beginging to refactor function metrics
to use prometheus
URL: https://github.com/apache/pulsar/pull/2914#discussion_r230547038
 
 

 ##########
 File path: pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/FunctionStats.java
 ##########
 @@ -18,149 +18,91 @@
  */
 package org.apache.pulsar.functions.instance;
 
+import com.google.common.collect.EvictingQueue;
+import io.prometheus.client.Counter;
+import io.prometheus.client.Summary;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.pulsar.functions.proto.InstanceCommunication;
 
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
 /**
  * Function stats.
  */
 @Slf4j
 @Getter
 @Setter
 public class FunctionStats {
+
+    private static final String[] metricsLabelNames = {"tenant", "namespace", "name", "instance_id"};
+
+    /** Declare Prometheus stats **/
+
+    static final Counter statTotalProcessed = Counter.build()
+            .name("__function_total_processed__")
 
 Review comment:
   my personal preference would be to keep the names with similar conventions we are already
using for all the other components (and what others are dumping into prometheus as well).

   
   Like `__function_total_processed__` --> `pulsar_function_total_processed` 
   ... 
   
   It's easy to avoid conflict by applying label on the user generated metrics in any case.

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

Mime
View raw message