79292973

Date: 2024-12-19 02:33:33
Score: 0.5
Natty:
Report link
  1. How can I modify the Prometheus relabel_configs to include the LoadBalancer Ingress field for scraping?
  2. 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.

Reasons:
  • Blacklisted phrase (0.5): How can I
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): How can I
  • Low reputation (0.5):
Posted by: Ponsakorn30214