We have a kubernetes service which runs on multiple pods and is scraped by prometheus at the default metrics endpoint /service/metrics. In addition to existing metrics, we need to have a custom metrics which is generated by querying the DB, we would like this custom metrics be scraped from one of the service pods and not all the pods. We want to implement this custom metrics using prometheus exporter/custom collector as detailed here:
https://blog.skyrise.tech/custom-prometheus-exporter. Please note the pods of the service come and go, how can we configure prometheus to scrape only one of its service pods for this custom metrics.
Please guide, thanks a lot for your kind help.