Skip to content

Commit

Permalink
[KYUUBI #4796] Expose JVM attributes to metrics
Browse files Browse the repository at this point in the history
### _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

ba1de91 [Cheng Pan] Update kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsSystem.scala
e2f15a6 [Cheng Pan] Update kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConstants.scala
6655520 [huzk] add jvm metrics

Lead-authored-by: huzk <[email protected]>
Co-authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
Kyofin and pan3793 committed May 6, 2023
1 parent d7417ce commit 3108c8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3108c8e

Please sign in to comment.