pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] srkukarni commented on a change in pull request #2930: Expose metrics via http port in function instance
Date Mon, 05 Nov 2018 18:17:42 GMT
srkukarni commented on a change in pull request #2930: Expose metrics via http port in function
instance
URL: https://github.com/apache/pulsar/pull/2930#discussion_r230856915
 
 

 ##########
 File path: pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/ContextImpl.java
 ##########
 @@ -320,6 +331,14 @@ public ByteBuffer getState(String key) {
 
     @Override
     public void recordMetric(String metricName, double value) {
+        userMetrics.computeIfAbsent(metricName,
+                s -> Gauge.build()
+                .name("pulsar_function_user_metric_" + metricName)
+                        .help("Pulsar Function user metric " + metricName + ".")
+                .labelNames(FunctionStats.metricsLabelNames)
+                .register(collectorRegistry));
+
+        userMetrics.get(metricName).labels(metricsLabels).set(value);
         currentAccumulatedMetrics.putIfAbsent(metricName, new AccumulatedMetricDatum());
 
 Review comment:
   what's the use of currentAccumulatedMetrics now?

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