How to configure ingress-nginx metrics to show in Prometheus? #101
sonamsamdupkhangsar
started this conversation in
General
Replies: 1 comment 1 reply
-
Hi @sonamsamdupkhangsar to enable the Nginx Ingress Controller metrics in prometheus please use the following values additionalServiceMonitors:
- name: "ingress-nginx-monitor"
selector:
matchLabels:
app.kubernetes.io/name: ingress-nginx
namespaceSelector:
matchNames:
- ingress-nginx
endpoints:
- port: "metrics" Run the helm upgrade command for kube-prometheus-stack, at the end the metrics will be available (below is an example from my test) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have followed the starter kit using the Nginx Ingress controller instead of the Ambassador Ingress. I want to expose the Nginx Ingress metrics in Prometheus so I can see my app logs in Loki. This is what I have done to expose Nginx Ingress metrics:
I can see the Nginx Ingress metrics in this command:
I port-forwarded the ingress-nginx-controller-metrics and to check the metrics:
Check the Ingress metrics using curl:
So kind of like how it is done for the Ambassador Ingress stack here I put my changes in the additionalServiceMonitors section as follows:
I applied this change with Helm upgrade :
(I chose 27.2.1 version for kube-prometheus-stack as there was a updated one)
I then port-forward my Prometheus to check on the Status:
kubectl port-forward svc/kube-prom-stack-kube-prome-prometheus 9090:9090 -n monitoring
I then, navigate to Status -> Targets page but I don't see my Nginx Ingress there kind of like how it is mentioned for the Ambassador Ingress version.
Any ideas on how to get the Nginx Ingress metrics in Prometheus?
Beta Was this translation helpful? Give feedback.
All reactions