skip to Main Content

I’ve been using both Kube-Prometheus-Stack and Ingress-Nginx helm charts. I tried following this guide in the official docs and it did help getting the Ingress target and some of its metrics like in the picture below but it’s missing some the metrics that are specified in the Ingress docs like nginx_ingress_controller_requests which I’m trying to use in order to monitor Nginx’s status codes metrics. Everything is configured as said in the guide i mentioned earlier. Below are the currently available metrics. Does anyone know what’s missing?

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    I found the solution. According to this github issue, all that's needed is to add the following arg to the Ingress Nginx deployment: --metrics-per-host=false


  2. The nginx_ingress_controller_requests metric won’t appear until you make at least one request to an ingress resource. This is expected behavior – the metric only gets created after the first request comes through.

    To fix this, you have two options:

    1. Make a test request to your ingress to initialize the metrics
    2. Add the --metrics-per-host=false argument to your ingress-nginx deployment.

    The second option is recommended if you want the metrics to appear immediately, though note that you’ll lose per-host labeling and only have per-ingress labels.

    Note: When using wildcard ingresses, metrics are disabled by default to prevent cardinality explosion. If you need metrics for wildcard ingresses, you can enable them with:

    --metrics-per-undefined-host=true --metrics-per-host=true
    

    Just be aware this may significantly increase the number of metrics.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search