Check stable metrics aren't changed
Check stable metrics are stable
What this PR does / why we need it: Guarantee metric name, labels aren't changed for stable metrics.
How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality) does not change cardinality
Which issue(s) this PR fixes: Fixes https://github.com/kubernetes/kube-state-metrics/issues/1833
cc @dgrisonnet
Sure! Thanks!
Agree on visiting the generators to build a metrics object.
It's not easy to do static analysis for KSM metrics. ~~But e2e tests expose all stable metrics, as shown in https://github.com/kubernetes/kube-state-metrics/pull/1853.~~ 152/172 stable metrics are exposed, as shown in https://github.com/kubernetes/kube-state-metrics/pull/1853.
So plan to use e2e tests to validate stable metrics (suggested by han). Also will support SKIP_METRICS_LIST, given future stable metrics might be only exposed when certain conditions happen. For these metrics which aren't exposed in e2e tests, we can use unit-test.
These metrics aren't exposed in e2e test:
- kube_cronjob_spec_starting_deadline_seconds
- kube_cronjob_status_last_schedule_time
- kube_ingress_tls
- kube_job_complete
- kube_job_failed
- kube_job_spec_active_deadline_seconds
- kube_job_status_completion_time
- kube_node_spec_taint
- kube_persistentvolume_claim_ref
- kube_pod_completion_time
- kube_pod_init_container_info
- kube_pod_init_container_status_ready
- kube_pod_init_container_status_restarts_total
- kube_pod_init_container_status_running
- kube_pod_init_container_status_terminated
- kube_pod_init_container_status_waiting
- kube_pod_spec_volumes_persistentvolumeclaims_info
- kube_pod_spec_volumes_persistentvolumeclaims_readonly
- kube_pod_status_unschedulable
- kube_service_spec_external_ip
- kube_service_status_load_balancer_ingress
cc @rexagod @dgrisonnet @logicalhan it's ready to review this PR which adds presubmit check for stable metrics.
Ping~
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: CatherineF-dev, logicalhan
Once this PR has been reviewed and has the lgtm label, please assign mrueg for approval by writing /assign @mrueg in a comment. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/hold
In updating documents.
New changes are detected. LGTM label has been removed.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: CatherineF-dev, logicalhan
Once this PR has been reviewed and has the lgtm label, please assign mrueg for approval by writing /assign @mrueg in a comment. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Hi Damien, could you help review as well? Thanks! cc @dgrisonnet
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle rotten - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Reopen this PR with
/reopen - Mark this PR as fresh with
/remove-lifecycle rotten - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
@k8s-triage-robot: Closed this PR.
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closedYou can:
- Reopen this PR with
/reopen- Mark this PR as fresh with
/remove-lifecycle rotten- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
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/test-infra repository.