[KYUUBI #7094] Add serverOnly flag for metrics config items

### Why are the changes needed?

MetricsSystem is only used for KyuubiServer, all the metrics config items are server only.
### How was this patch tested?

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

No.

Closes #7094 from turboFei/serverOnly.

Closes #7094

8324419dd [Wang, Fei] Add server only flag for metrics conf

Authored-by: Wang, Fei <fwang12@ebay.com>
Signed-off-by: Wang, Fei <fwang12@ebay.com>
This commit is contained in:
Wang, Fei 2025-06-11 22:32:46 -07:00
parent a3b21f6f80
commit 00ff464b06

View File

@ -27,12 +27,14 @@ object MetricsConf {
val METRICS_ENABLED: ConfigEntry[Boolean] = val METRICS_ENABLED: ConfigEntry[Boolean] =
buildConf("kyuubi.metrics.enabled") buildConf("kyuubi.metrics.enabled")
.serverOnly
.doc("Set to true to enable kyuubi metrics system") .doc("Set to true to enable kyuubi metrics system")
.version("1.2.0") .version("1.2.0")
.booleanConf .booleanConf
.createWithDefault(true) .createWithDefault(true)
val METRICS_REPORTERS: ConfigEntry[Set[String]] = buildConf("kyuubi.metrics.reporters") val METRICS_REPORTERS: ConfigEntry[Set[String]] = buildConf("kyuubi.metrics.reporters")
.serverOnly
.doc("A comma-separated list for all metrics reporters" + .doc("A comma-separated list for all metrics reporters" +
"<ul>" + "<ul>" +
" <li>CONSOLE - ConsoleReporter which outputs measurements to CONSOLE periodically.</li>" + " <li>CONSOLE - ConsoleReporter which outputs measurements to CONSOLE periodically.</li>" +
@ -49,24 +51,28 @@ object MetricsConf {
.createWithDefault(Set(PROMETHEUS.toString)) .createWithDefault(Set(PROMETHEUS.toString))
val METRICS_CONSOLE_INTERVAL: ConfigEntry[Long] = buildConf("kyuubi.metrics.console.interval") val METRICS_CONSOLE_INTERVAL: ConfigEntry[Long] = buildConf("kyuubi.metrics.console.interval")
.serverOnly
.doc("How often should report metrics to console") .doc("How often should report metrics to console")
.version("1.2.0") .version("1.2.0")
.timeConf .timeConf
.createWithDefault(Duration.ofSeconds(5).toMillis) .createWithDefault(Duration.ofSeconds(5).toMillis)
val METRICS_JSON_LOCATION: ConfigEntry[String] = buildConf("kyuubi.metrics.json.location") val METRICS_JSON_LOCATION: ConfigEntry[String] = buildConf("kyuubi.metrics.json.location")
.serverOnly
.doc("Where the JSON metrics file located") .doc("Where the JSON metrics file located")
.version("1.2.0") .version("1.2.0")
.stringConf .stringConf
.createWithDefault("metrics") .createWithDefault("metrics")
val METRICS_JSON_INTERVAL: ConfigEntry[Long] = buildConf("kyuubi.metrics.json.interval") val METRICS_JSON_INTERVAL: ConfigEntry[Long] = buildConf("kyuubi.metrics.json.interval")
.serverOnly
.doc("How often should report metrics to JSON file") .doc("How often should report metrics to JSON file")
.version("1.2.0") .version("1.2.0")
.timeConf .timeConf
.createWithDefault(Duration.ofSeconds(5).toMillis) .createWithDefault(Duration.ofSeconds(5).toMillis)
val METRICS_PROMETHEUS_PORT: ConfigEntry[Int] = buildConf("kyuubi.metrics.prometheus.port") val METRICS_PROMETHEUS_PORT: ConfigEntry[Int] = buildConf("kyuubi.metrics.prometheus.port")
.serverOnly
.doc("Prometheus metrics HTTP server port") .doc("Prometheus metrics HTTP server port")
.version("1.2.0") .version("1.2.0")
.intConf .intConf
@ -74,6 +80,7 @@ object MetricsConf {
.createWithDefault(10019) .createWithDefault(10019)
val METRICS_PROMETHEUS_PATH: ConfigEntry[String] = buildConf("kyuubi.metrics.prometheus.path") val METRICS_PROMETHEUS_PATH: ConfigEntry[String] = buildConf("kyuubi.metrics.prometheus.path")
.serverOnly
.doc("URI context path of prometheus metrics HTTP server") .doc("URI context path of prometheus metrics HTTP server")
.version("1.2.0") .version("1.2.0")
.stringConf .stringConf
@ -82,12 +89,14 @@ object MetricsConf {
val METRICS_PROMETHEUS_LABELS_INSTANCE_ENABLED: ConfigEntry[Boolean] = val METRICS_PROMETHEUS_LABELS_INSTANCE_ENABLED: ConfigEntry[Boolean] =
buildConf("kyuubi.metrics.prometheus.labels.instance.enabled") buildConf("kyuubi.metrics.prometheus.labels.instance.enabled")
.serverOnly
.doc("Whether to add instance label to prometheus metrics") .doc("Whether to add instance label to prometheus metrics")
.version("1.10.2") .version("1.10.2")
.booleanConf .booleanConf
.createWithDefault(false) .createWithDefault(false)
val METRICS_SLF4J_INTERVAL: ConfigEntry[Long] = buildConf("kyuubi.metrics.slf4j.interval") val METRICS_SLF4J_INTERVAL: ConfigEntry[Long] = buildConf("kyuubi.metrics.slf4j.interval")
.serverOnly
.doc("How often should report metrics to SLF4J logger") .doc("How often should report metrics to SLF4J logger")
.version("1.2.0") .version("1.2.0")
.timeConf .timeConf