Help setting up multi-target Percona-MongoDB exporter

Hello,

I am having a problem in setting up Percona exporter. I am running mongoDB in a K8s environment in a replicaset manner. I have setup a headless service and it all seems to work. To monitor my instance, I want to employ Percona exporter’s multi-target feature. However I don’t seems to get it work.

This is my connection string:

–mongodb.uri=mongodb://u:p@mongodb-0.mongodb:27017,mongodb://u:p@mongodb-1.mongodb:27017,mongodb://u:p@mongodb-2.mongodb:27017/?authSource=admin

After deploying this, I don’t see error in the container. I only this this line:

level=info ts=2023-10-23T10:34:23.698Z caller=tls_config.go:195 msg="TLS is disabled." http2=false

When I port-forward, and I go to the path /scrape?target=mongodb://mongodb-2.mongodb:27017 I see a page and there’s only one hyperlink to metrics which only shows metrics of the first pod. How can I fix that?

Hi @Mustansir_Hussain ,

Welcome to Percona Community !!
You need to have separate mongodb exporter for each node in a replicaSet. Point each of them to one of the instances instead of using the replica set connection string.

Regards,
Parag

Hello,

Thanks for your reply! So what is exactly the use-case for the multi-target support?