-
Notifications
You must be signed in to change notification settings - Fork 3.8k
How to monitor Nginx ingress controller? #2119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is everything running in the Looking at the services you posted, could make sure that the metrics port is 9913 and the labels are the same?
Feel free to paste your output of |
@metalmatze Yes, everything is running in the default namespace. Here is the output of the service:
|
Any update on this? |
I still do not really get why you have |
I changed the port to 10254/tcp and it still doesn't show anything. Is prometheus config automatically reloaded after every servicemonitor change? |
@ArjonBu yes, the Prometheus configuration is automatically re-generated and reloaded after every change to a ServiceMonitor that it is watching. It is possible that your Prometheus is not selecting this ServiceMonitor for some reason. Can you please share the Prometheus manifest? |
@squat I installed prometheus operator using the official helm chart. If you meant the serviceoperator. I have pasted it in the first post. |
@ArjonBu the helm charts are not maintained by this team, plus there are many ways to configure the chart to have different behaviors. Can you please share the output of |
@squat Here is it:
|
@ArjonBu thanks, that's super helpful. It appears to me that indeed your Prometheus is not selecting your ServiceMonitors due to mismatched labels. Notice that your Prometheus objects has: serviceMonitorSelector:
matchLabels:
release: prometheus-operator but the only labels on your Ingress Controller ServiceMonitor are: app: nginx-ingress In order to select your Ingress Controller ServiceMonitor, you will need to add: release: prometheus-operator to the ServiceMonitor's labels so that it looks like: apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: nginx-ingress-controller-metrics
labels:
app: nginx-ingress
release: prometheus-operator
spec:
endpoints:
- interval: 30s
port: metrics
selector:
matchLabels:
app: nginx-ingress
release: nginx-ingress
namespaceSelector:
matchNames:
- default |
Works! Thank you |
@ArjonBu, I’m very glad this solved the issue for you. I’ll close this now since everything is working. |
Uh oh!
There was an error while loading. Please reload this page.
What did you do?
I am trying to monitor Nginx ingress controller with Prometheus operator.
I have installed Nginx ingress controller using the official helm chart and I have enabled metrics, stats, and I have enabled the following annotations for metrics:
The ingress controller will create the following services:
Environment
v0.25.0
v1.10.6
Kops, AWS EKS
I think I am doing something wrong with the ServiceMonitor manifest file. Can someone help?
Thanks in advance
The text was updated successfully, but these errors were encountered: