-
Notifications
You must be signed in to change notification settings - Fork 2k
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
endpoints: export number of ports as new metric #1571
endpoints: export number of ports as new metric #1571
Conversation
Welcome @bavarianbidi! |
Should we consider exposing the actual ports and calculate the count through PromQL? I expect the values to change rarely so there won't be a big cardinality increase. cc @dgrisonnet |
Yes, kube-state-metrics shouldn't be responsible for the computation. As an exporter, its only goal is to expose kubernetes objects data as metrics. Any computation such as getting the total number of ports should be done in promQL. |
i'm totally fine with that and it's only consequent (as mostly every kube-state-metric created metric is done that way) for doing this for the new But especially in WDYT @dgrisonnet and @fpetkovski |
Uh, since those metrics are already stable, we might need to publish a new major release if we want to drop them. We can leave them as they are for now and if we need the raw data, we can add new metrics. |
hi @mrueg / @fpetkovski / @fpetkovski sorry for the late reply. I implemented your findings for now. PTAL |
9aca377
to
df17743
Compare
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's just one nit from my side, everything else looks really good now.
metric - introduce new kube_endpoint_ports metric: * export all relevant port infomation (port name, port number and port protocol) from an endpoint tests - make endpoint tests endpoint.spec aware: * endpoint port struct with multiple ports need port names per port * single port struct doesn't need a port name * port protocol is per default TCP Signed-off-by: Constanti, Mario <mario.constanti@daimler.com>
df17743
to
27366d7
Compare
Done. |
/lgtm Thanks for following through with this contribution! |
/lgtm Thanks for your contribution! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bavarianbidi, fpetkovski, mrueg 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 |
What this PR does / why we need it:
Export the number of ports per endpoint.
The number of Ports per service can change during their lifetime. When changing a service with type
LoadBalancer
, the cloud-specific controller mostly change corresponding Loadbalancer-Objects on the cloud-provider side.If a customer add a new Port to an existing Service-Object, the Endpoint will be updated and the cloud-controller will update the Loadbalancer object on cloud-provider side and a new Listener will be added.
In this special case, the metric can be read as "number of Listeners on a Cloud-Provider Loadbalancer side".
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 #
Signed-off-by: Constanti, Mario mario.constanti@daimler.com