-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: promote StatefulSet metrics to STABLE and enhance docs #2783
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: main
Are you sure you want to change the base?
feat: promote StatefulSet metrics to STABLE and enhance docs #2783
Conversation
- Updating kube_statefulset_status_replicas_available from ALPHA to STABLE - Add comprehensive PromQL examples and troubleshooting queries - Add major alerting rules for StatefulSet monitoring - Update tests to reflect STABLE status
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: yasicar The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This issue is currently awaiting triage. If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Welcome @yasicar! |
- Fix malformed description column spacing in availableReplicas row - Align with consistent table formatting used by other metrics - Resolves markdownlint CI failure Signed-off-by: yasicar <[email protected]>
@CatherineF-dev @mrueg Can you please help me with the review |
## Common PromQL Queries | ||
|
||
### StatefulSet Health Monitoring | ||
|
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.
I noticed that you added some PromQL troubleshooting query examples under the metric definition. From my understanding, this file (docs/metrics/workload/statefulset-metrics.md) is meant to document the metrics themselves (type, labels, stability), not usage or example queries.
I think you should remove them.
Thanks.
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.
Hi! Thank you for the feedback.
I added the PromQL examples because I noticed the Pod metrics documentation (docs/metrics/workload/pod-metrics.md) includes similar usage examples and queries, and the main README mentions welcoming "sample usages" contributions.
I was trying to follow that same pattern for consistency. Please add your thoughts.
I'm happy to adjust based on what works best for the project!
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.
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.
@yasicar, You are right, thanks for mentioning that.
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.
@nmn3m Thanks
This is my first contribution to kube-state-metrics, and I'd really appreciate your help completing this review.
- Promote kube_statefulset_annotations to STABLE - Promote kube_statefulset_persistentvolumeclaim_retention_policy to STABLE - Promote kube_statefulset_deletion_timestamp to STABLE All metrics are based on stable Kubernetes v1 APIs: - metadata.annotations (v1 stable) - spec.persistentVolumeClaimRetentionPolicy (v1 stable) - metadata.deletionTimestamp (v1 stable) Addresses consistency gap between kube-state-metrics stability labels and underlying Kubernetes API stability."
internal/store/statefulset.go
Outdated
"The number of available replicas per StatefulSet.", | ||
metric.Gauge, | ||
basemetrics.ALPHA, | ||
basemetrics.STABLE, |
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.
This metric will need to be in BETA
for a quite time then we can promote it to STABLE,
you can read this as I have the same situation before, #2749 (comment)
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.
Signed-off-by: yasicar <[email protected]>
…ps://github.com/yasicar/kube-state-metrics into promote-statefulset-available-replicas-and-docs
What this PR does / why we need it:
This PR promotes four StatefulSet metrics from EXPERIMENTAL to STABLE status and enhances StatefulSet monitoring documentation with practical examples.
Metrics Promoted to STABLE:
kube_statefulset_status_replicas_available
kube_statefulset_annotations
kube_statefulset_persistentvolumeclaim_retention_policy
kube_statefulset_deletion_timestamp
Why we need it:
Metrics Promoted to STABLE:
kube_statefulset_status_replicas_available
status.availableReplicas
kube_statefulset_annotations
metadata.annotations
kube_statefulset_persistentvolumeclaim_retention_policy
spec.persistentVolumeClaimRetentionPolicy
kube_statefulset_deletion_timestamp
metadata.deletionTimestamp
, but the kube-state-metrics metric remained EXPERIMENTAL, This creates inconsistency where identical stable Kubernetes API fields have different stability levels across workload resources in kube-state-metrics.
Better monitoring: The documentation enhancements provide practical PromQL queries and alerting rules that address real-world StatefulSet monitoring needs, including detection of complete outages, rollout issues, and availability problems.
User experience: Removes confusion around metric stability and provides actionable examples for StatefulSet observability.
The promotion is justified because:
kube_deployment_status_replicas_available
)How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
Which issue(s) this PR fixes: (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged)Fixes #