ruanwenjun opened a new pull request, #7722: URL: https://github.com/apache/kyuubi/pull/7722
### Why are the changes needed? A Spark engine Pod can already exist in Kubernetes while Kyuubi has not yet received its informer event. This delay can contribute to an engine submission timeout, but the existing engine startup metric only covers engines that register successfully. Add `kyuubi.engine.kubernetes.pod.discovery.latency`, a histogram in milliseconds from Pod creation to the first ADD or UPDATE that populates the local application cache. Repeated events for cached applications do not add samples. Initial listing of existing Pods is included; cache eviction or server restart can produce another sample. Missing, malformed, or future creation timestamps are skipped without preventing cache updates. ### How was this patch tested? Validated with JDK 17. `dev/reformat` ran without the optional Python formatter (no Python files changed). Added tests in `KubernetesApplicationOperationSuite` for delayed first ADD/UPDATE, repeated events, invalid timestamps, DELETE events, and non-engine Pods, without a Kubernetes cluster. All 9 tests passed with the change. Restoring the original production implementation made the two first-discovery tests fail with zero samples, confirming that they exercise the new metric. ```text dev/reformat build/mvn --batch-mode --no-transfer-progress test -pl kyuubi-server -am -Dtest=none -DwildcardSuites=org.apache.kyuubi.engine.KubernetesApplicationOperationSuite -Pflink-provided,hive-provided,spark-provided git diff --check ``` ### Was this patch assisted by generative AI tooling? Assisted-by: Codex (GPT-6) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
