asafm commented on code in PR #17041:
URL: https://github.com/apache/pulsar/pull/17041#discussion_r945656745


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/stats/MetadataStoreStats.java:
##########
@@ -24,41 +24,42 @@
 
 public final class MetadataStoreStats implements AutoCloseable {
     private static final double[] BUCKETS = new double[]{1, 3, 5, 10, 20, 50, 
100, 200, 500, 1000, 2000, 5000};
-    private static final String LABEL_NAME = "metadata_store_name";
+    private static final String LABEL_NAME = "name";
+    protected static final String PREFIX = "pulsar_metadata_store_";
 
     private static final Histogram GET_OPS_SUCCEED = Histogram
-            .build("pulsar_metadata_store_get_ops_latency", "-")
+            .build(PREFIX + "get_latency", "-")
             .unit("ms")
             .buckets(BUCKETS)
             .labelNames(LABEL_NAME)
             .register();
     private static final Histogram DEL_OPS_SUCCEED = Histogram
-            .build("pulsar_metadata_store_del_ops_latency", "-")
+            .build(PREFIX + "del_latency", "-")

Review Comment:
   `del_latency` --> `del_latency_ms` (according to 
[this](https://prometheus.io/docs/practices/naming/))



##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java:
##########
@@ -1550,15 +1557,15 @@ public void testMetadataStoreStats() throws Exception {
         String metricsStr = output.toString();
         Multimap<String, Metric> metricsMap = parseMetrics(metricsStr);
 
-        Collection<Metric> getOpsFailed = 
metricsMap.get("pulsar_metadata_store_get_ops_failed" + "_total");
-        Collection<Metric> delOpsFailed = 
metricsMap.get("pulsar_metadata_store_del_ops_failed" + "_total");
-        Collection<Metric> putOpsFailed = 
metricsMap.get("pulsar_metadata_store_put_ops_failed" + "_total");
+        Collection<Metric> getOpsFailed = 
metricsMap.get("pulsar_metadata_store_get_failed" + "_total");

Review Comment:
   Out of curiosity, while the `+` in the middle? Usually when you have the 
metric name you CMD-F and search. That plus sign will only get in the way :)
   



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