You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celeborn.apache.org by an...@apache.org on 2023/06/14 10:06:15 UTC

[incubator-celeborn] branch main updated: [CELEBORN-681][DOC] Add celeborn.metrics.conf to conf entity

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

angerszhuuuu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new 8a0b7d80d [CELEBORN-681][DOC] Add celeborn.metrics.conf to conf entity
8a0b7d80d is described below

commit 8a0b7d80d682cb838080974d117b86904d24b5ed
Author: Angerszhuuuu <an...@gmail.com>
AuthorDate: Wed Jun 14 18:06:03 2023 +0800

    [CELEBORN-681][DOC] Add celeborn.metrics.conf to conf entity
    
    ### What changes were proposed in this pull request?
    Add celeborn.metrics.conf to conf entity
    
    ### Why are the changes needed?
    
    ### Does this PR introduce _any_ user-facing change?
    
    ### How was this patch tested?
    
    Closes #1593 from AngersZhuuuu/CELEBORN-681.
    
    Authored-by: Angerszhuuuu <an...@gmail.com>
    Signed-off-by: Angerszhuuuu <an...@gmail.com>
---
 .../src/main/scala/org/apache/celeborn/common/CelebornConf.scala | 9 +++++++++
 .../scala/org/apache/celeborn/common/metrics/MetricsConfig.scala | 6 ++----
 docs/configuration/metrics.md                                    | 1 +
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala b/common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala
index a74699681..68ef91df1 100644
--- a/common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala
+++ b/common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala
@@ -624,6 +624,7 @@ class CelebornConf(loadDefaults: Boolean) extends Cloneable with Logging with Se
   // //////////////////////////////////////////////////////
   //                 Metrics System                      //
   // //////////////////////////////////////////////////////
+  def metricsConf: Option[String] = get(METRICS_CONF)
   def metricsSystemEnable: Boolean = get(METRICS_ENABLED)
   def metricsSampleRate: Double = get(METRICS_SAMPLE_RATE)
   def metricsSlidingWindowSize: Int = get(METRICS_SLIDING_WINDOW_SIZE)
@@ -3168,6 +3169,14 @@ object CelebornConf extends Logging {
       .stringConf
       .createOptional
 
+  val METRICS_CONF: OptionalConfigEntry[String] =
+    buildConf("celeborn.metrics.conf")
+      .categories("metrics")
+      .doc("Custom metrics configuration file path. Default use `metrics.properties` in classpath.")
+      .version("0.3.0")
+      .stringConf
+      .createOptional
+
   val METRICS_ENABLED: ConfigEntry[Boolean] =
     buildConf("celeborn.metrics.enabled")
       .categories("metrics")
diff --git a/common/src/main/scala/org/apache/celeborn/common/metrics/MetricsConfig.scala b/common/src/main/scala/org/apache/celeborn/common/metrics/MetricsConfig.scala
index ac07f7cb4..79af34e0c 100644
--- a/common/src/main/scala/org/apache/celeborn/common/metrics/MetricsConfig.scala
+++ b/common/src/main/scala/org/apache/celeborn/common/metrics/MetricsConfig.scala
@@ -47,10 +47,8 @@ private class MetricsConfig(conf: CelebornConf) extends Logging {
     // Add default properties in case there's no properties file
     setDefaultProperties(properties)
 
-    val configKey = "celeborn.metrics.conf"
-    loadPropertiesFromFile(conf.getOption(configKey))
-
-    val prefix = s"${configKey}."
+    loadPropertiesFromFile(conf.metricsConf)
+    val prefix = s"${CelebornConf.METRICS_CONF.key}."
     // Also look for the properties in provided rss configuration
     conf.getAll.foreach {
       case (k, v) if k.startsWith(prefix) =>
diff --git a/docs/configuration/metrics.md b/docs/configuration/metrics.md
index bcb12fe53..8a2999af5 100644
--- a/docs/configuration/metrics.md
+++ b/docs/configuration/metrics.md
@@ -24,6 +24,7 @@ license: |
 | celeborn.metrics.app.topDiskUsage.windowSize | 24 | Window size about top disk usage application list. | 0.2.0 | 
 | celeborn.metrics.capacity | 4096 | The maximum number of metrics which a source can use to generate output strings. | 0.2.0 | 
 | celeborn.metrics.collectPerfCritical.enabled | false | It controls whether to collect metrics which may affect performance. When enable, Celeborn collects them. | 0.2.0 | 
+| celeborn.metrics.conf | &lt;undefined&gt; | Custom metrics configuration file path. Default use `metrics.properties` in classpath. | 0.3.0 | 
 | celeborn.metrics.enabled | true | When true, enable metrics system. | 0.2.0 | 
 | celeborn.metrics.extraLabels |  | 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` | 0.3.0 | 
 | celeborn.metrics.master.prometheus.host | 0.0.0.0 | Master's Prometheus host. | 0.3.0 |