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

[kyuubi] branch master updated: [KYUUBI #4796] Expose JVM attributes to metrics

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

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 3108c8e1a [KYUUBI #4796] Expose JVM attributes to metrics
3108c8e1a is described below

commit 3108c8e1a599d07e9637fb31cd09eba0d6bb0d56
Author: huzk <10...@qq.com>
AuthorDate: Sat May 6 14:10:39 2023 +0800

    [KYUUBI #4796] Expose JVM attributes to metrics
    
    ### _Why are the changes needed?_
    
    related issue : #2526
    i  just  make the grafana dashboard of kyuubi , but i can not get the metrics of kyuubi server start time.
    
    ![图片](https://user-images.githubusercontent.com/18548053/236595754-b839e608-a087-43e6-8c31-9b6639e94138.png)
    
    we can add JvmAttributeGaugeSet to get the uptime metrics of kyuubi .
    
    ![图片](https://user-images.githubusercontent.com/18548053/236595818-d0b6958d-f660-403f-8f72-a1ef6f679383.png)
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #4796 from Kyofin/master.
    
    Closes #4796
    
    ba1de910c [Cheng Pan] Update kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsSystem.scala
    e2f15a6ee [Cheng Pan] Update kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConstants.scala
    665552028 [huzk] add jvm metrics
    
    Lead-authored-by: huzk <10...@qq.com>
    Co-authored-by: Cheng Pan <pa...@gmail.com>
    Signed-off-by: Cheng Pan <ch...@apache.org>
---
 .../src/main/scala/org/apache/kyuubi/metrics/MetricsConstants.scala      | 1 +
 .../src/main/scala/org/apache/kyuubi/metrics/MetricsSystem.scala         | 1 +
 2 files changed, 2 insertions(+)

diff --git a/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConstants.scala b/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConstants.scala
index e97fd28ea..f615467f3 100644
--- a/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConstants.scala
+++ b/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConstants.scala
@@ -26,6 +26,7 @@ object MetricsConstants {
   final val BUFFER_POOL: String = KYUUBI + "buffer_pool"
   final val THREAD_STATE: String = KYUUBI + "thread_state"
   final val CLASS_LOADING: String = KYUUBI + "class_loading"
+  final val JVM: String = KYUUBI + "jvm"
 
   final val EXEC_POOL_ALIVE: String = KYUUBI + "exec.pool.threads.alive"
   final val EXEC_POOL_ACTIVE: String = KYUUBI + "exec.pool.threads.active"
diff --git a/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsSystem.scala b/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsSystem.scala
index 99da1f1b0..26344ca56 100644
--- a/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsSystem.scala
+++ b/kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsSystem.scala
@@ -67,6 +67,7 @@ class MetricsSystem extends CompositeService("MetricsSystem") {
   }
 
   override def initialize(conf: KyuubiConf): Unit = synchronized {
+    registry.registerAll(MetricsConstants.JVM, new JvmAttributeGaugeSet)
     registry.registerAll(MetricsConstants.GC_METRIC, new GarbageCollectorMetricSet)
     registry.registerAll(MetricsConstants.MEMORY_USAGE, new MemoryUsageGaugeSet)
     registry.registerAll(