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

feat: Move endpoint ports into address metric

Open mrueg opened this issue 1 year ago • 11 comments

What this PR does / why we need it:

This moves the labels from kube_endpoint_ports int kube_endpoint_address (as the subset in an endpoint can contain multiple addresses and ports that need to be linked together) This change also marks kube_endpoint_ports as deprecated

Fixes #2408

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality) This change creates ports * addresses metrics instead of ports + addresses metrics.

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 #2408

I will fix tests later once we have an agreement to move forward like this.

mrueg avatar Sep 22 '24 20:09 mrueg

/lgtm

CatherineF-dev avatar Sep 22 '24 21:09 CatherineF-dev

Do we need to add this breaking change into release notes later?

CatherineF-dev avatar Sep 22 '24 21:09 CatherineF-dev

Do we need to add this breaking change into release notes later?

Yes, I'll make sure it's part of the changelog of the next release.

mrueg avatar Sep 24 '24 13:09 mrueg

/lgtm

CatherineF-dev avatar Sep 24 '24 13:09 CatherineF-dev

/triage accepted /assign

dgrisonnet avatar Oct 03 '24 16:10 dgrisonnet

@rexagod @dgrisonnet are you okay with this? Then I'll start adjusting the tests.

mrueg avatar Oct 15 '24 08:10 mrueg

What was the preference for empty labels again? Omit them?

e.g. port_name in this metric:

kube_endpoint_address{endpoint="single-port-endpoint",ip="10.0.0.1",namespace="default",port_name="",port_number="8080",port_protocol="TCP",ready="true"} 1

We keep it in kube_endpoint_ports.

mrueg avatar Oct 16 '24 07:10 mrueg

I'd say so.

rexagod avatar Oct 16 '24 18:10 rexagod

I'd say so.

Thanks! This is now ready for review.

mrueg avatar Oct 17 '24 20:10 mrueg

/lgtm

Thank you for all the great work, not just this PR, but everything! 🙇

rexagod avatar Oct 20 '24 10:10 rexagod

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CatherineF-dev, mrueg, rexagod

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 Oct 20 '24 10:10 k8s-ci-robot

(this is for people who come after me) I'm using 2.12.0 because kube 1.29.x, but the fix was put into kube-state-metrics 2.14.0 (for kube 1.31.x) and not backported. It's a moot point; kubernetes 1.30.x expires in April or July of this year, we'll be forced to upgrade and correspondingly upgrade kube-state-metrics.

MosesMooreGameloft avatar Feb 13 '25 21:02 MosesMooreGameloft