You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "zhongqiangczq (via GitHub)" <gi...@apache.org> on 2023/03/27 06:16:57 UTC

[GitHub] [incubator-celeborn] zhongqiangczq opened a new pull request, #1385: [CELEBORN-475] Support extra tags for prometheus metrics

zhongqiangczq opened a new pull request, #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     - Make sure the PR title start w/ a JIRA ticket, e.g. '[CELEBORN-XXXX] Your PR title ...'.
     - Be sure to keep the PR description updated to reflect all changes.
     - Please write your PR title to summarize what this PR proposes.
     - If possible, provide a concise example to reproduce the issue for a faster review.
   -->
   
   ### What changes were proposed in this pull request?
   
   
   
   ### Why are the changes needed?
   
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   
   
   ### How was this patch tested?
   
   


-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1150190423


##########
common/src/main/scala/org/apache/celeborn/common/util/Utils.scala:
##########
@@ -1022,4 +1022,12 @@ object Utils extends Logging {
       parentFile.lastIndexOf("/"),
       parentFile.length) + "/" + fileInfo.getFile.getName
   }
+
+  def parseMetricLabels(label: String): Tuple2[String, String] = {
+    val labelPart = label.split(":")
+    if (labelPart.size != 2) {
+      throw new IllegalArgumentException(s"Illegal metric extra labels: $label")
+    }
+    labelPart(0) -> labelPart(1)

Review Comment:
   Given that the example contains a space before `,`, the result should do trim here.
   ```
   Allowed pattern is: `<label1_key>:<label1_value> [,<label2_key>:<label2_value> ]*`
   ```
   
   And, why use `k:v`? the Prometheus metric uses `k=v`, personally, `=` looks more straightforward.



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1150185827


##########
common/src/test/scala/org/apache/celeborn/common/metrics/source/CelebornSourceSuite.scala:
##########
@@ -23,7 +23,26 @@ import org.apache.celeborn.common.CelebornConf
 class CelebornSourceSuite extends CelebornFunSuite {
 
   test("test getMetrics with customized label") {
-    val mockSource = new AbstractSource(new CelebornConf(), "mock") {
+    val conf = new CelebornConf()
+    val mockSource = createAbstractSource(conf)
+    val res = mockSource.getMetrics()
+    val exp1 = "metrics_Gauge1_Value{role=\"mock\"} 1000"

Review Comment:
   ditto



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] zhongqiangczq commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "zhongqiangczq (via GitHub)" <gi...@apache.org>.
zhongqiangczq commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1149235952


##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -641,6 +641,7 @@ class CelebornConf(loadDefaults: Boolean) extends Cloneable with Logging with Se
   def masterPrometheusMetricPort: Int = get(MASTER_PROMETHEUS_PORT)
   def workerPrometheusMetricHost: String = get(WORKER_PROMETHEUS_HOST)
   def workerPrometheusMetricPort: Int = get(WORKER_PROMETHEUS_PORT)
+  def metricsExtraLables: Option[Seq[String]] = get(METRICS_EXTRA_LABELS)

Review Comment:
   add decode here



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1149164873


##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -641,6 +641,7 @@ class CelebornConf(loadDefaults: Boolean) extends Cloneable with Logging with Se
   def masterPrometheusMetricPort: Int = get(MASTER_PROMETHEUS_PORT)
   def workerPrometheusMetricHost: String = get(WORKER_PROMETHEUS_HOST)
   def workerPrometheusMetricPort: Int = get(WORKER_PROMETHEUS_PORT)
+  def metricsExtraLables: Option[Seq[String]] = get(METRICS_EXTRA_LABELS)

Review Comment:
   we can decode label at here
   ```suggestion
     def metricsExtraLables: Map[String, String] = ...
   ```



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1149193207


##########
common/src/test/scala/org/apache/celeborn/common/metrics/source/CelebornSourceSuite.scala:
##########
@@ -44,14 +63,23 @@ class CelebornSourceSuite extends CelebornFunSuite {
     Thread.sleep(10)
     mockSource.stopTimer("Timer1", "key1")
     mockSource.stopTimer("Timer2", "key2", user3)
+    mockSource
+  }
+
+  test("test getMetrics with customized label by conf") {
+    val conf = new CelebornConf()
+    conf.set("celeborn.metrics.extra.labels", "l1:v1,l2:v2,l3:v3")
+    val mockSource = createAbstractSource(conf)
 
     val res = mockSource.getMetrics()
-    val exp1 = "metrics_Gauge1_Value{role=\"mock\"} 1000"
-    val exp2 = "metrics_Gauge2_Value{role=\"mock\" user=\"user1\"} 2000"
-    val exp3 = "metrics_Counter1_Count{role=\"mock\"} 3000"
-    val exp4 = "metrics_Counter2_Count{role=\"mock\" user=\"user2\"} 4000"
-    val exp5 = "metrics_Timer1_Count{role=\"mock\"} 1"
-    val exp6 = "metrics_Timer2_Count{role=\"mock\" user=\"user3\"} 1"
+    val exp1 = "metrics_Gauge1_Value{l1=\"v1\" l2=\"v2\" l3=\"v3\" role=\"mock\"} 1000"

Review Comment:
   ```suggestion
       val exp1 = """metrics_Gauge1_Value{l1="v1" l2="v2" l3="v3" role="mock"} 1000"""
   ```



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1150289954


##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -3078,4 +3080,17 @@ object CelebornConf extends Logging {
       .doc("Threads count for read buffer per mount point.")
       .intConf
       .createWithDefault(8)
+
+  val METRICS_EXTRA_LABELS: ConfigEntry[Seq[String]] =
+    buildConf("celeborn.metrics.extraLabels")
+      .categories("master", "worker", "metrics")
+      .doc("if default metric labels are not enough, extra metric labels can be customized." +
+        "labels' pattern is: `<label1_key>=<label1_value>[,<label2_key>=<label2_value>]*`; e.g. `env=prod,version=1`")
+      .version("0.3.0")
+      .stringConf
+      .toSequence
+      .checkValue(
+        labels => labels.map(_ => Try(Utils.parseMetricLabels(_))).forall(_.isSuccess),
+        "Allowed pattern is: `<label1_key>:<label1_value>[,<label2_key>:<label2_value>]*`")

Review Comment:
   one more place need to fix



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] zhongqiangczq commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "zhongqiangczq (via GitHub)" <gi...@apache.org>.
zhongqiangczq commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1150279044


##########
common/src/main/scala/org/apache/celeborn/common/util/Utils.scala:
##########
@@ -1022,4 +1022,12 @@ object Utils extends Logging {
       parentFile.lastIndexOf("/"),
       parentFile.length) + "/" + fileInfo.getFile.getName
   }
+
+  def parseMetricLabels(label: String): Tuple2[String, String] = {
+    val labelPart = label.split(":")
+    if (labelPart.size != 2) {
+      throw new IllegalArgumentException(s"Illegal metric extra labels: $label")
+    }
+    labelPart(0) -> labelPart(1)

Review Comment:
   i know your meaning that user may add space. it's better to trim the extra space
    



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] zhongqiangczq commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "zhongqiangczq (via GitHub)" <gi...@apache.org>.
zhongqiangczq commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1149235647


##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -3078,4 +3079,14 @@ object CelebornConf extends Logging {
       .doc("Threads count for read buffer per mount point.")
       .intConf
       .createWithDefault(8)
+
+  val METRICS_EXTRA_LABELS: OptionalConfigEntry[Seq[String]] =
+    buildConf("celeborn.metrics.extra.labels")
+      .categories("master", "worker", "metrics")
+      .doc("if default metric labels are not enough, extra metric lables can be customized." +
+        "lables's format is:k:v,k:v,... for example: label1_key:label1_value,label2_key:label2_value")
+      .version("0.3.0")
+      .stringConf
+      .toSequence

Review Comment:
   add checkvalue here



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1150276529


##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -3078,4 +3080,17 @@ object CelebornConf extends Logging {
       .doc("Threads count for read buffer per mount point.")
       .intConf
       .createWithDefault(8)
+
+  val METRICS_EXTRA_LABELS: ConfigEntry[Seq[String]] =
+    buildConf("celeborn.metrics.extraLabels")
+      .categories("master", "worker", "metrics")
+      .doc("if default metric labels are not enough, extra metric labels can be customized." +
+        "labels' pattern is: `<label1_key>=<label1_value>[,<label2_key>=<label2_value>]*`; e.g. `env=prod,version=1`")
+      .version("0.3.0")
+      .stringConf
+      .toSequence
+      .checkValue(
+        labels => labels.map(_ => Try(Utils.parseMetricLabels(_))).forall(_.isSuccess),
+        "Allowed pattern is: `<label1_key>:<label1_value>[,<label2_key>:<label2_value>]*`")

Review Comment:
   ditto



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] zhongqiangczq commented on pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "zhongqiangczq (via GitHub)" <gi...@apache.org>.
zhongqiangczq commented on PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#issuecomment-1486380692

   @pan3793 , your suggessions are good and i have refined the code. Do you have any questions?


-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] zhongqiangczq commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "zhongqiangczq (via GitHub)" <gi...@apache.org>.
zhongqiangczq commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1150272381


##########
common/src/main/scala/org/apache/celeborn/common/util/Utils.scala:
##########
@@ -1022,4 +1022,12 @@ object Utils extends Logging {
       parentFile.lastIndexOf("/"),
       parentFile.length) + "/" + fileInfo.getFile.getName
   }
+
+  def parseMetricLabels(label: String): Tuple2[String, String] = {
+    val labelPart = label.split(":")
+    if (labelPart.size != 2) {
+      throw new IllegalArgumentException(s"Illegal metric extra labels: $label")
+    }
+    labelPart(0) -> labelPart(1)

Review Comment:
   space should be removed in pattern. so this don't add trim



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] RexXiong merged pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong merged PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385


-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1150275463


##########
common/src/main/scala/org/apache/celeborn/common/util/Utils.scala:
##########
@@ -1022,4 +1022,12 @@ object Utils extends Logging {
       parentFile.lastIndexOf("/"),
       parentFile.length) + "/" + fileInfo.getFile.getName
   }
+
+  def parseMetricLabels(label: String): Tuple2[String, String] = {
+    val labelPart = label.split(":")
+    if (labelPart.size != 2) {
+      throw new IllegalArgumentException(s"Illegal metric extra labels: $label")
+    }
+    labelPart(0) -> labelPart(1)

Review Comment:
   but we if the user sets `env=prod , type= flink`?



##########
common/src/main/scala/org/apache/celeborn/common/util/Utils.scala:
##########
@@ -1022,4 +1022,12 @@ object Utils extends Logging {
       parentFile.lastIndexOf("/"),
       parentFile.length) + "/" + fileInfo.getFile.getName
   }
+
+  def parseMetricLabels(label: String): Tuple2[String, String] = {
+    val labelPart = label.split(":")
+    if (labelPart.size != 2) {
+      throw new IllegalArgumentException(s"Illegal metric extra labels: $label")
+    }
+    labelPart(0) -> labelPart(1)

Review Comment:
   but what if the user sets `env=prod , type= flink`?



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1150186123


##########
common/src/main/scala/org/apache/celeborn/common/util/Utils.scala:
##########
@@ -1022,4 +1022,12 @@ object Utils extends Logging {
       parentFile.lastIndexOf("/"),
       parentFile.length) + "/" + fileInfo.getFile.getName
   }
+
+  def parseMetricLabels(label: String): Tuple2[String, String] = {

Review Comment:
   nit
   ```suggestion
     def parseMetricLabels(label: String): (String, String) = {
   ```



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1150190423


##########
common/src/main/scala/org/apache/celeborn/common/util/Utils.scala:
##########
@@ -1022,4 +1022,12 @@ object Utils extends Logging {
       parentFile.lastIndexOf("/"),
       parentFile.length) + "/" + fileInfo.getFile.getName
   }
+
+  def parseMetricLabels(label: String): Tuple2[String, String] = {
+    val labelPart = label.split(":")
+    if (labelPart.size != 2) {
+      throw new IllegalArgumentException(s"Illegal metric extra labels: $label")
+    }
+    labelPart(0) -> labelPart(1)

Review Comment:
   Given that the example contains a space before `,`, the result should do trim here.
   ```
   Allowed pattern is: `<label1_key>:<label1_value> [,<label2_key>:<label2_value> ]*`
   ```
   
   And, why use `k:v`? the Prometheus metric format use `k=v`, personally, `=` looks more straightforward.



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1150193548


##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -3078,4 +3083,17 @@ object CelebornConf extends Logging {
       .doc("Threads count for read buffer per mount point.")
       .intConf
       .createWithDefault(8)
+
+  val METRICS_EXTRA_LABELS: OptionalConfigEntry[Seq[String]] =

Review Comment:
   we don't need `Optional` here, just simply assign `Seq.empty` as the default value.



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] codecov[bot] commented on pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#issuecomment-1484571019

   ## [Codecov](https://codecov.io/gh/apache/incubator-celeborn/pull/1385?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1385](https://codecov.io/gh/apache/incubator-celeborn/pull/1385?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4464675) into [main](https://codecov.io/gh/apache/incubator-celeborn/commit/0d1695abd876881816cefdc1f036faf994adb389?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0d1695a) will **decrease** coverage by `0.01%`.
   > The diff coverage is `16.13%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##               main    #1385      +/-   ##
   ============================================
   - Coverage     29.92%   29.90%   -0.01%     
     Complexity      919      919              
   ============================================
     Files           223      223              
     Lines         18631    18646      +15     
     Branches       1986     1989       +3     
   ============================================
   + Hits           5573     5575       +2     
   - Misses        12671    12683      +12     
   - Partials        387      388       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-celeborn/pull/1385?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...eleborn/common/metrics/source/AbstractSource.scala](https://codecov.io/gh/apache/incubator-celeborn/pull/1385?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvY2VsZWJvcm4vY29tbW9uL21ldHJpY3Mvc291cmNlL0Fic3RyYWN0U291cmNlLnNjYWxh) | `0.00% <0.00%> (ø)` | |
   | [...cala/org/apache/celeborn/common/CelebornConf.scala](https://codecov.io/gh/apache/incubator-celeborn/pull/1385?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvY2VsZWJvcm4vY29tbW9uL0NlbGVib3JuQ29uZi5zY2FsYQ==) | `81.57% <83.34%> (+0.01%)` | :arrow_up: |
   
   ... and [2 files with indirect coverage changes](https://codecov.io/gh/apache/incubator-celeborn/pull/1385/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1149158485


##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -3078,4 +3079,14 @@ object CelebornConf extends Logging {
       .doc("Threads count for read buffer per mount point.")
       .intConf
       .createWithDefault(8)
+
+  val METRICS_EXTRA_LABELS: OptionalConfigEntry[Seq[String]] =
+    buildConf("celeborn.metrics.extra.labels")
+      .categories("master", "worker", "metrics")
+      .doc("if default metric labels are not enough, extra metric lables can be customized." +
+        "lables's format is:k:v,k:v,... for example: label1_key:label1_value,label2_key:label2_value")
+      .version("0.3.0")
+      .stringConf
+      .toSequence

Review Comment:
   add check value logic here



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1149163496


##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -3078,4 +3079,14 @@ object CelebornConf extends Logging {
       .doc("Threads count for read buffer per mount point.")
       .intConf
       .createWithDefault(8)
+
+  val METRICS_EXTRA_LABELS: OptionalConfigEntry[Seq[String]] =
+    buildConf("celeborn.metrics.extra.labels")

Review Comment:
   IMO it not valuable to introduce a new configuration namespace `celeborn.metrics.extra.`
   
   ```suggestion
       buildConf("celeborn.metrics.extraLabels")
   ```
   
   



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] zhongqiangczq commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "zhongqiangczq (via GitHub)" <gi...@apache.org>.
zhongqiangczq commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1150279044


##########
common/src/main/scala/org/apache/celeborn/common/util/Utils.scala:
##########
@@ -1022,4 +1022,12 @@ object Utils extends Logging {
       parentFile.lastIndexOf("/"),
       parentFile.length) + "/" + fileInfo.getFile.getName
   }
+
+  def parseMetricLabels(label: String): Tuple2[String, String] = {
+    val labelPart = label.split(":")
+    if (labelPart.size != 2) {
+      throw new IllegalArgumentException(s"Illegal metric extra labels: $label")
+    }
+    labelPart(0) -> labelPart(1)

Review Comment:
   i know your meaning that user may add spaces. it's better to trim the extra space
    



##########
common/src/main/scala/org/apache/celeborn/common/util/Utils.scala:
##########
@@ -1022,4 +1022,12 @@ object Utils extends Logging {
       parentFile.lastIndexOf("/"),
       parentFile.length) + "/" + fileInfo.getFile.getName
   }
+
+  def parseMetricLabels(label: String): Tuple2[String, String] = {
+    val labelPart = label.split(":")
+    if (labelPart.size != 2) {
+      throw new IllegalArgumentException(s"Illegal metric extra labels: $label")
+    }
+    labelPart(0) -> labelPart(1)

Review Comment:
   i know your meaning that user may add spaces. it's better to trim the extra spaces
    



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] pan3793 commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1149164873


##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -641,6 +641,7 @@ class CelebornConf(loadDefaults: Boolean) extends Cloneable with Logging with Se
   def masterPrometheusMetricPort: Int = get(MASTER_PROMETHEUS_PORT)
   def workerPrometheusMetricHost: String = get(WORKER_PROMETHEUS_HOST)
   def workerPrometheusMetricPort: Int = get(WORKER_PROMETHEUS_PORT)
+  def metricsExtraLables: Option[Seq[String]] = get(METRICS_EXTRA_LABELS)

Review Comment:
   we can decode label at here
   ```suggestion
     def metricsExtraLables: Seq[(String, String)] = ...
   ```



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-celeborn] zhongqiangczq commented on a diff in pull request #1385: [CELEBORN-475] Support extra tags for prometheus metrics

Posted by "zhongqiangczq (via GitHub)" <gi...@apache.org>.
zhongqiangczq commented on code in PR #1385:
URL: https://github.com/apache/incubator-celeborn/pull/1385#discussion_r1149236554


##########
common/src/test/scala/org/apache/celeborn/common/metrics/source/CelebornSourceSuite.scala:
##########
@@ -44,14 +63,23 @@ class CelebornSourceSuite extends CelebornFunSuite {
     Thread.sleep(10)
     mockSource.stopTimer("Timer1", "key1")
     mockSource.stopTimer("Timer2", "key2", user3)
+    mockSource
+  }
+
+  test("test getMetrics with customized label by conf") {
+    val conf = new CelebornConf()
+    conf.set("celeborn.metrics.extra.labels", "l1:v1,l2:v2,l3:v3")
+    val mockSource = createAbstractSource(conf)
 
     val res = mockSource.getMetrics()
-    val exp1 = "metrics_Gauge1_Value{role=\"mock\"} 1000"
-    val exp2 = "metrics_Gauge2_Value{role=\"mock\" user=\"user1\"} 2000"
-    val exp3 = "metrics_Counter1_Count{role=\"mock\"} 3000"
-    val exp4 = "metrics_Counter2_Count{role=\"mock\" user=\"user2\"} 4000"
-    val exp5 = "metrics_Timer1_Count{role=\"mock\"} 1"
-    val exp6 = "metrics_Timer2_Count{role=\"mock\" user=\"user3\"} 1"
+    val exp1 = "metrics_Gauge1_Value{l1=\"v1\" l2=\"v2\" l3=\"v3\" role=\"mock\"} 1000"

Review Comment:
   \ has been removed



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org