hadoop-ozone-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [hadoop-ozone] 01/02: HDDS-2667. Prometheus reports invalid metric type
Date Thu, 05 Dec 2019 12:41:30 GMT
This is an automated email from the ASF dual-hosted git repository.

elek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git

commit 8e1e2250ea57796767790fd5bc917ef741b9e278
Author: Doroszlai, Attila <adoroszlai@apache.org>
AuthorDate: Thu Dec 5 12:24:46 2019 +0100

    HDDS-2667. Prometheus reports invalid metric type
    
    Closes #306
---
 .../java/org/apache/hadoop/hdds/server/PrometheusMetricsSink.java    | 5 +++--
 .../org/apache/hadoop/hdds/server/TestPrometheusMetricsSink.java     | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/PrometheusMetricsSink.java
b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/PrometheusMetricsSink.java
index f37d323..f5f51e7 100644
--- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/PrometheusMetricsSink.java
+++ b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/PrometheusMetricsSink.java
@@ -110,10 +110,11 @@ public class PrometheusMetricsSink implements MetricsSink {
   public String prometheusName(String recordName,
       String metricName) {
 
-    //RocksDB metric names already have underscores as delimiters.
+    // RocksDB metric names already have underscores as delimiters,
+    // but record name is from DB file name and '.' (as in 'om.db') is invalid
     if (StringUtils.isNotEmpty(recordName) &&
         recordName.startsWith(ROCKSDB_CONTEXT_PREFIX)) {
-      return recordName.toLowerCase() + "_" + metricName.toLowerCase();
+      return normalizeName(recordName) + "_" + metricName.toLowerCase();
     }
 
     String baseName = StringUtils.capitalize(recordName)
diff --git a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/TestPrometheusMetricsSink.java
b/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/TestPrometheusMetricsSink.java
index f2683b5..7617bc7 100644
--- a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/TestPrometheusMetricsSink.java
+++ b/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/TestPrometheusMetricsSink.java
@@ -133,7 +133,7 @@ public class TestPrometheusMetricsSink {
   public void testNamingRocksDB() {
     //RocksDB metrics are handled differently.
     PrometheusMetricsSink sink = new PrometheusMetricsSink();
-    Assert.assertEquals("rocksdb_om.db_num_open_connections",
+    Assert.assertEquals("rocksdb_om_db_num_open_connections",
         sink.prometheusName("Rocksdb_om.db", "num_open_connections"));
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-commits-help@hadoop.apache.org


Mime
View raw message