Skip to content

[SERVER] Add engine startup time metric#7509

Open
ruanwenjun wants to merge 1 commit into
apache:masterfrom
ruanwenjun:kyuubi-engine-startup-time
Open

[SERVER] Add engine startup time metric#7509
ruanwenjun wants to merge 1 commit into
apache:masterfrom
ruanwenjun:kyuubi-engine-startup-time

Conversation

@ruanwenjun

Copy link
Copy Markdown
Member

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 --check
  • build/mvn spotless:apply -pl kyuubi-metrics,kyuubi-server -DskipTests
  • build/mvn test -pl kyuubi-server -am -Dtest=none -DwildcardSuites=org.apache.kyuubi.engine.EngineRefWithZookeeperSuite

Was this patch authored or co-authored using generative AI tooling?

Assisted-by: OpenAI Codex (GPT-5)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.time as a new histogram metric constant and documents it.
  • Records engine startup latency in EngineRef.create after 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))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants