-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Prometheus example can't get metrics from the router instance #17685
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
AFAIU this relates to prometheus/prometheus#2614. The 500 error is what the router returns for unauthenticated requests (tested manually from a browser). The Kubernetes service discovery can't use relabeling to override the authentication parameters used during scraping as the example seems to imply. |
@pgier noted that there is a typo in the example template. The relabeling section expects the annotations on the router service to be Prometheus config
Router service
Nevertheless I've fixed the typo in the |
I've also confirmed that when I configure an additional scrape job for the router that uses the annotated credentials, Prometheus can pull the metrics successfully. |
I'm struggling with this exact problem. From the research I've done, it doesn't appear that Prometheus actually supports basic auth annotations in any form at all. |
It does not work with any upstream release. See prometheus/prometheus#1176. |
Since this does not appear to work, why is it even in the config then? This is very confusing as I have now spent a lot of time thinking that it was me that was doing something wrong, when in reality prometheus doesn't even support this option. It would be nice if it did, so don't get me wrong. But again its just very misleading and should be removed. |
Maybe, as a temporary hac^^^fix you could remove basic auth from haproxy 1936 port while allowing only infra nodes to connect locally to this port. |
@ibotty Are the patches public? |
I don't know of any (public or not) patches. |
So it won't work with Red Hats prometheus, too? |
It may have been fixed in the master branch (I'm currently checking). |
Things have improved a bit on master but it is not quite there yet (at least when using From what I can tell, #18254 isn't sufficient because while Prometheus authenticates with the With increased router's log level:
As a workaround, I've added
After this, Prometheus was able to scrape the target correctly: I'm currently testing a change locally and will send a PR if it is successful. |
@simonpasquier I'm looking for the patches that support the Also see: https://github.com/openshift/openshift-ansible/blob/release-3.7/roles/openshift_prometheus/templates/prometheus.yml.j2#L152 Does it work with auth basic? Or are the annotations for nothing? I'm asking for a prometheus deployment which live outside the cluster. |
@jkroepke IIRC the patches were included in the openshift/prometheus image at some point but not anymore.
The annotations are useless from my POV because they can't be interpreted by Prometheus. |
Closed by #19318 |
I've deployed the Prometheus application from the examples directory and I've noticed that Prometheus discovers the router instance but scraping fails.
Version
oc v3.7.0+7ed6862
kubernetes v1.7.6+a08f5eeb62
features: Basic-Auth GSSAPI Kerberos SPNEGO
Server https://127.0.0.1:8443
openshift v3.7.0+7ed6862
kubernetes v1.7.6+a08f5eeb62
Steps To Reproduce
Current Result
The router instance is reported as DOWN in the kubernetes-service-endpoints job. The associated error is
server returned HTTP status 500 Internal Server Error
.Expected Result
The router instance is UP and reports metrics in Prometheus.
Additional Information
The text was updated successfully, but these errors were encountered: