-
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
Incorrect service name emitted in some metrics #10210
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/test-infra repository. |
/remove-kind bug Does this seem like your use case https://kubernetes.github.io/ingress-nginx/user-guide/monitoring/#wildcard-ingresses |
I don't think so. We do use the |
Can you test with /test as a specific path and see if the issue is the same? There may be an issue with pathType and the same path, /, the controller may not be differianating them. Also can you try this in the latest relase, 1.8.1? |
This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach |
Adding a /test path that is an exact match works as expected.
I've tested with 1.10.0 and still get this issue |
I think I understand what is happening here. I plan to submit a PR if that is fine with you |
Fix: kubernetes#10210 This handles the case where multiple rules have identical paths, but differing types.
/assign |
What happened:
When defining two backends, as such:
We only get metrics for the
service-a
backend.What you expected to happen:
To be able to get metrics for each backend.
NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):
Kubernetes version (use
kubectl version
):Environment:
Cloud provider or hardware configuration: AWS (via kOps)
OS (e.g. from /etc/os-release): Ubuntu 20.04.5 LTS
Kernel (e.g.
uname -a
): 5.15.0-1031-awsInstall tools: kOps
Please mention how/where was the cluster created like kubeadm/kops/minikube/kind etc.
Basic cluster related info:
kubectl version
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.8", GitCommit:"0ce7342c984110dfc93657d64df5dc3b2c0d1fe9", GitTreeState:"clean", BuildDate:"2023-03-15T13:33:02Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}kubectl get nodes -o wide
Ubuntu 20.04.5 LTS 5.15.0-1031-aws containerd://1.6.18How was the ingress-nginx-controller installed:
Installed via Helm using ArgoCD
Current State of the controller:
Controller is running and working as expected, except for this metric
Current state of ingress object, if applicable:
All Ingress objects are fine and the controller handles requests fine.
How to reproduce this issue:
Create an ingress object with multiple
/
paths, of different types.Send traffic to both matches
/
and/test
.Look at resulting metrics.
Anything else we need to know:
I looked at the resulting configuration and compared them to see if I can find the issue. This seems to highlight the bug:
This config is fine, except that
set $service_name
is the same in both.It seems that the problem is happening around here:
Which I think comes from https://github.com/kubernetes/ingress-nginx/blob/controller-v1.3.0/internal/ingress/controller/template/template.go#L1061-L1149
I think the expected diff is as such:
The text was updated successfully, but these errors were encountered: