[SERVER] Add engine startup time metric#7509
Open
ruanwenjun wants to merge 1 commit into
Open
Conversation
2e4d811 to
5472ca9
Compare
cxzl25
approved these changes
Jun 12, 2026
There was a problem hiding this comment.
Pull request overview
This PR adds a new server-side histogram metric to observe how long it takes for a newly launched engine to become available, filling a gap where only operation execution time metrics were previously exposed.
Changes:
- Introduces
kyuubi.engine.startup.timeas a new histogram metric constant and documents it. - Records engine startup latency in
EngineRef.createafter the engine is successfully discovered. - Adds a unit test assertion to ensure the histogram is updated during engine creation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| kyuubi-server/src/main/scala/org/apache/kyuubi/engine/EngineRef.scala | Updates engine creation flow to record a startup-time histogram on successful engine discovery. |
| kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConstants.scala | Adds the ENGINE_STARTUP_TIME metric name constant. |
| docs/monitor/metrics.md | Documents the new kyuubi.engine.startup.time metric in the metrics table. |
| kyuubi-server/src/test/scala/org/apache/kyuubi/engine/EngineRefTests.scala | Adds a test assertion that the startup-time histogram receives at least one sample. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
298
to
302
| eventually(timeout(90.seconds), interval(1.second)) { | ||
| assert(port1 != 0, "engine started") | ||
| assert(port2 == port1, "engine shared") | ||
| assert(MetricsSystem.histogramSnapshot(ENGINE_STARTUP_TIME).exists(_.size() > 0)) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
Kyuubi already exposes operation execution time metrics, but there is no server-side metric for how long a new engine takes to become available. This patch adds an engine startup time histogram so operators can observe successful engine startup latency, including waiting for startup permits, launching the engine, cluster scheduling, engine initialization, and discovery by the Kyuubi server.
How was this patch tested?
git diff --checkbuild/mvn spotless:apply -pl kyuubi-metrics,kyuubi-server -DskipTestsbuild/mvn test -pl kyuubi-server -am -Dtest=none -DwildcardSuites=org.apache.kyuubi.engine.EngineRefWithZookeeperSuiteWas this patch authored or co-authored using generative AI tooling?
Assisted-by: OpenAI Codex (GPT-5)