kube-state-metrics icon indicating copy to clipboard operation
kube-state-metrics copied to clipboard

Check stable metrics aren't changed

Open CatherineF-dev opened this issue 3 years ago • 2 comments

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

CatherineF-dev avatar Sep 17 '22 15:09 CatherineF-dev

cc @dgrisonnet

CatherineF-dev avatar Sep 20 '22 18:09 CatherineF-dev

Sure! Thanks!

Agree on visiting the generators to build a metrics object.

CatherineF-dev avatar Sep 23 '22 17:09 CatherineF-dev

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

CatherineF-dev avatar Oct 15 '22 14:10 CatherineF-dev

cc @rexagod @dgrisonnet @logicalhan it's ready to review this PR which adds presubmit check for stable metrics.

CatherineF-dev avatar Oct 19 '22 19:10 CatherineF-dev

Ping~

CatherineF-dev avatar Oct 31 '22 15:10 CatherineF-dev

[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.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Nov 03 '22 15:11 k8s-ci-robot

/hold

In updating documents.

CatherineF-dev avatar Nov 03 '22 15:11 CatherineF-dev

New changes are detected. LGTM label has been removed.

k8s-ci-robot avatar Dec 20 '22 18:12 k8s-ci-robot

[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.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Dec 20 '22 18:12 k8s-ci-robot

Hi Damien, could you help review as well? Thanks! cc @dgrisonnet

CatherineF-dev avatar Jan 09 '23 16:01 CatherineF-dev

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar May 10 '23 16:05 k8s-triage-robot

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Jun 09 '23 16:06 k8s-triage-robot

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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 avatar Jul 09 '23 16:07 k8s-triage-robot

@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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

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.

k8s-ci-robot avatar Jul 09 '23 16:07 k8s-ci-robot