aws-load-balancer-controller
aws-load-balancer-controller copied to clipboard
Emit Metric for all ingresses/services that create ALB/NLBs
Is your feature request related to a problem? As an operator of the controller, I'd like to know how many ingresses and services the controller is "in control of." For example if there are 4 services annotated for NLB, I want an easy way to view that.
Describe the solution you'd like Can we add a metric that the controller emits to count ingresses that it currently tracks? Can we also tag that metric with the name and namespace that the ingress/service is in?
Describe alternatives you've considered I have scripts that look through the cluster resources. I look for annotations on ingresses and services that would create an NLB. This works, but it's kinda hacky and I have to do it for every cluster.
Another thing I can do is write a service that watch
es for ingresses and services with the annotation and emits the metric. I would have to update it every time annotations in the aws-lb-controller change though. Then I'd deploy that to every cluster and look at metrics.
The real reason I want to do this is because I want to keep track of how widely used this is within a fleet of clusters. It's easy enough to count ingresses/services for one cluster, but doing it for over 💯 is tough. If I know that 0 NLB/ALBs are being created by the controller, I can safely uninstall the controller from a cluster where it's not being used.
I'm also happy to throw up a PR 🙏