feat(ingress): add kube_ingress_status_load_balancer metric#2863
feat(ingress): add kube_ingress_status_load_balancer metric#2863redbaron wants to merge 1 commit intokubernetes:mainfrom
Conversation
Captures load balancer created for an Ingress and reported in `status.loadBalancer.ingress[]` array.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: redbaron The full list of commands accepted by this bot can be found here. DetailsNeeds 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 DetailsInstructions 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 @redbaron! |
| "", | ||
| wrapIngressFunc(func(i *networkingv1.Ingress) *metric.Family { | ||
| if len(i.Status.LoadBalancer.Ingress) == 0 { | ||
| return &metric.Family{ |
There was a problem hiding this comment.
Is there a need for the early return?
If i.Status.LoadBalancer.Ingress is empty then ms will be equally empty and thus Metrics: ms, will be equal to Metrics: []*metric.Metric{} in this early return.
| `, | ||
| MetricNames: []string{"kube_ingress_info", "kube_ingress_metadata_resource_version", "kube_ingress_created", "kube_ingress_labels", "kube_ingress_path", "kube_ingress_tls"}, | ||
| }, | ||
| { |
There was a problem hiding this comment.
A test case to verify no metric family is returned when no load balancer ingress exists will verify there is no unwanted behavior either.
|
Thank you for contributing! 🎉 I'm not a maintainer but I like to help out where I can. The comments I left are some low-hanging fruit you could take a look at early in the process so there is less waiting involved when a maintainer takes a look at your PR 😉 |
Captures load balancer created for an Ingress and reported in
status.loadBalancer.ingress[]array.What this PR does / why we need it:
Some times we need to know load balancer created for an ingress .
Name
kube_ingress_status_load_balanceris chosen to follow pattern established by thekube_service_status_load_balancer_ingressmetric.How does this change affect the cardinality of KSM:
It introduces new fairly low-cardinality metric
kube_ingress_status_load_balancer. Only cardinality concern is IP, but on major cloud providers I am aware it is not reported. Plus if it was a problem in some setups I suppose IP label can be blacklisted.Fixes #1366