-
Notifications
You must be signed in to change notification settings - Fork 930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support to return prometheus metrics with instance label #6864
Conversation
fd4ae38
to
c3046d4
Compare
kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConf.scala
Outdated
Show resolved
Hide resolved
72166a8
to
6a6a511
Compare
line | ||
} else { | ||
val Array(metrics, value) = line.split("\\s+", 2) | ||
s"""$metrics${labelStr} $value""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a little bit hacky, but given the feature is disabled by default, let's merge it in first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to
line.split("\\s+", 2) match {
case Array(metrics, rest) => s"""$metrics${labelStr} $rest"""
case _ => line
}
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6864 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 687 687
Lines 42473 42504 +31
Branches 5796 5798 +2
======================================
- Misses 42473 42504 +31 ☔ View full report in Codecov by Sentry. |
For my use case, the instances are not human readable, so I prefer to return the FQDN. <img width="1483" alt="image" src="https://github.com/user-attachments/assets/92045517-456f-4087-8a36-9e3e4bea2f1d" /> Integration testing. ``` (base) ➜ dist git:(prometheus_label_2) cat conf/kyuubi-defaults.conf kyuubi.metrics.prometheus.metrics.instance.enabled=true kyuubi.zookeeper.embedded.client.port.address=localhost kyuubi.frontend.bind.host=localhost ``` <img width="1692" alt="image" src="https://github.com/user-attachments/assets/0b60d504-62ec-418d-880b-f8a2f00d5550" /> No. Closes #6864 from turboFei/prometheus_label_2. Closes #6864 d24571c [Wang, Fei] match 6a6a511 [Wang, Fei] comments c3046d4 [Wang, Fei] save fb2021a [Wang, Fei] revert 4239594 [Wang, Fei] compatible 17b7007 [Wang, Fei] add instance label Authored-by: Wang, Fei <[email protected]> Signed-off-by: Cheng Pan <[email protected]> (cherry picked from commit aa33521) Signed-off-by: Cheng Pan <[email protected]>
Thanks, merged to master/1.10 |
### Why are the changes needed? For histogram and timer metrics, it already has label, so need to support apply the instance label with existing ones. For example: ``` # HELP kyuubi_backend_service_close_operation Generated from Dropwizard metric import (metric=kyuubi.backend_service.close_operation, type=com.codahale.metrics.Timer) # TYPE kyuubi_backend_service_close_operation summary kyuubi_backend_service_close_operation{quantile="0.5",}{instance="hadoopkyuubi-1.hadoopkyuubihl.hadoopmaster-dev.svc.140.tess.io:10019"} 0.032923216000000005 ``` ### How was this patch tested? UT. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #6868 from turboFei/instance_label_follow. Closes #6864 4894784 [Wang, Fei] ut b8f227f [Wang, Fei] save Authored-by: Wang, Fei <[email protected]> Signed-off-by: Cheng Pan <[email protected]>
### Why are the changes needed? For histogram and timer metrics, it already has label, so need to support apply the instance label with existing ones. For example: ``` # HELP kyuubi_backend_service_close_operation Generated from Dropwizard metric import (metric=kyuubi.backend_service.close_operation, type=com.codahale.metrics.Timer) # TYPE kyuubi_backend_service_close_operation summary kyuubi_backend_service_close_operation{quantile="0.5",}{instance="hadoopkyuubi-1.hadoopkyuubihl.hadoopmaster-dev.svc.140.tess.io:10019"} 0.032923216000000005 ``` ### How was this patch tested? UT. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #6868 from turboFei/instance_label_follow. Closes #6864 4894784 [Wang, Fei] ut b8f227f [Wang, Fei] save Authored-by: Wang, Fei <[email protected]> Signed-off-by: Cheng Pan <[email protected]> (cherry picked from commit fd53913) Signed-off-by: Cheng Pan <[email protected]>
Why are the changes needed?
For my use case, the instances are not human readable, so I prefer to return the FQDN.

How was this patch tested?
Integration testing.
Was this patch authored or co-authored using generative AI tooling?
No.