Name: mysql-exporter-prometheus-mysql-exporter To enable service monitor run: helm install prometheus-community/prometheus-mysql-exporter -set serviceMonitor.enabled=true Code language: HTML, XML ( xml ) So with this, if you are modifying the default Prometheus operator configuration for service monitor scrapping, make sure you use the right labels in your service monitor as well.Īdd a service monitor and make sure it has a matching label and namespace for the Prometheus service monitor selectors (serviceMonitorNamespaceSelector & serviceMonitorSelector). Here you can see that this Prometheus configuration is selecting all the service monitors with the label release = kps To check your Prometheus configuration: Kubectl get prometheus -n -o yaml Code language: HTML, XML ( xml )Ī sample output will look like this. By default, the Prometheus operator comes with empty selectors which will select every service monitor available in the cluster for scrapping the data. Prometheus.io/scrape: "true" Code language: PHP ( php )Īdd/update Prometheus operator’s selectors. Replacement: $ 1:$ 2 Code language: PHP ( php ) Regex: true # prometheus.io/path: "/scrape/path" annotation. # Example relabel to scrape only endpoints that have # prometheus.io/scrape: "true" annotation. With this, Prometheus will automatically start scrapping the data from the services with the mentioned path. With this, a default scrap config can be added to the prometheus.yaml file and an annotation can be added to the exporter service. This method is applicable for Kubernetes deployment only
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |