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 <[email protected]>
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.

we can add JvmAttributeGaugeSet to get the uptime metrics of kyuubi .

### _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 <[email protected]>
Co-authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
---
.../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(