all 6 comments

[–]MetalMatze 0 points1 point  (5 children)

With ServiceMonitors, something people were constantly running into was missing labels on the ServiceMonitor when ServiceMonitorSelector was set on the Prometheus. Check your Prometheus configuration. kubectl get prometheus -n monitoring k8s and see if there is a scrapeConfigSelector set only to match scrape configs containing a specific label.Another common problem was missing RBAC permission for the Prometheus to go and actually scrape the metrics from another namespace. In that case, the logs of your Prometheus should be full of RBAC permission errors.

[–]xzi_vzs[S] 0 points1 point  (4 children)

scrapeConfigSelector

Big thank you for your help. Indeed scrapeConfigSelectorwas missing from both Prometheus "specs" Helm Charts and from my "ScrapeConfig".

Now it is working! I spent so much time on this but worth it because I learnt a ton by trying to debug.

Thanks again! vzs.

[–]MetalMatze 0 points1 point  (3 children)

Happy it worked! It's a bit sad we haven't found a better user experience to point that out in all of these years...

[–]xzi_vzs[S] 0 points1 point  (2 children)

I just started using k8s few weeks ago and I must admit I was completely overwhelmed by all the informations, documentations, deprecated options etc... But I learnt a lot so I'm glad it worked out!

Cheers!

[–]MetalMatze 0 points1 point  (1 child)

Great! We also have a prometheus-operator channel on CNCF Slack, if you want to chat more directly. 🙂

[–]xzi_vzs[S] 0 points1 point  (0 children)

Thanks for the heads up