-
Notifications
You must be signed in to change notification settings - Fork 539
[SLI-Metrics] kuberay_service_ready #3577
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
[SLI-Metrics] kuberay_service_ready #3577
Conversation
7b1dcdb
to
a0ef666
Compare
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.
LGTM
Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
891aded
to
b633a37
Compare
@troychiu @kevin85421 Would you mind taking a look? |
Can't we simply reuse collectRayServiceInfo?
|
RayServiceInfo is |
|
@troychiu I get what you meant now. func (c *RayServiceMetricsManager) Collect(ch chan<- prometheus.Metric) {
var rayServiceList rayv1.RayServiceList
if err := c.client.List(context.Background(), &rayServiceList); err != nil {
c.log.Error(err, "Failed to list RayServices")
return
}
for _, rayService := range rayServiceList.Items {
c.collectRayServiceInfo(&rayService, ch)
}
c.RayServiceReady.Collect(ch)
}
func (c *RayServiceMetricsManager) collectRayServiceInfo(service *rayv1.RayService, ch chan<- prometheus.Metric) {
ch <- prometheus.MustNewConstMetric(
c.rayServiceInfo,
prometheus.GaugeValue,
1,
service.Name,
service.Namespace,
)
ready := meta.IsStatusConditionTrue(service.Status.Conditions, string(rayv1.RayServiceReady))
c.RayServiceReady.WithLabelValues(service.Name, service.Namespace, strconv.FormatBool(!ready)).Set(0)
c.RayServiceReady.WithLabelValues(service.Name, service.Namespace, strconv.FormatBool(ready)).Set(1)
} But just to make sure, is this what you're thinking in mind? |
Yeah that's it. Actually we can make it simpler. ch <- prometheus.MustNewConstMetric(
c.rayServiceReady,
prometheus.GaugeValue,
1,
service.Name,
service.Namespace,
condition, // strconv.FormatBool(...) in this case
) and
|
Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
Signed-off-by: You-Cheng Lin <[email protected]>
Cc @kevin85421 PTAL🙏🙏 |
Signed-off-by: You-Cheng Lin <[email protected]>
@owenowenisme can you fix the CI? |
I rerun the failed test. @owenowenisme please ping me when all CI tests pass. |
@kevin85421 CI passed. |
Why are these changes needed?
Added
kuberay_service_ready
as written in KubeRay v1.4.0 SLI proposalRelated issue number
Closes #3177
Checks