This is an automated email from the ASF dual-hosted git repository.

feiwang pushed a commit to branch branch-0.6
in repository https://gitbox.apache.org/repos/asf/celeborn.git


The following commit(s) were added to refs/heads/branch-0.6 by this push:
     new de7949013 [CELEBORN-1627][FOLLOWUP] Fix the issue where the case of 
name affects the metrics dashboard
de7949013 is described below

commit de7949013f0d3d6e9a7be79e64c27c7ec7f4a317
Author: Shuang <lvshuang....@alibaba-inc.com>
AuthorDate: Thu May 29 22:40:13 2025 -0700

    [CELEBORN-1627][FOLLOWUP] Fix the issue where the case of name affects the 
metrics dashboard
    
    ### What changes were proposed in this pull request?
    Revert role name change in 
[CELEBORN-1627](https://github.com/apache/celeborn/pull/2777)
    
    ### Why are the changes needed?
    Fix the issue where the case of name affects the metrics dashboard
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    Manual
    
    Closes #3299 from RexXiong/CELEBORN-1627-FOLLOWUP.
    
    Authored-by: Shuang <lvshuang....@alibaba-inc.com>
    Signed-off-by: Wang, Fei <fwan...@ebay.com>
    (cherry picked from commit 0227a1ab29afd87bbb547d35738591d4f62725b9)
    Signed-off-by: Wang, Fei <fwan...@ebay.com>
---
 .../celeborn/common/metrics/source/Role.scala      |  6 +++---
 docs/migration.md                                  |  2 +-
 .../deploy/master/quota/QuotaManagerSuite.scala    | 22 ++++++++++++----------
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git 
a/common/src/main/scala/org/apache/celeborn/common/metrics/source/Role.scala 
b/common/src/main/scala/org/apache/celeborn/common/metrics/source/Role.scala
index 95b03f256..a10ffb1e7 100644
--- a/common/src/main/scala/org/apache/celeborn/common/metrics/source/Role.scala
+++ b/common/src/main/scala/org/apache/celeborn/common/metrics/source/Role.scala
@@ -18,7 +18,7 @@
 package org.apache.celeborn.common.metrics.source
 
 object Role {
-  val MASTER = "master"
-  val WORKER = "worker"
-  val CLIENT = "client"
+  val MASTER = "Master"
+  val WORKER = "Worker"
+  val CLIENT = "Client"
 }
diff --git a/docs/migration.md b/docs/migration.md
index 9512c6edb..34b7fe7c4 100644
--- a/docs/migration.md
+++ b/docs/migration.md
@@ -90,7 +90,7 @@ license: |
 
 - Since 0.6.0, the RESTful api `/listTopDiskUsedApps` both in Master and 
Worker has been removed. Please use the following PromQL query instead.
   ```text
-  topK(50, sum by (applicationId) 
(metrics_diskBytesWritten_Value{role="worker", applicationId!=""}))
+  topK(50, sum by (applicationId) 
(metrics_diskBytesWritten_Value{role="Worker", applicationId!=""}))
   ```
 
 - Since 0.6.0, the out-of-dated Flink 1.14 and Flink 1.15 have been removed 
from the official support list.
diff --git 
a/master/src/test/scala/org/apache/celeborn/service/deploy/master/quota/QuotaManagerSuite.scala
 
b/master/src/test/scala/org/apache/celeborn/service/deploy/master/quota/QuotaManagerSuite.scala
index f8182777c..9988f0c1f 100644
--- 
a/master/src/test/scala/org/apache/celeborn/service/deploy/master/quota/QuotaManagerSuite.scala
+++ 
b/master/src/test/scala/org/apache/celeborn/service/deploy/master/quota/QuotaManagerSuite.scala
@@ -30,7 +30,7 @@ import org.apache.celeborn.common.CelebornConf
 import org.apache.celeborn.common.identity.UserIdentifier
 import org.apache.celeborn.common.internal.Logging
 import org.apache.celeborn.common.meta.WorkerInfo
-import org.apache.celeborn.common.metrics.source.ResourceConsumptionSource
+import org.apache.celeborn.common.metrics.source.{ResourceConsumptionSource, 
Role}
 import 
org.apache.celeborn.common.protocol.message.ControlMessages.CheckQuotaResponse
 import org.apache.celeborn.common.quota.{ResourceConsumption, StorageQuota}
 import org.apache.celeborn.common.rpc.RpcEnv
@@ -65,13 +65,15 @@ class QuotaManagerSuite extends CelebornFunSuite
 
   var configService: ConfigService = _
 
+  val metricsInstanceLabel = 
s"""instance="${Utils.localHostName(conf)}:${conf.masterHttpPort}""""
+
   override def beforeAll(): Unit = {
     conf.set(CelebornConf.DYNAMIC_CONFIG_STORE_BACKEND, "FS")
     conf.set(
       CelebornConf.DYNAMIC_CONFIG_STORE_FS_PATH.key,
       getTestResourceFile("dynamicConfig-quota.yaml").getPath)
     conf.set("celeborn.master.userResourceConsumption.metrics.enabled", "true")
-    resourceConsumptionSource = new ResourceConsumptionSource(conf, "Master")
+    resourceConsumptionSource = new ResourceConsumptionSource(conf, 
Role.MASTER)
     DynamicConfigServiceFactory.reset()
     configService = DynamicConfigServiceFactory.getConfigService(conf)
 
@@ -347,13 +349,13 @@ class QuotaManagerSuite extends CelebornFunSuite
     for (i <- 0 until 1000) {
       val user = UserIdentifier("default", s"user$i")
       assert(res.contains(
-        
s"""metrics_diskFileCount_Value{name="user$i",role="Master",tenantId="default"}"""))
+        
s"""metrics_diskFileCount_Value{$metricsInstanceLabel,name="user$i",role="Master",tenantId="default"}"""))
       assert(res.contains(
-        
s"""metrics_diskFileCount_Value{name="user$i",role="Master",tenantId="default"}"""))
+        
s"""metrics_diskFileCount_Value{$metricsInstanceLabel,name="user$i",role="Master",tenantId="default"}"""))
       assert(res.contains(
-        
s"""metrics_hdfsFileCount_Value{name="user$i",role="Master",tenantId="default"}"""))
+        
s"""metrics_hdfsFileCount_Value{$metricsInstanceLabel,name="user$i",role="Master",tenantId="default"}"""))
       assert(res.contains(
-        
s"""metrics_hdfsBytesWritten_Value{name="user$i",role="Master",tenantId="default"}"""))
+        
s"""metrics_hdfsBytesWritten_Value{$metricsInstanceLabel,name="user$i",role="Master",tenantId="default"}"""))
       assertFalse(quotaManager.checkUserQuotaStatus(user).isAvailable)
       (0 until 1000).foreach {
         index =>
@@ -409,13 +411,13 @@ class QuotaManagerSuite extends CelebornFunSuite
     for (i <- 0 until 1000) {
       val user = UserIdentifier("default", s"user$i")
       assert(res.contains(
-        
s"""metrics_diskFileCount_Value{name="user$i",role="Master",tenantId="default"}"""))
+        
s"""metrics_diskFileCount_Value{$metricsInstanceLabel,name="user$i",role="Master",tenantId="default"}"""))
       assert(res.contains(
-        
s"""metrics_diskFileCount_Value{name="user$i",role="Master",tenantId="default"}"""))
+        
s"""metrics_diskFileCount_Value{$metricsInstanceLabel,name="user$i",role="Master",tenantId="default"}"""))
       assert(res.contains(
-        
s"""metrics_hdfsFileCount_Value{name="user$i",role="Master",tenantId="default"}"""))
+        
s"""metrics_hdfsFileCount_Value{$metricsInstanceLabel,name="user$i",role="Master",tenantId="default"}"""))
       assert(res.contains(
-        
s"""metrics_hdfsBytesWritten_Value{name="user$i",role="Master",tenantId="default"}"""))
+        
s"""metrics_hdfsBytesWritten_Value{$metricsInstanceLabel,name="user$i",role="Master",tenantId="default"}"""))
       assertFalse(quotaManager.checkUserQuotaStatus(user).isAvailable)
       (0 until 1000).foreach {
         index =>

Reply via email to