Configuring prometheus to scrape only one pod of a service

88 views
Skip to first unread message

anurag

unread,
May 13, 2021, 12:12:36 PM5/13/21
to Prometheus Users
Hi All,
   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.
Best ,
Anurag
Reply all
Reply to author
Forward
0 new messages