-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Unable to export prometheus metrics be following the steps provided #1253
Comments
Hi @draghuram, As we spoke in the PR I am unable to reproduce your scenario. Following the steps used to check it.
Now, we can access the Prometheus here: http://localhost:9090/
Creating the project
PS.: Select y and y options to create the CRD and controller Enabling the Prometheus
Installing the Project in the cluster
All worked fine as expected. |
Hi @draghuram, As you can see all worked as expected. So, could you provide the following information?
c/c @mengqiy |
/assign @camilamacedo86 |
Ok. May be there is some problem with the Prometheus operator as you suggested before. I will switch to kube-prometheus at some point but please proceed with the changes as they seem to work. |
I was following steps in #1030 except that I used Prometheus operator (https://github.com/coreos/prometheus-operator) instead of kube-prometheus.
I just realized that I used kubebuilder that I built locally few days ago from master branch. However, I have been using 2.1.0 for my other project. I will retest with this version and kube-prometheus. Note that I already had minikube v1.4.0 running prior to this test. |
Hi @draghuram, Just one point of attention. See that if you use minikube to setup the Prometheus as described in the doc is required to:
and
|
Same problem here, using Prometheus Operator instead of kube-prometheus. https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint are the updated docs for I couldn't find anything from a quick look at the proxy that would allow prometheus to scrape over https using the field though, but it wasn't as big of a deal to use https for us at this point, so just switched back to http and fixed the resources generated by I had only checked this usage on an AKS cluster that already had the Prometheus Operator running, not on Would also like to point out that the check for the operator metrics given in the comments does not show any of the actual operator metrics, just other metrics from that namespace. No idea if the actual operator metrics do show up in that check, but I had just been checking the prometheus targets that the operator target was up and did not have any errors. |
@camilamacedo86 I played a bit with the new
And asked the user to grant permissions to Prometheus by creating ClusterRoleBinding like the following.
|
HI @mengqiy, I follow all steps of the documentation to install Prometheus operator and how to use it with minikube then, I am unable to face any issue related to the Prometheus do not find the endpoint. Could you reproduce the scenario where the endpoint is not found in Prometheus? Was it solved with the ClusterRole added above? If yes, could you share it? Also, If it is required in some scenario I agree with you that scaffold is the best option. PS.: Since is a ClusterRole I think that the namespace can be Since I am unable to reproduce the scenario I did a PR with your suggestion @draghuram and @DustinChaloupka could you help us to verify it as well? |
Who will be using this permissions? |
Prometheus Operator seems to be the only controller needs permissions to do CRUD on ServiceMonitor and it should already have the proper permission if using kube-prometheus. |
The above roles are just useful if we would create the ServiceMonitors programmatically, which is not the case in the kubebuilder. Really tks for your help with @mengqiy |
The PR: #1317 closes it. |
I'm not sure if I have a different version of the Prometheus operator, but for me the endpoint scheme does not default to
|
this is also my question |
I faced this issue in kubebuilder 3.3.0 I noticed that the picture in #1253 (comment) only show metrics from kubelet and kcm, not the actual pod. I found 2 problems:
|
, I followed instructions in #1030 but I saw the following error in Prometheus for the metrics service endpoint:
"Get http://172.17.0.15:8443/metrics: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02""
Note that Prometheus was using "http" to access the end point. So I added the following
to "endpoints" of ServiceMonitor but then got this (expected) error:
"Get https://172.17.0.15:8443/metrics: x509: cannot validate certificate for 172.17.0.15 because it doesn't contain any IP SANs"
This is because the certificate used by the metrics service is not issued for the IP. I think we need to pass proper certificate info in "tlsConfig" (see https://coreos.com/operators/prometheus/docs/latest/api.html#tlsconfig). Either that or we need to enable no auth access to metrics end point.
Just to be clear, I am using Prometheus operator and not kube-prometheus but I doubt if that makes any difference. I will see if I can install the later and give it one more try but I would still expect similar errors as metrics end point is served only with "https".
Motivation: #1245 (comment)
The text was updated successfully, but these errors were encountered: