-
Notifications
You must be signed in to change notification settings - Fork 538
[SLI Metrics] Add metric kuberay_cluster_condition_provisioned #3635
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
base: master
Are you sure you want to change the base?
[SLI Metrics] Add metric kuberay_cluster_condition_provisioned #3635
Conversation
Signed-off-by: win5923 <[email protected]>
@troychiu @owenowenisme PTAL, thanks! |
@@ -47,6 +49,12 @@ func NewRayClusterMetricsManager(ctx context.Context, client client.Client) *Ray | |||
[]string{"name", "namespace", "owner_kind"}, | |||
nil, | |||
), | |||
rayClusterProvisionedReady: prometheus.NewDesc( | |||
"kuberay_cluster_provisioned_ready", |
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.
The condition is RayClusterProvisioned
. Would kuberay_cluster_provisioned be more consistent?
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.
Maybe kuberay_cluster_condition_provisioned
would be more clear. In kube-state-metrics, they use kube_pod_info
and kube_pod_status_ready
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 in d993eba
|
||
func (r *RayClusterMetricsManager) collectRayClusterProvisionedReady(cluster *rayv1.RayCluster, ch chan<- prometheus.Metric) { | ||
condition := "false" | ||
if meta.IsStatusConditionTrue(cluster.Status.Conditions, string(rayv1.RayClusterProvisioned)) { |
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.
Could we simply use strconv.FormatBool
?
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.
Nice!
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 in d993eba
Signed-off-by: win5923 <[email protected]>
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
@@ -21,6 +23,7 @@ type RayClusterMetricsObserver interface { | |||
type RayClusterMetricsManager struct { | |||
rayClusterProvisionedDurationSeconds *prometheus.GaugeVec | |||
rayClusterInfo *prometheus.Desc | |||
rayClusterProvisionedReady *prometheus.Desc |
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.
rayClusterProvisionedReady *prometheus.Desc | |
rayClusterConditionProvisioned *prometheus.Desc |
@@ -47,6 +50,12 @@ func NewRayClusterMetricsManager(ctx context.Context, client client.Client) *Ray | |||
[]string{"name", "namespace", "owner_kind"}, | |||
nil, | |||
), | |||
rayClusterProvisionedReady: prometheus.NewDesc( |
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.
rayClusterProvisionedReady: prometheus.NewDesc( | |
rayClusterConditionProvisioned: prometheus.NewDesc( |
@@ -47,6 +50,12 @@ func NewRayClusterMetricsManager(ctx context.Context, client client.Client) *Ray | |||
[]string{"name", "namespace", "owner_kind"}, | |||
nil, | |||
), | |||
rayClusterProvisionedReady: prometheus.NewDesc( | |||
"kuberay_cluster_condition_provisioned", | |||
"Indicates whether the RayCluster is provisioned and ready", |
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.
"Indicates whether the RayCluster is provisioned and ready", | |
"Indicates whether the RayCluster is provisioned", |
defer to @kevin85421 for clearer description
Why are these changes needed?
Implement metric kuberay_cluster_provisioned_ready proposed in 1.4.0.
End-to-end test
Related issue number
Checks