-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
The nginx_ingress_controller_requests metric not exposing the complete requestURI as label #12763
Comments
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
This is expected behavior. If this were not the case, you'd have a cardinality explosion. You should log your requests instead if you want the full request uri. If you want metrics for specific paths, you can break them out in the ingress object, or use different ingress objects for different paths. |
/remove-kind bug |
@alphabet5 So if breaking the endpoints into different paths in ingress is not feasible at my end, then you are suggesting that the option left is to use log level monitoring for Prometheus to fetch the request uri during sending 4xx or 5xx alerts. With this, there will be additional log aggregator tools set up that might be needed i believe So, was just curious if there is any way to configure nginx ingress controller to directly fetch request_uri as metrics or using any Prometheus exporters that can help me alert based on status code of requests at ingress level |
Prometheus, or time-series metrics in any fashion are not appropriate for monitoring based on request_uri. request_uri has high cardinality, which would create different metrics series in prometheus. If you want statistics broken down by uri, you should either manually specify them by separating out different paths or hosts with your ingress configuration, or log the requests to something like elasticsearch where you can query request uri patterns. You can use ingress-nginx metrics to alert on 4xx / 5xx requests, it's just not broken down by request_uri, just by ingress name, hostname, service, path, method, status, etc. For example, if I were to break down prometheus metrics by request_uri, I'd have about 10,000,000 different series for the past day. This would make querying the metrics impossible, and the statistics around them useless, because each series would have so few requests that any insight into performance would be meaningless. |
@alphabet5 Thanks for detailed info and suggesting other possible options. Will look into exploring those 🙂 |
/close |
@longwuyuan: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What happened:
I have installed nginx ingress controller and enabled controller metrics. Also added prometheus pod annotations to scrape metrics. When I use nginx_ingress_controller_requests metrics, it doesn't give me the entire requestURI in labels but just gives the host and path configured in kubernetes ingress manifest.
Query Ran :
Below are the labels that were output
What you expected to happen:
I wanted the nginx_ingress_controller_requests to provide me the requestURI as label output which gives me the complete URI of the request
NGINX Ingress controller version : 1.9.3
Kubernetes version : 1.30
Environment:
Cloud provider or hardware configuration: AWS EKS 1.30
How was the ingress-nginx-controller installed:
ingress-nginx ingress 36 2024-11-04 11:53:23.847501744 +0000 UTC deployed ingress-nginx-4.8.2 1.9.3
helm -n <ingresscontrollernamespace> get values <helmreleasename>
Can you please let me know if there is an option to get the complete requestURI in mertics scraped by prometheus from nginx ingress controller
The text was updated successfully, but these errors were encountered: