I would like to add a ServiceMonitor to stable/prometheus-mysql-exporter. The current discovery mechanism (prometheus.io/scrape), doesn't work for the common Prometheus Operator setup. From what I can tell, coreos/kube-prometheus hasn't supported this annotation-driven mechanism since ~2017.
Is your feature request related to a problem? Please describe.
Yes, this chart is not compatible out-of-the-box with Prometheus Operator. I would need to write an additional chart to add a ServiceMonitor for this Deployment.
Describe the solution you'd like
I would like to add a monitoring.coreos.com ServiceMonitor. It will selector.matchLabels on app: {{ template "prometheus-mysql-exporter.name" . }}.
Optionally, I could _remove_ the prometheus.io/* default annotations. This would be a breaking change, but there may not be many users affected. Perhaps it would make sense to do that in a separate PR.
Describe alternatives you've considered
I could roll my own chart which creates a ServiceMonitor. It could be installed alongside stable/prometheus-mysql-exporter or wrap it with a dependency. However, this makes our configuration slightly more complicated, and doesn't allow the community to benefit from my work.
/cc past contributors @monotek @Tarick @estahn @Juanchimienti
I'll put up a PR soon, hopefully today.
Prometheus exporter charts with existing support for ServiceMonitor:
We have had to create a separate chart to add a servicemonitor that interoperates with this chart. This would be a very welcome addition.
Most helpful comment
Prometheus exporter charts with existing support for ServiceMonitor: