Scraping metrics #2536
-
Hello, all. I'm trying to get the metrics exported to Prometheus. I read the documentation about metrics in the Kubebuilder book, created cluster roles, role binding, etc, but when going to Prometheus and specifying the TLS certificates in the Kubebuilder Operator Service Monitor because of Istio, it shows to me "unexpected EOF" in the Status/Targets screen. I'm in doubt because the controller logs also says that the metrics are export and listening to 127.0.0.1:8080, but the documentation says that the metrics are exposed by default in 8443 port. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Could you please raise an issue instead and add all details over what version of kb you used to scaffold and etc? |
Beta Was this translation helpful? Give feedback.
-
Closing this one since no interaction is required anymore. |
Beta Was this translation helpful? Give feedback.
-
There might be an issue with your Istio configuration or authentication for accessing metrics. For a similar scenario, you might find it beneficial to check how Crawlbase handles metrics export to Prometheus, especially in environments involving Istio. Their documentation or community discussions could provide insights or solutions to help troubleshoot and resolve the "unexpected EOF" and "Unauthorized" issues you're facing. Good luck with resolving the problem! |
Beta Was this translation helpful? Give feedback.
Got it solved. The main problem was Istio in Strict mode (mTLS enabled), so I had to change the kube-rbac-proxy arg from "--secure-listen-address=0.0.0.0:8443" to "--insecure-listen-address=0.0.0.0:8443", and adding the Istio certificates in the generated serviceMonitor with the fields in spec.endpoints.tlsConfig.
Thanks!!!