- How can I modify the Prometheus relabel_configs to include the LoadBalancer Ingress field for scraping?
- Is there a specific label or field in the kubernetes_sd_configs that maps to the LoadBalancer Ingress field?
According to Prometheus service sd config, the LoadBalancer Ingress
isn't include as a meta field that will be scraped by Prometheus, the thing that can be scraped is IP
field.
I don't think you could scrape address from Ingress resource either.
I believe what you're trying to do is differentiate metrics by AWS's ELB hostname? The hostname of the ELB is generated for you every time you create an Ingress resources so setting a hard code will not be possible.
Maybe using AWS Load Balancer Controller's annotations such as alb.ingress.kubernetes.io/load-balancer-name
on Service or alb.ingress.kubernetes.io/load-balancer-name
on Ingress and configure Prometheus to scrape that annotation might be better?
You'd get to identify the load balancer created by AWS with name, while not have to worry about which hostname AWS will generated for you.