DEV Community

Tomoyuki KOYAMA
Tomoyuki KOYAMA

Posted on • Updated on

Nginx Ingress returns only a few metrics on Kuberntes.

Situation

To visualize http requests on grafana, I installed Nginx Ingress and Prometheus in Kubernetes Cluster (RKE2). The installation steps are based on official guide as follows.

https://kubernetes.github.io/ingress-nginx/

The similar problem is reported on GitHub.

https://github.com/kubernetes/ingress-nginx/issues/5755

The figure shows this situation.

Image description

Cause

This problem is caused by not specifying the 'host' parameter in yaml for ingress controller.

The metrics server in nginx ingress only return a few metric about the default host * (generally virtual host). Thus, few metrics display on grafana.

Image description

Solution

When you create ingress resource, you set 'host' parameter in yaml. Then, you can check the metrics (such as nginx_ingress_controller_requests) in grafana.

Image description

Image description

Top comments (0)