-
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
Metrics does not count requests on ingresses without host #3713
Comments
@aledbf Perhaps we could match the prefix of the request path against the paths on the ingress? In addition to the host filtering. In that case we will not have more metrics series than host+path combinations of all ingresses? Right now we have lost our ability to monitor/alert on a majority of our services request failuere rate... which is really bad for us in the ops department. We use a single domain (for CORS reasons) and just have ingresses routing on path for about 120 microservices. |
@aledbf would you accept PR with proposed fix or do we need to maintain a fork or move to another ingress controller? |
@jonaz Did you find a solution for this? |
Just wanted to thank @jonaz for opening this issue, as this was the reason Grafana wasn't showing anything for me. It might be worth mentioning this in the monitoring section of the docs. I'd imagine others might assume a fan-out without a host would generate metrics. |
Would it make sense to change the code here to export all ingress metrics when per-host metrics are disabled though? We're losing a lot of metrics that are essential to monitoring this in production because the metrics are just not passed on. Here's the flag I'm talking about: #3594 Here's the code in question I'm suggesting we change: ingress-nginx/internal/ingress/metric/collectors/socket.go Lines 224 to 227 in ddedd16
|
My solution above would protect against DDOS and also support metrics on all paths+hosts. But no word from maintainers here yet. |
I like your solution in terms of host labels being present on the metrics, as it definitely protects against high cardinality in case of a DDOS. Having said that though, when My thinking is that maybe we need both; if It would certainly be useful to get some thoughts from some of the maintainers here; I'm interested in submitting at least one PR to do one or the other approach, but I don't want to do that work if there's no interest in accepting such a change. |
Are there any concrete plans on the timeline for this? We also have the issue, that we basically are blind in terms of nginx metrics, as we give every customer a custom subdomain (so we use a wildcard domain and hence have not metrics). IMHO it would be a good solution, to just record the wildcard host. For example: We have an ingress for host I would try to help improve this, but I have no experience with Go :( |
I created a PR #4139 to fix that one gets metrics at least when running with |
I totally agree with @choffmeister - there are quite a few use cases where you have to use wildcards and still get metrics (without tagging them with host). However, I think that this behavior must be controlled via a separate option/flag for several reasons:
My suggestion would be a flag that disables filtering metrics for ingress with wildcard and keep the @aledbf What do you think about this approach? |
Hi @jonaz Any news with this issue? |
Shame the PR seems to have gone quiet.... its also blocking us from upgrading from 0.18 so looking forward to it being merged |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
@hairyhenderson |
@aledbf I also just ran into this issue (today as a matter-of-fact). IMO the linked PR (#4139) is a reasonable way to go. In the case that someone has a wildcard ingress IMO it makes sense to just exclude the Is there anything remaining to get the PR merged in? |
Very unlikely to ever happen. I'd recommend you name all of your ingresses (this is the approach I took to get around this issue). It isn't that hard, especially when using some form of automation to deploy Kubernetes apps (Helm or in my case Terraform). Sticky Session also starts working again when doing this :) Long term, traefik might be the way to go, depending on if or not ingress-nginx picks up a new maintainer with aledbf stepping down. Disclaimer: this isn't a dig, ingress-nginx is a great piece of work and I highly appreciate the work aledbf has done on it. Just trying to point out a workaround and the fact things are bleak right now but hopefully someone/some others will step up. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
I am also experiencing the same issue not getting nginx_ingress_controller_requests metrics if I don't define the host This doesn't generate metrics for nginx_ingress_controller_requests
This generate metrics for nginx_ingress_controller_requests
Would be great if we could get the fix for this. |
I even lose my metrics when I made my host a wildcard. |
I also cannot see metrics of hosts with wildcard, there is a workaround? |
@DanOfir no, this has effectively stalled, and caused more than a few people to simply switch to a different ingress controller. See #4139 (comment) for some related conversation. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Closing. Fixed in master #4139 |
Is this a request for help? Yes , bug with possible solution.
What keywords did you search in NGINX Ingress controller issues before filing this one? missing metrics (#3053 looked promising, but wrong version. according to git commit this bug was introduced in 0.20.0)
Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT
NGINX Ingress controller version: 0.22.0 (bug introduced in 0.20.0)
Kubernetes version (use
kubectl version
): 1.7.14Environment:
uname -a
): 4.14.96-coreosWhat happened: ingresses without specific host does not report metrics.
What you expected to happen: All ingresses should have metrics.
How to reproduce it (as minimally and precisely as possible):
Create an ingress without host set.
Anything else we need to know:
Hi we just upgraded to 0.22.0 from 0.15.0 and now have the issue with dissapearing metrics.
I looked a the code and found this commit which introduces the problem:
9766ad8
If you have an ingress that does not specify host it will never find a match and not increase the metric counter.
So all ingresses without host will be without metrics now :(
I'm not 100% familiar with the codebase and not quite sure how to solve it since we cannot know if ingress is missing host at that time. Perhaps hosts field on SocketCollector could be a
In that case we can know when not to skip because its a wildcard?
msg in handleMessage in SocketCollector looks like on a request on an ingress that does not have host. It looks korrect.
The text was updated successfully, but these errors were encountered: