Closed mostafaghadimi closed 5 years ago
Try using: -mongodb.uri mongodb://root:example@mongo:27017
@mostafaghadimi - have you been able to make this work . ! I still have issue not getting full spectrum of mongo metrics through exporter .
@pauldintel Yes, I did. Please share the details about how you deploy your applications. In case of using Docker, there might be network related issues.
hi @mostafaghadimi thanks for offering the help . I am using mongo7.0.5, prometheus , nodeexporter , grafana and mongodb exporter in docker container (all inside same network bridge) . Below is the docker specification :
mongodb-exporter: hostname: mongodb-exporter container_name: mongodb-exporter image: mongoexport:prom command: ./mongodb_exporter-linux-amd64 -logtostderr -mongodb.uri mongodb://admin1:password@mongo1:27017/mydb -groups.enabled 'asserts,durability,background_flusshing,connections,extra_info,global_lock,index_counters,network,op_counters,op_counters_repl,memory,locks,metrics' restart: always ports:
Please note above mongo1 is the container name and mydb is the db name . the exporter linux utility is used in command line. the issue with the above is I am getting Authentication failed error : the prometheus portal shows mongo exporter is up and running on 9001 port and no issue . But just shows couple of http# metrics and nothing on mongo metrics shown . So my gut feeling is this is because mongo authentication failure.
Generally at this moment my thought is those user/password needs to be preexisting on the database. Once I create them in database with admin roles I started getting Panic error plus mongo exporter shows down in prometheus ..
So at this moment it is being very strange ! I want to use Grafana dashboard comes pre-shipped with mongo metrics that works on exporter and stuck on implementing that solution.
@pauldintel you're welcome. I think you can create user with environment variables and would you please also share your mongodb service in docker-compose file details?
@pauldintel take a look if this is relevant: https://github.com/dcu/mongodb_exporter/issues/110
I had the same message: panic: runtime error: invalid memory address or nil pointer dereference
I patched according to this comment and it worked.
I'm trying to dockerize mongodb monitoring from the tutorial I have seen in this page.
Here is my Dockerfile configuration:
Prometheus.yml:
docker-compose.yml:
The metrics I should see is this but now I just see the following metrics.