I have added pgbouncer-exporter
container to my deployment. It is emitting the metrics on port 9100
.
I want to add a scraper for these metrics so that it becomes visible in Prometheus.
How can I do it by using Kubernetes ServiceMonitor
?
I'm unfamiliar with pgbouncer-exporter
but the principles are consistent irrespective of technology.
You'll need to:
pgbouncer_exporter
's port (default 9127
?) is published so that the /metrics
are accessible beyond the Pod.GET
'ting the endpoint (e.g. kubectl port-forward
to the Deployment
) to ensure that /metrics
is accessible.ServiceMonitor
or PodMonitor
. If you have a Service exposing pgbouncer_exporter
, then use ServiceMonitor
. Otherwise, use PodMonitor
*Monitor
's selector
and port
Namespace
of your Deployment
.