No reachable servers source="connection.go:86"

I am setting up prometheus mongodb exporter in standalone server. My mongodb is running on localhost:27017 and expose at localhost:9216 but the mongodb_up is still 0.
ERRO[0000] Cannot connect to server using url http://test:testing@localhost:27017/admin: no reachable servers source=“connection.go:86”
ERRO[0000] Can’t create mongo session to http://test:testing@localhost:27017/admin source=“mongodb_collector.go:202”
FATA[0000] listen tcp localhost::9216: bind: address already in use source=“server.go:122”

here is prometheus config
scrape_configs:

  • job_name: “mongodb_exporter”
    static_configs:
    • targets: [“localhost:9090” , “localhost:9216”]

Hello, I have the same problem. Did you find the solution?

I also tried with external mongodb uri string but it is still going and can’t find solution.

I changed the bind port and exporter version to latest